diff --git a/.idea/.gitignore b/.idea/.gitignore index 73f69e0..b0811f1 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ /dataSources.local.xml # Editor-based HTTP Client requests /httpRequests/ +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/build.gradle.kts b/build.gradle.kts index 814d2e7..271b26f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -27,7 +27,9 @@ labyMod { "1.19.2", "1.19.3", "1.19.4", - "1.20.1" + "1.20.1", + "1.20.2", + "1.20.4" ) { version, provider -> configureRun(provider, version) } diff --git a/core/src/main/java/de/dojaphd/sendserver/core/gui/activity/ShortcutActivity.java b/core/src/main/java/de/dojaphd/sendserver/core/gui/activity/ShortcutActivity.java index 4a55d57..0b30fbf 100644 --- a/core/src/main/java/de/dojaphd/sendserver/core/gui/activity/ShortcutActivity.java +++ b/core/src/main/java/de/dojaphd/sendserver/core/gui/activity/ShortcutActivity.java @@ -31,15 +31,17 @@ @AutoActivity public class ShortcutActivity extends Activity { - private static final Pattern SHORTCUT_REGEX = Pattern.compile("[\\w.:]{0,32}"); + private static final Pattern SHORTCUT_REGEX = Pattern.compile("[a-zA-Z0-9-.:]{0,32}"); private static final TextColorStripper TEXT_COLOR_STRIPPER = Laby.references() .textColorStripper(); private final SendServerAddon addon; private final VerticalListWidget nameTagList; private final Map nameTagWidgets; private ShortcutWidget selectedNameTag; + private ButtonWidget addButton; private ButtonWidget removeButton; private ButtonWidget editButton; + private FlexibleContentWidget container; private FlexibleContentWidget inputWidget; private String lastUserName; @@ -77,7 +79,7 @@ public ShortcutActivity(boolean background) { public void initialize(Parent parent) { super.initialize(parent); - FlexibleContentWidget container = new FlexibleContentWidget(); + container = new FlexibleContentWidget(); container.addId("name-tag-container"); for (ShortcutWidget shortcutWidget : this.nameTagWidgets.values()) { this.nameTagList.addChild(shortcutWidget); @@ -96,7 +98,8 @@ public void initialize(Parent parent) { HorizontalListWidget menu = new HorizontalListWidget(); menu.addId("overview-button-menu"); - menu.addEntry(ButtonWidget.i18n("labymod.ui.button.add", () -> this.setAction(Action.ADD))); + this.addButton = ButtonWidget.i18n("labymod.ui.button.add", () -> this.setAction(Action.ADD)); + menu.addEntry(this.addButton); this.editButton = ButtonWidget.i18n("labymod.ui.button.edit", () -> this.setAction(Action.EDIT)); @@ -112,6 +115,7 @@ public void initialize(Parent parent) { if (!background) { this.document().addChild(container); } + if (this.action == null) { return; } @@ -139,6 +143,8 @@ public void initialize(Parent parent) { } private FlexibleContentWidget initializeRemoveContainer(ShortcutWidget shortcutWidget) { + container.setVisible(false); + this.inputWidget = new FlexibleContentWidget(); this.inputWidget.addId("remove-container"); @@ -161,6 +167,8 @@ private FlexibleContentWidget initializeRemoveContainer(ShortcutWidget shortcutW this.nameTagList.session().setSelectedEntry(null); this.setAction(null); this.addon.reloadShortcutsList(); + + container.setVisible(true); })); menu.addEntry(ButtonWidget.i18n("labymod.ui.button.cancel", () -> this.setAction(null))); @@ -170,6 +178,8 @@ private FlexibleContentWidget initializeRemoveContainer(ShortcutWidget shortcutW } private DivWidget initializeManageContainer(ShortcutWidget shortcutWidget) { + container.setVisible(false); + TextFieldWidget customTextField = new TextFieldWidget(); ButtonWidget doneButton = ButtonWidget.i18n("labymod.ui.button.done"); @@ -248,9 +258,12 @@ private DivWidget initializeManageContainer(ShortcutWidget shortcutWidget) { shortcutWidget.setShortcut(nameTextField.getText()); shortcutWidget.setCustomTag(customNameTag); + this.setAction(null); this.addon.reloadShortcutsList(); + + container.setVisible(true); }); buttonList.addEntry(doneButton); diff --git a/core/src/main/resources/assets/sendserveraddon/themes/fancy/lss/manage.lss b/core/src/main/resources/assets/sendserveraddon/themes/fancy/lss/manage.lss index a8200ef..48d0942 100644 --- a/core/src/main/resources/assets/sendserveraddon/themes/fancy/lss/manage.lss +++ b/core/src/main/resources/assets/sendserveraddon/themes/fancy/lss/manage.lss @@ -13,7 +13,7 @@ TextField { alignment-x: center; alignment-y: center; - background-color: rgba(20, 20, 20, 1.0); + background-color: rgba(20, 20, 20, 0.8); } .manage-container { @@ -48,7 +48,7 @@ TextField { } Shortcut { - background-color: rgba(17,17,17,0.55); + background-color: rgba(17,17,17,0.7); border-radius: 5; } diff --git a/core/src/main/resources/assets/sendserveraddon/themes/vanilla/lss/manage.lss b/core/src/main/resources/assets/sendserveraddon/themes/vanilla/lss/manage.lss index 3caa5ef..964c9dc 100644 --- a/core/src/main/resources/assets/sendserveraddon/themes/vanilla/lss/manage.lss +++ b/core/src/main/resources/assets/sendserveraddon/themes/vanilla/lss/manage.lss @@ -10,12 +10,11 @@ TextField { width: 100%; height: 100%; - //background-color: #00000; alignment-x: center; alignment-y: center; renderer: "DirtBackground"; - background-dirt-brightness: 64; + background-dirt-brightness: 32; background-always-dirt: true; } @@ -46,9 +45,6 @@ TextField { bottom: -20; } } - renderer: "DirtBackground"; - background-dirt-brightness: 64; - background-always-dirt: true; } Shortcut { @@ -61,7 +57,6 @@ Shortcut:hover { Shortcut:selected { border: 1 #aaaaaa; - } @@ -87,9 +82,6 @@ Shortcut:selected { //background-color: rgba(170, 170, 170, 1.0); padding: 10; - renderer: "DirtBackground"; - background-dirt-brightness: 64; - background-always-dirt: true; } .remove-confirmation { diff --git a/game-runner/src/main/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/main/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_12_2/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_12_2/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_17_1/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_17_1/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_18_2/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_18_2/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_19_2/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_19_2/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_19_3/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_19_3/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_19_4/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_19_4/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_20_1/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_20_1/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_20_2/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_20_2/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_20_4/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_20_4/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/game-runner/src/v1_8_9/resources/assets/sendserveraddon/.assetsroot b/game-runner/src/v1_8_9/resources/assets/sendserveraddon/.assetsroot new file mode 100644 index 0000000..e69de29 diff --git a/settings.gradle.kts b/settings.gradle.kts index fc6527e..71b4e5f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,7 @@ rootProject.name = "sendserveraddon" pluginManagement { - val labyGradlePluginVersion = "0.3.28" + val labyGradlePluginVersion = "0.3.44" plugins { id("net.labymod.gradle") version (labyGradlePluginVersion) }