mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Update colorscheme to 1.2.2
This commit is contained in:
parent
34f61bdb30
commit
a6d1a435c9
2 changed files with 29 additions and 4 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"versions": {
|
"versions": {
|
||||||
|
"1.2.2": null,
|
||||||
"1.2.1": {
|
"1.2.1": {
|
||||||
"api_version": 7,
|
"api_version": 7,
|
||||||
"commit_sha": "109e61c5a",
|
"commit_sha": "109e61c5a",
|
||||||
|
|
@ -179,4 +180,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,32 @@ from bastd.ui.colorpicker import ColorPicker
|
||||||
original_buttonwidget = ba.buttonwidget
|
original_buttonwidget = ba.buttonwidget
|
||||||
original_containerwidget = ba.containerwidget
|
original_containerwidget = ba.containerwidget
|
||||||
original_checkboxwidget = ba.checkboxwidget
|
original_checkboxwidget = ba.checkboxwidget
|
||||||
|
|
||||||
original_add_transaction = _ba.add_transaction
|
|
||||||
# We set this later so we store the overridden method in case the
|
# We set this later so we store the overridden method in case the
|
||||||
# player is using pro-unlocker plugins that override the
|
# player is using pro-unlocker plugins that override the
|
||||||
# `ba.app.accounts.have_pro` method.
|
# `ba.app.accounts.have_pro` method.
|
||||||
original_have_pro = None
|
original_have_pro = None
|
||||||
|
|
||||||
|
|
||||||
|
def is_game_version_lower_than(version):
|
||||||
|
"""
|
||||||
|
Returns a boolean value indicating whether the current game
|
||||||
|
version is lower than the passed version. Useful for addressing
|
||||||
|
any breaking changes within game versions.
|
||||||
|
"""
|
||||||
|
game_version = tuple(map(int, ba.app.version.split(".")))
|
||||||
|
version = tuple(map(int, version.split(".")))
|
||||||
|
return game_version < version
|
||||||
|
|
||||||
|
|
||||||
|
# Adds backward compatibility for a breaking change released in
|
||||||
|
# game version 1.7.7, which moves `_ba.add_transaction` to
|
||||||
|
# `ba.internal.add_transaction`.
|
||||||
|
if is_game_version_lower_than("1.7.7"):
|
||||||
|
original_add_transaction = _ba.add_transaction
|
||||||
|
else:
|
||||||
|
original_add_transaction = ba.internal.add_transaction
|
||||||
|
|
||||||
|
|
||||||
class ColorScheme:
|
class ColorScheme:
|
||||||
"""
|
"""
|
||||||
Apply a colorscheme to the game. Can also be invoked directly
|
Apply a colorscheme to the game. Can also be invoked directly
|
||||||
|
|
@ -369,7 +387,13 @@ class CustomTransactions:
|
||||||
self.custom_transactions[transaction_code] = transaction_fn
|
self.custom_transactions[transaction_code] = transaction_fn
|
||||||
|
|
||||||
def enable(self):
|
def enable(self):
|
||||||
_ba.add_transaction = self._handle
|
# Adds backward compatibility for a breaking change released in
|
||||||
|
# game version 1.7.7, which moves `_ba.add_transaction` to
|
||||||
|
# `ba.internal.add_transaction`.
|
||||||
|
if is_game_version_lower_than("1.7.7"):
|
||||||
|
_ba.add_transaction = self._handle
|
||||||
|
else:
|
||||||
|
ba.internal.add_transaction = self._handle
|
||||||
|
|
||||||
|
|
||||||
def launch_colorscheme_selection_window():
|
def launch_colorscheme_selection_window():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue