Core: Minor Options cleanup (#1182)

* Options.py cleanup

* TextChoice cleanup

* make Option.current_option_name a property

* title the TextChoce option names

* satisfy the linter

* a little more options cleanup

* move the typing import

* typing should be PlandoSettings

* fix incorrect conflict merging

* make imports local

* the tests seem to want me to import these twice though i hate it.

* changes from review. Make the various Location verifying Options `LocationSet`

* remove unnecessary fluff

* begrudgingly support get_current_option_name. Leave a comment that worlds shouldn't be touching this

* log a deprecation warning and return the property for `get_current_option_name()`

---------

Co-authored-by: beauxq <beauxq@yahoo.com>
Co-authored-by: black-sliver <59490463+black-sliver@users.noreply.github.com>
This commit is contained in:
alwaysintreble
2023-03-07 01:44:20 -06:00
committed by GitHub
parent e6109394ad
commit 414166f6a2
4 changed files with 43 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
import unittest
import Generate
from BaseClasses import PlandoOptions
from Options import PlandoBosses
@@ -123,14 +123,14 @@ class TestPlandoBosses(unittest.TestCase):
regular = MultiBosses.from_any(regular_string)
# plando should work with boss plando
plandoed.verify(None, "Player", Generate.PlandoOptions.bosses)
plandoed.verify(None, "Player", PlandoOptions.bosses)
self.assertTrue(plandoed.value.startswith(plandoed_string))
# plando should fall back to default without boss plando
plandoed.verify(None, "Player", Generate.PlandoOptions.items)
plandoed.verify(None, "Player", PlandoOptions.items)
self.assertEqual(plandoed, MultiBosses.option_vanilla)
# mixed should fall back to mode
mixed.verify(None, "Player", Generate.PlandoOptions.items) # should produce a warning and still work
mixed.verify(None, "Player", PlandoOptions.items) # should produce a warning and still work
self.assertEqual(mixed, MultiBosses.option_shuffle)
# mode stuff should just work
regular.verify(None, "Player", Generate.PlandoOptions.items)
regular.verify(None, "Player", PlandoOptions.items)
self.assertEqual(regular, MultiBosses.option_shuffle)