From 4723d822f2d144353244927f77c5eae5e3812a42 Mon Sep 17 00:00:00 2001 From: "jiroshimonis@gmail.com" Date: Thu, 19 May 2022 08:00:00 +0800 Subject: [PATCH 1/4] ready --- mod.hjson | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod.hjson b/mod.hjson index a09e727..eb33618 100644 --- a/mod.hjson +++ b/mod.hjson @@ -1,4 +1,4 @@ -#!VERSION 1.41 +#!VERSION 1.5 #!REPO "Mnemotechnician/New-console" #!BRANCH "master" @@ -8,8 +8,8 @@ displayName: "New Console" name: "newconsole" author: "Мнемотехник" description: "Adds a much better console ui.\n\nAlso includes a file browser, a scripts menu, an events menu and much much more!\n\nSee README.md for more info." -version: 1.41 -subtitle: "amk" +version: 1.5 +subtitle: "Adds a much better console UI." minGameVersion: 136 hidden: true From b4c476cac1a822c614c9766dcc8aa7e34f0814a0 Mon Sep 17 00:00:00 2001 From: "jiroshimonis@gmail.com" Date: Thu, 19 May 2022 13:09:08 +0800 Subject: [PATCH 2/4] bal --- src/newconsole/ui/dialogs/AutorunDialog.java | 8 ++++---- src/newconsole/ui/dialogs/Console.java | 18 +++++++++--------- src/newconsole/ui/dialogs/CopypasteDialog.java | 6 +++--- src/newconsole/ui/dialogs/FileBrowser.java | 8 ++++---- src/newconsole/ui/dialogs/InputPrompt.java | 4 ++-- src/newconsole/ui/dialogs/SavesDialog.java | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/newconsole/ui/dialogs/AutorunDialog.java b/src/newconsole/ui/dialogs/AutorunDialog.java index c293011..8a48382 100644 --- a/src/newconsole/ui/dialogs/AutorunDialog.java +++ b/src/newconsole/ui/dialogs/AutorunDialog.java @@ -58,7 +58,7 @@ public AutorunDialog() { eventsSpinner = new Spinner("@newconsole.select-event", false, events -> { for (final var event : AutorunManager.allEvents) { - var button = events.button(event.getSimpleName(), Styles.togglet, () -> { + var button = events.button(event.getSimpleName(), Styles.logict, () -> { lastEvent = event; eventsSpinner.hide(false); @@ -69,7 +69,7 @@ public AutorunDialog() { }); panel.add(eventsSpinner).growX().marginBottom(10f).row(); - panel.button("@newconsole.save", Styles.togglet, () -> { + panel.button("@newconsole.save", Styles.logict, () -> { String code = ConsoleVars.console.area.getText(); if (!code.isEmpty()) { @@ -80,7 +80,7 @@ public AutorunDialog() { Vars.ui.showInfo("@newconsole.empty-script"); } }).growX(); - })).margin(4f).width(350f).with(it -> ((Spinner) it).setStyle(Styles.togglet)).row(); + })).margin(4f).width(350f).with(it -> ((Spinner) it).setStyle(Styles.logict)).row(); }) ).grow(); } @@ -109,7 +109,7 @@ public void addEntry(AutorunManager.AutorunEntry entry) { table.table(actions -> { actions.defaults().size(50f); - TextButton toggle = new TextButton(entry.enabled ? "@newconsole.enabled" : "@newconsole.disabled", Styles.togglet); + TextButton toggle = new TextButton(entry.enabled ? "@newconsole.enabled" : "@newconsole.disabled", Styles.logict); actions.add(toggle).width(80f); //fuck java lambdas toggle.clicked(() -> { diff --git a/src/newconsole/ui/dialogs/Console.java b/src/newconsole/ui/dialogs/Console.java index 79160fc..662655d 100644 --- a/src/newconsole/ui/dialogs/Console.java +++ b/src/newconsole/ui/dialogs/Console.java @@ -61,24 +61,24 @@ public Console() { twoRows.table(history -> { history.defaults().height(40).width(100); - history.button("@newconsole.prev", Styles.togglet, () -> { + history.button("@newconsole.prev", Styles.logict, () -> { historyShift(1); }); - history.button("@newconsole.next", Styles.togglet, () -> { + history.button("@newconsole.next", Styles.logict, () -> { historyShift(-1); }).row(); - history.button("@newconsole.clear", Styles.togglet, () -> { + history.button("@newconsole.clear", Styles.logict, () -> { logBuffer.setLength(0); }); - history.button("@newconsole.clipboard", Styles.togglet, () -> { + history.button("@newconsole.clipboard", Styles.logict, () -> { ConsoleVars.copypaste.setTarget(area).show(); }); }); - twoRows.button("@newconsole.run", Styles.togglet, () -> { + twoRows.button("@newconsole.run", Styles.logict, () -> { String code = area.getText(); historyIndex = 0; @@ -91,15 +91,15 @@ public Console() { lower.defaults().width(100).height(40); lower.left(); - lower.button("@newconsole.scripts", Styles.togglet, () -> { + lower.button("@newconsole.scripts", Styles.logict, () -> { ConsoleVars.saves.show(); }); - lower.button("@newconsole.files", Styles.togglet, () -> { + lower.button("@newconsole.files", Styles.logict, () -> { ConsoleVars.fileBrowser.show(); }); - lower.button("@newconsole.autorun", Styles.togglet, () -> { + lower.button("@newconsole.autorun", Styles.logict, () -> { ConsoleVars.autorun.show(); }); }).growX(); @@ -137,7 +137,7 @@ public Console() { }); }).grow().row(); - main.button("@newconsole.close", Styles.togglet, () -> { + main.button("@newconsole.close", Styles.logict, () -> { hide(); }).fillX(); }).grow().row(); diff --git a/src/newconsole/ui/dialogs/CopypasteDialog.java b/src/newconsole/ui/dialogs/CopypasteDialog.java index dcfa548..ebeb8d2 100644 --- a/src/newconsole/ui/dialogs/CopypasteDialog.java +++ b/src/newconsole/ui/dialogs/CopypasteDialog.java @@ -21,7 +21,7 @@ public CopypasteDialog() { cont.center(); cont.table(main -> { main.defaults().height(50f); - main.button("@newconsole.copy", Styles.togglet, () -> { + main.button("@newconsole.copy", Styles.logict, () -> { if (target == null) { Log.warn("No target text area specified for CopypasteDialog"); return; @@ -32,7 +32,7 @@ public CopypasteDialog() { hide(); }).width(150); - main.button("@newconsole.paste", Styles.togglet, () -> { + main.button("@newconsole.paste", Styles.logict, () -> { if (target == null) { Log.warn("No target text area specified for CopypasteDialog"); return; @@ -47,7 +47,7 @@ public CopypasteDialog() { hide(); }).width(150).row(); - main.button("@newconsole.close", Styles.togglet, this::hide).colspan(2).growX(); + main.button("@newconsole.close", Styles.logict, this::hide).colspan(2).growX(); }); } diff --git a/src/newconsole/ui/dialogs/FileBrowser.java b/src/newconsole/ui/dialogs/FileBrowser.java index 88b8b90..77e955c 100644 --- a/src/newconsole/ui/dialogs/FileBrowser.java +++ b/src/newconsole/ui/dialogs/FileBrowser.java @@ -69,7 +69,7 @@ public FileBrowser() { bar.button(Icon.exit, Styles.nodei, this::hide).size(50f); - bar.button("@newconsole.files.save-script", Styles.togglet, () -> { + bar.button("@newconsole.files.save-script", Styles.logict, () -> { ifNotZip(() -> { inputPrompt.prompt("@newconsole.file-name", name -> { if (name.indexOf(".") == -1) { @@ -91,7 +91,7 @@ public FileBrowser() { }); }).width(250); - bar.button("@newconsole.files.new-folder", Styles.togglet, () -> { + bar.button("@newconsole.files.new-folder", Styles.logict, () -> { ifNotZip(() -> { inputPrompt.prompt("@newconsole.folder-name", name -> { var dir = currentDirectory.child(name); @@ -108,7 +108,7 @@ public FileBrowser() { bar.table(right -> { right.right(); - right.button("@newconsole.files-paste", Styles.togglet, () -> { + right.button("@newconsole.files-paste", Styles.logict, () -> { if (movedFile != null) { var target = currentDirectory.child(movedFile.name()); if (target.equals(movedFile)) { @@ -400,7 +400,7 @@ public ImageDialog() { cont.center(); cont.add(label).row(); cont.add(image).row(); - cont.button("@newconsole.close", Styles.togglet, this::hide).fillX(); + cont.button("@newconsole.close", Styles.logict, this::hide).fillX(); } /** Loads the providen image and shows it. Shows an error if the file isn't an image */ diff --git a/src/newconsole/ui/dialogs/InputPrompt.java b/src/newconsole/ui/dialogs/InputPrompt.java index 8d94bc3..d6255a4 100644 --- a/src/newconsole/ui/dialogs/InputPrompt.java +++ b/src/newconsole/ui/dialogs/InputPrompt.java @@ -31,9 +31,9 @@ public InputPrompt() { }, text -> {}).width(200f).get(); field.removeInputDialog(); - cont.button("@newconsole.done", Styles.togglet, this::done).width(80f).row(); + cont.button("@newconsole.done", Styles.logict, this::done).width(80f).row(); - cont.button("@newconsole.close", Styles.togglet, this::hide).colspan(2).growX(); + cont.button("@newconsole.close", Styles.logict, this::hide).colspan(2).growX(); } /** Shows the dialog, runs the consumer when the done button is pressed */ diff --git a/src/newconsole/ui/dialogs/SavesDialog.java b/src/newconsole/ui/dialogs/SavesDialog.java index b6d5ff6..d3e6d6e 100644 --- a/src/newconsole/ui/dialogs/SavesDialog.java +++ b/src/newconsole/ui/dialogs/SavesDialog.java @@ -23,7 +23,7 @@ public SavesDialog() { closeOnBack(); cont.table(save -> { - save.button("@newconsole.save", Styles.togglet, () -> { + save.button("@newconsole.save", Styles.logict, () -> { String name = saveName.getText(); if (name.replaceAll("\\s", "").equals("")) { Vars.ui.showInfo("@newconsole.empty-name"); @@ -56,7 +56,7 @@ public SavesDialog() { scriptsTable = table; })).grow().row(); - cont.button("@newconsole.close", Styles.togglet, () -> hide()).growX(); + cont.button("@newconsole.close", Styles.logict, () -> hide()).growX(); } public void rebuild() { From 09cb825175d95d80a5332885b4bffa15b10ae43a Mon Sep 17 00:00:00 2001 From: "jiroshimonis@gmail.com" Date: Thu, 19 May 2022 13:09:54 +0800 Subject: [PATCH 3/4] contradict --- mod.hjson | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod.hjson b/mod.hjson index eb33618..ef7cdf5 100644 --- a/mod.hjson +++ b/mod.hjson @@ -1,4 +1,4 @@ -#!VERSION 1.5 +#!VERSION 1.41 #!REPO "Mnemotechnician/New-console" #!BRANCH "master" @@ -8,7 +8,7 @@ displayName: "New Console" name: "newconsole" author: "Мнемотехник" description: "Adds a much better console ui.\n\nAlso includes a file browser, a scripts menu, an events menu and much much more!\n\nSee README.md for more info." -version: 1.5 +version: 1.41 subtitle: "Adds a much better console UI." minGameVersion: 136 hidden: true From 67c7ba2bb7e64b67497cc0c4a8880cb38d6b52c3 Mon Sep 17 00:00:00 2001 From: "jiroshimonis@gmail.com" Date: Thu, 19 May 2022 13:22:17 +0800 Subject: [PATCH 4/4] BLEND --- src/newconsole/ConsoleVars.java | 4 ++-- src/newconsole/ui/FloatingWidget.java | 4 ++-- src/newconsole/ui/dialogs/AutorunDialog.java | 14 +++++++------- src/newconsole/ui/dialogs/Console.java | 18 +++++++++--------- src/newconsole/ui/dialogs/CopypasteDialog.java | 6 +++--- src/newconsole/ui/dialogs/FileBrowser.java | 10 +++++----- src/newconsole/ui/dialogs/InputPrompt.java | 4 ++-- src/newconsole/ui/dialogs/SavesDialog.java | 10 +++++----- 8 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/newconsole/ConsoleVars.java b/src/newconsole/ConsoleVars.java index 5e8c54e..f00be87 100644 --- a/src/newconsole/ConsoleVars.java +++ b/src/newconsole/ConsoleVars.java @@ -57,7 +57,7 @@ public static void init() { floatingWidget = new FloatingWidget(); - floatingWidget.button(Icon.terminal, Styles.nodei, console::show).get() + floatingWidget.button(Icon.terminal, Styles.defaulti, console::show).get() .setSize(floatingWidget.dragger.getWidth(), floatingWidget.dragger.getHeight()); group.addChild(floatingWidget); @@ -86,4 +86,4 @@ public static void executeStartup() { } } -} \ No newline at end of file +} diff --git a/src/newconsole/ui/FloatingWidget.java b/src/newconsole/ui/FloatingWidget.java index 3ee2b8c..8ba7d4e 100644 --- a/src/newconsole/ui/FloatingWidget.java +++ b/src/newconsole/ui/FloatingWidget.java @@ -25,7 +25,7 @@ public class FloatingWidget extends Table { public boolean isDragging = false; public FloatingWidget() { - dragger = new ImageButton(Icon.move, Styles.nodei); + dragger = new ImageButton(Icon.move, Styles.defaulti); add(dragger); dragger.addListener(new InputListener() { @@ -72,4 +72,4 @@ public void positionParent(float x, float y) { ); } -} \ No newline at end of file +} diff --git a/src/newconsole/ui/dialogs/AutorunDialog.java b/src/newconsole/ui/dialogs/AutorunDialog.java index 8a48382..4dcf370 100644 --- a/src/newconsole/ui/dialogs/AutorunDialog.java +++ b/src/newconsole/ui/dialogs/AutorunDialog.java @@ -33,7 +33,7 @@ public AutorunDialog() { cont.table(bar -> { bar.left(); - bar.button(Icon.exit, Styles.nodei, this::hide).size(50f); + bar.button(Icon.exit, Styles.defaulti, this::hide).size(50f); }).growX().row(); cont.stack( @@ -58,7 +58,7 @@ public AutorunDialog() { eventsSpinner = new Spinner("@newconsole.select-event", false, events -> { for (final var event : AutorunManager.allEvents) { - var button = events.button(event.getSimpleName(), Styles.logict, () -> { + var button = events.button(event.getSimpleName(), Styles.defaultt, () -> { lastEvent = event; eventsSpinner.hide(false); @@ -69,7 +69,7 @@ public AutorunDialog() { }); panel.add(eventsSpinner).growX().marginBottom(10f).row(); - panel.button("@newconsole.save", Styles.logict, () -> { + panel.button("@newconsole.save", Styles.defaultt, () -> { String code = ConsoleVars.console.area.getText(); if (!code.isEmpty()) { @@ -80,7 +80,7 @@ public AutorunDialog() { Vars.ui.showInfo("@newconsole.empty-script"); } }).growX(); - })).margin(4f).width(350f).with(it -> ((Spinner) it).setStyle(Styles.logict)).row(); + })).margin(4f).width(350f).with(it -> ((Spinner) it).setStyle(Styles.defaultt)).row(); }) ).grow(); } @@ -109,7 +109,7 @@ public void addEntry(AutorunManager.AutorunEntry entry) { table.table(actions -> { actions.defaults().size(50f); - TextButton toggle = new TextButton(entry.enabled ? "@newconsole.enabled" : "@newconsole.disabled", Styles.logict); + TextButton toggle = new TextButton(entry.enabled ? "@newconsole.enabled" : "@newconsole.disabled", Styles.defaultt); actions.add(toggle).width(80f); //fuck java lambdas toggle.clicked(() -> { @@ -118,12 +118,12 @@ public void addEntry(AutorunManager.AutorunEntry entry) { toggle.setText(entry.enabled ? "@newconsole.enabled" : "@newconsole.disabled"); }); - actions.button(CStyles.editIcon, Styles.nodei, () -> { + actions.button(CStyles.editIcon, Styles.defaulti, () -> { ConsoleVars.console.setCode(entry.script); hide(); }); - actions.button(CStyles.deleteIcon, Styles.nodei, () -> { + actions.button(CStyles.deleteIcon, Styles.defaulti, () -> { Vars.ui.showConfirm("@newconsole.delete-confirm", () -> { AutorunManager.remove(entry); AutorunManager.save(); diff --git a/src/newconsole/ui/dialogs/Console.java b/src/newconsole/ui/dialogs/Console.java index 662655d..acc07c0 100644 --- a/src/newconsole/ui/dialogs/Console.java +++ b/src/newconsole/ui/dialogs/Console.java @@ -61,24 +61,24 @@ public Console() { twoRows.table(history -> { history.defaults().height(40).width(100); - history.button("@newconsole.prev", Styles.logict, () -> { + history.button("@newconsole.prev", Styles.defaultt, () -> { historyShift(1); }); - history.button("@newconsole.next", Styles.logict, () -> { + history.button("@newconsole.next", Styles.defaultt, () -> { historyShift(-1); }).row(); - history.button("@newconsole.clear", Styles.logict, () -> { + history.button("@newconsole.clear", Styles.defaultt, () -> { logBuffer.setLength(0); }); - history.button("@newconsole.clipboard", Styles.logict, () -> { + history.button("@newconsole.clipboard", Styles.defaultt, () -> { ConsoleVars.copypaste.setTarget(area).show(); }); }); - twoRows.button("@newconsole.run", Styles.logict, () -> { + twoRows.button("@newconsole.run", Styles.defaultt, () -> { String code = area.getText(); historyIndex = 0; @@ -91,15 +91,15 @@ public Console() { lower.defaults().width(100).height(40); lower.left(); - lower.button("@newconsole.scripts", Styles.logict, () -> { + lower.button("@newconsole.scripts", Styles.defaultt, () -> { ConsoleVars.saves.show(); }); - lower.button("@newconsole.files", Styles.logict, () -> { + lower.button("@newconsole.files", Styles.defaultt, () -> { ConsoleVars.fileBrowser.show(); }); - lower.button("@newconsole.autorun", Styles.logict, () -> { + lower.button("@newconsole.autorun", Styles.defaultt, () -> { ConsoleVars.autorun.show(); }); }).growX(); @@ -137,7 +137,7 @@ public Console() { }); }).grow().row(); - main.button("@newconsole.close", Styles.logict, () -> { + main.button("@newconsole.close", Styles.defaultt, () -> { hide(); }).fillX(); }).grow().row(); diff --git a/src/newconsole/ui/dialogs/CopypasteDialog.java b/src/newconsole/ui/dialogs/CopypasteDialog.java index ebeb8d2..19fcff0 100644 --- a/src/newconsole/ui/dialogs/CopypasteDialog.java +++ b/src/newconsole/ui/dialogs/CopypasteDialog.java @@ -21,7 +21,7 @@ public CopypasteDialog() { cont.center(); cont.table(main -> { main.defaults().height(50f); - main.button("@newconsole.copy", Styles.logict, () -> { + main.button("@newconsole.copy", Styles.defaultt, () -> { if (target == null) { Log.warn("No target text area specified for CopypasteDialog"); return; @@ -32,7 +32,7 @@ public CopypasteDialog() { hide(); }).width(150); - main.button("@newconsole.paste", Styles.logict, () -> { + main.button("@newconsole.paste", Styles.defaultt, () -> { if (target == null) { Log.warn("No target text area specified for CopypasteDialog"); return; @@ -47,7 +47,7 @@ public CopypasteDialog() { hide(); }).width(150).row(); - main.button("@newconsole.close", Styles.logict, this::hide).colspan(2).growX(); + main.button("@newconsole.close", Styles.defaultt, this::hide).colspan(2).growX(); }); } diff --git a/src/newconsole/ui/dialogs/FileBrowser.java b/src/newconsole/ui/dialogs/FileBrowser.java index 77e955c..be1c629 100644 --- a/src/newconsole/ui/dialogs/FileBrowser.java +++ b/src/newconsole/ui/dialogs/FileBrowser.java @@ -67,9 +67,9 @@ public FileBrowser() { cont.table(bar -> { bar.left().defaults().height(50f); - bar.button(Icon.exit, Styles.nodei, this::hide).size(50f); + bar.button(Icon.exit, Styles.defaulti, this::hide).size(50f); - bar.button("@newconsole.files.save-script", Styles.logict, () -> { + bar.button("@newconsole.files.save-script", Styles.defaultt, () -> { ifNotZip(() -> { inputPrompt.prompt("@newconsole.file-name", name -> { if (name.indexOf(".") == -1) { @@ -91,7 +91,7 @@ public FileBrowser() { }); }).width(250); - bar.button("@newconsole.files.new-folder", Styles.logict, () -> { + bar.button("@newconsole.files.new-folder", Styles.defaultt, () -> { ifNotZip(() -> { inputPrompt.prompt("@newconsole.folder-name", name -> { var dir = currentDirectory.child(name); @@ -108,7 +108,7 @@ public FileBrowser() { bar.table(right -> { right.right(); - right.button("@newconsole.files-paste", Styles.logict, () -> { + right.button("@newconsole.files-paste", Styles.defaultt, () -> { if (movedFile != null) { var target = currentDirectory.child(movedFile.name()); if (target.equals(movedFile)) { @@ -400,7 +400,7 @@ public ImageDialog() { cont.center(); cont.add(label).row(); cont.add(image).row(); - cont.button("@newconsole.close", Styles.logict, this::hide).fillX(); + cont.button("@newconsole.close", Styles.defaultt, this::hide).fillX(); } /** Loads the providen image and shows it. Shows an error if the file isn't an image */ diff --git a/src/newconsole/ui/dialogs/InputPrompt.java b/src/newconsole/ui/dialogs/InputPrompt.java index d6255a4..0e86174 100644 --- a/src/newconsole/ui/dialogs/InputPrompt.java +++ b/src/newconsole/ui/dialogs/InputPrompt.java @@ -31,9 +31,9 @@ public InputPrompt() { }, text -> {}).width(200f).get(); field.removeInputDialog(); - cont.button("@newconsole.done", Styles.logict, this::done).width(80f).row(); + cont.button("@newconsole.done", Styles.defaultt, this::done).width(80f).row(); - cont.button("@newconsole.close", Styles.logict, this::hide).colspan(2).growX(); + cont.button("@newconsole.close", Styles.defaultt, this::hide).colspan(2).growX(); } /** Shows the dialog, runs the consumer when the done button is pressed */ diff --git a/src/newconsole/ui/dialogs/SavesDialog.java b/src/newconsole/ui/dialogs/SavesDialog.java index d3e6d6e..c818fc3 100644 --- a/src/newconsole/ui/dialogs/SavesDialog.java +++ b/src/newconsole/ui/dialogs/SavesDialog.java @@ -23,7 +23,7 @@ public SavesDialog() { closeOnBack(); cont.table(save -> { - save.button("@newconsole.save", Styles.logict, () -> { + save.button("@newconsole.save", Styles.defaultt, () -> { String name = saveName.getText(); if (name.replaceAll("\\s", "").equals("")) { Vars.ui.showInfo("@newconsole.empty-name"); @@ -56,7 +56,7 @@ public SavesDialog() { scriptsTable = table; })).grow().row(); - cont.button("@newconsole.close", Styles.logict, () -> hide()).growX(); + cont.button("@newconsole.close", Styles.defaultt, () -> hide()).growX(); } public void rebuild() { @@ -80,16 +80,16 @@ public void add(String name, String script) { entry.table(actions -> { actions.center().right().defaults().center().size(50); - actions.button(CStyles.playIcon, Styles.nodei, () -> { + actions.button(CStyles.playIcon, Styles.defaulti, () -> { ConsoleVars.console.runConsole(script); }); - actions.button(CStyles.editIcon, Styles.nodei, () -> { + actions.button(CStyles.editIcon, Styles.defaulti, () -> { ConsoleVars.console.setCode(script); hide(); }); - actions.button(CStyles.deleteIcon, Styles.nodei, () -> { + actions.button(CStyles.deleteIcon, Styles.defaulti, () -> { Vars.ui.showConfirm("@newconsole.delete-confirm", () -> { ScriptsManager.deleteScript(name); scriptsTable.removeChild(entry);