Skip to content

Commit

Permalink
Merge pull request #3 from SMOLKEYS/patch-1
Browse files Browse the repository at this point in the history
the coloures
  • Loading branch information
Mnemotechnician authored May 19, 2022
2 parents a26a387 + 0a5fcd8 commit a544fbe
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ 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"
subtitle: "Adds a much better console UI."
minGameVersion: 136
hidden: true

Expand Down
4 changes: 2 additions & 2 deletions src/newconsole/ConsoleVars.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -86,4 +86,4 @@ public static void executeStartup() {
}
}

}
}
4 changes: 2 additions & 2 deletions src/newconsole/ui/FloatingWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -72,4 +72,4 @@ public void positionParent(float x, float y) {
);
}

}
}
14 changes: 7 additions & 7 deletions src/newconsole/ui/dialogs/AutorunDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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.defaultt, () -> {
lastEvent = event;

eventsSpinner.hide(false);
Expand All @@ -69,7 +69,7 @@ public AutorunDialog() {
});
panel.add(eventsSpinner).growX().marginBottom(10f).row();

panel.button("@newconsole.save", Styles.togglet, () -> {
panel.button("@newconsole.save", Styles.defaultt, () -> {
String code = ConsoleVars.console.area.getText();

if (!code.isEmpty()) {
Expand All @@ -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.defaultt)).row();
})
).grow();
}
Expand Down Expand Up @@ -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.defaultt);
actions.add(toggle).width(80f);
//fuck java lambdas
toggle.clicked(() -> {
Expand All @@ -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();
Expand Down
18 changes: 9 additions & 9 deletions src/newconsole/ui/dialogs/Console.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.defaultt, () -> {
historyShift(1);
});

history.button("@newconsole.next", Styles.togglet, () -> {
history.button("@newconsole.next", Styles.defaultt, () -> {
historyShift(-1);
}).row();

history.button("@newconsole.clear", Styles.togglet, () -> {
history.button("@newconsole.clear", Styles.defaultt, () -> {
logBuffer.setLength(0);
});

history.button("@newconsole.clipboard", Styles.togglet, () -> {
history.button("@newconsole.clipboard", Styles.defaultt, () -> {
ConsoleVars.copypaste.setTarget(area).show();
});
});

twoRows.button("@newconsole.run", Styles.togglet, () -> {
twoRows.button("@newconsole.run", Styles.defaultt, () -> {
String code = area.getText();

historyIndex = 0;
Expand All @@ -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.defaultt, () -> {
ConsoleVars.saves.show();
});

lower.button("@newconsole.files", Styles.togglet, () -> {
lower.button("@newconsole.files", Styles.defaultt, () -> {
ConsoleVars.fileBrowser.show();
});

lower.button("@newconsole.autorun", Styles.togglet, () -> {
lower.button("@newconsole.autorun", Styles.defaultt, () -> {
ConsoleVars.autorun.show();
});
}).growX();
Expand Down Expand Up @@ -137,7 +137,7 @@ public Console() {
});
}).grow().row();

main.button("@newconsole.close", Styles.togglet, () -> {
main.button("@newconsole.close", Styles.defaultt, () -> {
hide();
}).fillX();
}).grow().row();
Expand Down
6 changes: 3 additions & 3 deletions src/newconsole/ui/dialogs/CopypasteDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.defaultt, () -> {
if (target == null) {
Log.warn("No target text area specified for CopypasteDialog");
return;
Expand All @@ -32,7 +32,7 @@ public CopypasteDialog() {
hide();
}).width(150);

main.button("@newconsole.paste", Styles.togglet, () -> {
main.button("@newconsole.paste", Styles.defaultt, () -> {
if (target == null) {
Log.warn("No target text area specified for CopypasteDialog");
return;
Expand All @@ -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.defaultt, this::hide).colspan(2).growX();
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/newconsole/ui/dialogs/FileBrowser.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.togglet, () -> {
bar.button("@newconsole.files.save-script", Styles.defaultt, () -> {
ifNotZip(() -> {
inputPrompt.prompt("@newconsole.file-name", name -> {
if (name.indexOf(".") == -1) {
Expand All @@ -91,7 +91,7 @@ public FileBrowser() {
});
}).width(250);

bar.button("@newconsole.files.new-folder", Styles.togglet, () -> {
bar.button("@newconsole.files.new-folder", Styles.defaultt, () -> {
ifNotZip(() -> {
inputPrompt.prompt("@newconsole.folder-name", name -> {
var dir = currentDirectory.child(name);
Expand All @@ -108,7 +108,7 @@ public FileBrowser() {
bar.table(right -> {
right.right();

right.button("@newconsole.files-paste", Styles.togglet, () -> {
right.button("@newconsole.files-paste", Styles.defaultt, () -> {
if (movedFile != null) {
var target = currentDirectory.child(movedFile.name());
if (target.equals(movedFile)) {
Expand Down Expand Up @@ -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.defaultt, this::hide).fillX();
}

/** Loads the providen image and shows it. Shows an error if the file isn't an image */
Expand Down
4 changes: 2 additions & 2 deletions src/newconsole/ui/dialogs/InputPrompt.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.defaultt, this::done).width(80f).row();

cont.button("@newconsole.close", Styles.togglet, 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 */
Expand Down
10 changes: 5 additions & 5 deletions src/newconsole/ui/dialogs/SavesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public SavesDialog() {
closeOnBack();

cont.table(save -> {
save.button("@newconsole.save", Styles.togglet, () -> {
save.button("@newconsole.save", Styles.defaultt, () -> {
String name = saveName.getText();
if (name.replaceAll("\\s", "").equals("")) {
Vars.ui.showInfo("@newconsole.empty-name");
Expand Down Expand Up @@ -56,7 +56,7 @@ public SavesDialog() {
scriptsTable = table;
})).grow().row();

cont.button("@newconsole.close", Styles.togglet, () -> hide()).growX();
cont.button("@newconsole.close", Styles.defaultt, () -> hide()).growX();
}

public void rebuild() {
Expand All @@ -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);
Expand Down

0 comments on commit a544fbe

Please sign in to comment.