From 0d03b1beced75d9e4822d41c119ddce2b102effe Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Mon, 5 Dec 2022 13:16:01 +0530 Subject: [PATCH 1/6] Added discord and GitHub textures on button --- index.json | 6 ++++++ plugin_manager.py | 55 +++++++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/index.json b/index.json index d2dd7bd..8ebb3fd 100644 --- a/index.json +++ b/index.json @@ -1,6 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { + "0.1.10": { + "api_version": 7, + "commit_sha": "21e58a1", + "released_on": "05-12-2022", + "md5sum": "d6c963bf62e5bfdcd3d83ff44b58f855" + }, "0.1.9": { "api_version": 7, "commit_sha": "09b6832", diff --git a/plugin_manager.py b/plugin_manager.py index 749e46a..9e32364 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -20,7 +20,7 @@ _env = _ba.env() _uiscale = ba.app.ui.uiscale -PLUGIN_MANAGER_VERSION = "0.1.9" +PLUGIN_MANAGER_VERSION = "0.1.10" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" CURRENT_TAG = "main" INDEX_META = "{repository_url}/{content_type}/{tag}/index.json" @@ -1665,10 +1665,12 @@ class PluginManagerSettingsWindow(popup.PopupWindow): width = 380 * s height = 150 + 150 * s color = (0.9, 0.9, 0.9) + discord_bg_color = ba.normalized_color((88, 101, 242)) + github_bg_color = (0.2, 0.2, 0.2) text_scale = 0.7 * s self._transition_out = 'out_scale' transition = 'in_scale' - button_size = (60 * s, 32 * s) + button_size = (32 * s, 32 * s) # index = await self._plugin_manager.get_index() self._root_widget = ba.containerwidget(size=(width, height), # parent=_ba.get_special_widget( @@ -1727,23 +1729,40 @@ class PluginManagerSettingsWindow(popup.PopupWindow): maxwidth=width * 0.95) pos -= 75 - ba.buttonwidget(parent=self._root_widget, - position=((width * 0.20) - button_size[0] / 2, pos), - size=button_size, - on_activate_call=lambda: ba.open_url(DISCORD_URL), - textcolor=b_text_color, - button_type='square', - text_scale=1, - label='Discord') + self.discord_button = ba.buttonwidget(parent=self._root_widget, + position=((width * 0.20) - button_size[0] / 2, pos), + size=button_size, + on_activate_call=lambda: ba.open_url(DISCORD_URL), + textcolor=b_text_color, + color=discord_bg_color, + button_type='square', + text_scale=1, + label="") + + ba.imagewidget(parent=self._root_widget, + position=((width * 0.20)+0.5 - button_size[0] / 2, pos), + size=button_size, + texture=ba.gettexture("discordLogo"), + color=(10, 10, 10), + draw_controller=self.discord_button) + + self.github_button = ba.buttonwidget(parent=self._root_widget, + position=((width * 0.49) - button_size[0] / 2, pos), + size=button_size, + on_activate_call=lambda: ba.open_url(REPOSITORY_URL), + textcolor=b_text_color, + color=github_bg_color, + button_type='square', + text_scale=1, + label='') + + ba.imagewidget(parent=self._root_widget, + position=((width * 0.49) + 0.5 - button_size[0] / 2, pos), + size=button_size, + texture=ba.gettexture("githubLogo"), + color=(1, 1, 1), + draw_controller=self.github_button) - ba.buttonwidget(parent=self._root_widget, - position=((width * 0.49) - button_size[0] / 2, pos), - size=button_size, - on_activate_call=lambda: ba.open_url(REPOSITORY_URL), - textcolor=b_text_color, - button_type='square', - text_scale=1, - label='GitHub') ba.containerwidget(edit=self._root_widget, on_cancel_call=self._ok) From 7700ee1a7dde8ad5e92cb341faa3644866daf6f2 Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Mon, 5 Dec 2022 17:34:45 +0530 Subject: [PATCH 2/6] Removed metadata for v0.1.10 --- index.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/index.json b/index.json index 8ebb3fd..5de1fc6 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.1.10": { - "api_version": 7, - "commit_sha": "21e58a1", - "released_on": "05-12-2022", - "md5sum": "d6c963bf62e5bfdcd3d83ff44b58f855" - }, + "0.1.10": null, "0.1.9": { "api_version": 7, "commit_sha": "09b6832", @@ -50,4 +45,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} \ No newline at end of file +} From eb20b171a5554faffd96c9d8fde3f347ddeb44b8 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Mon, 5 Dec 2022 12:05:13 +0000 Subject: [PATCH 3/6] [ci] apply-version-metadata --- index.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.json b/index.json index 5de1fc6..d4118fc 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.1.10": null, + "0.1.10": { + "api_version": 7, + "commit_sha": "7700ee1", + "released_on": "05-12-2022", + "md5sum": "d6c963bf62e5bfdcd3d83ff44b58f855" + }, "0.1.9": { "api_version": 7, "commit_sha": "09b6832", @@ -45,4 +50,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} +} \ No newline at end of file From e122d0f709deb916ce26e83b206b80b3f3a879f0 Mon Sep 17 00:00:00 2001 From: Rikko Date: Mon, 5 Dec 2022 20:55:07 +0530 Subject: [PATCH 4/6] Slight color changes --- index.json | 9 ++------- plugin_manager.py | 10 +++++++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/index.json b/index.json index d4118fc..5de1fc6 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.1.10": { - "api_version": 7, - "commit_sha": "7700ee1", - "released_on": "05-12-2022", - "md5sum": "d6c963bf62e5bfdcd3d83ff44b58f855" - }, + "0.1.10": null, "0.1.9": { "api_version": 7, "commit_sha": "09b6832", @@ -50,4 +45,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} \ No newline at end of file +} diff --git a/plugin_manager.py b/plugin_manager.py index 9e32364..1ee0277 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1665,8 +1665,12 @@ class PluginManagerSettingsWindow(popup.PopupWindow): width = 380 * s height = 150 + 150 * s color = (0.9, 0.9, 0.9) - discord_bg_color = ba.normalized_color((88, 101, 242)) - github_bg_color = (0.2, 0.2, 0.2) + + # Subtracting the default bluish-purple color from the texture, so it's as close + # as to white as possible. + discord_fg_color = (10 - 0.32, 10 - 0.39, 10 - 0.96) + discord_bg_color = (0.525, 0.595, 1.458) + github_bg_color = (0.23, 0.23, 0.23) text_scale = 0.7 * s self._transition_out = 'out_scale' transition = 'in_scale' @@ -1743,7 +1747,7 @@ class PluginManagerSettingsWindow(popup.PopupWindow): position=((width * 0.20)+0.5 - button_size[0] / 2, pos), size=button_size, texture=ba.gettexture("discordLogo"), - color=(10, 10, 10), + color=discord_fg_color, draw_controller=self.discord_button) self.github_button = ba.buttonwidget(parent=self._root_widget, From dca85dc1a2f81c1d2497b82541b0848d99ea1ba1 Mon Sep 17 00:00:00 2001 From: rikkolovescats Date: Mon, 5 Dec 2022 15:25:59 +0000 Subject: [PATCH 5/6] [ci] apply-version-metadata --- index.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.json b/index.json index 5de1fc6..319c43a 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.1.10": null, + "0.1.10": { + "api_version": 7, + "commit_sha": "e122d0f", + "released_on": "05-12-2022", + "md5sum": "6e1ea3e593f1230e527c583e16d96595" + }, "0.1.9": { "api_version": 7, "commit_sha": "09b6832", @@ -45,4 +50,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} +} \ No newline at end of file From 6b7307a8c56417f399a718c92e89cedc379edd1a Mon Sep 17 00:00:00 2001 From: Rikko Date: Mon, 5 Dec 2022 21:09:01 +0530 Subject: [PATCH 6/6] Yay, i taught it to sort! --- test/test_checks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_checks.py b/test/test_checks.py index a862f8f..d338419 100644 --- a/test/test_checks.py +++ b/test/test_checks.py @@ -7,6 +7,8 @@ import io import os import pathlib +from distutils.version import StrictVersion + import unittest @@ -31,7 +33,7 @@ class TestPluginManagerMetadata(unittest.TestCase): versions = list(self.content["versions"].items()) sorted_versions = sorted( versions, - key=lambda version: version[0], + key=lambda version: StrictVersion(version[0]), reverse=True, ) assert sorted_versions == versions @@ -103,7 +105,7 @@ class BaseCategoryMetadataTestCases: versions = list(plugin_metadata["versions"].items()) sorted_versions = sorted( versions, - key=lambda version: version[0], + key=lambda version: StrictVersion(version[0]), reverse=True, ) self.assertEqual(sorted_versions, versions)