From 5a6800d2d3d409bf51c1aa99306431fa0c2d94c8 Mon Sep 17 00:00:00 2001 From: Willem Date: Mon, 21 Feb 2022 01:13:39 +0100 Subject: [PATCH] Added unicode plane viewer --- .../gdxapp/desktop/DeskTopScreenMenu.java | 7 ++- .../apps/SystemBaseUnicodePlaneApp.java | 52 +++++++++++++++++++ .../distributedrebirth/gdxapp/Main.properties | 8 ++- 3 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/apps/SystemBaseUnicodePlaneApp.java diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java index e46c1df5..f9000661 100644 --- a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/DeskTopScreenMenu.java @@ -16,6 +16,7 @@ import love.distributedrebirth.gdxapp.desktop.apps.HebrewWalletApp; import love.distributedrebirth.gdxapp.desktop.apps.MusicPlayerApp; import love.distributedrebirth.gdxapp.desktop.apps.SystemBaseGlyphApp; import love.distributedrebirth.gdxapp.desktop.apps.SystemBasePartApp; +import love.distributedrebirth.gdxapp.desktop.apps.SystemBaseUnicodePlaneApp; import love.distributedrebirth.gdxapp.desktop.apps.Unicode4DApp; import love.distributedrebirth.gdxapp.screen.ScreenCredits; import love.distributedrebirth.gdxapp.screen.ScreenDesktop1; @@ -44,8 +45,10 @@ public class DeskTopScreenMenu { apps = new ArrayList<>(); apps.add(new GDXAppLauncher("Basic Console", () -> new BasicConsoleApp())); - apps.add(new GDXAppLauncher("Base Glyphs", () -> new SystemBaseGlyphApp())); - apps.add(new GDXAppLauncher("Base Parts", () -> new SystemBasePartApp())); + apps.add(new GDXAppLauncher("Sys Glyph Set", () -> new SystemBaseGlyphApp())); + apps.add(new GDXAppLauncher("Sys Number Parts", () -> new SystemBasePartApp())); + apps.add(new GDXAppLauncher("Sys Unicode", () -> new SystemBaseUnicodePlaneApp())); + apps.add(new GDXAppLauncher("Hebrew Wallet", () -> new HebrewWalletApp())); apps.add(new GDXAppLauncher("Unicode4D", () -> new Unicode4DApp())); apps.add(new GDXAppLauncher("Music Player", () -> new MusicPlayerApp())); diff --git a/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/apps/SystemBaseUnicodePlaneApp.java b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/apps/SystemBaseUnicodePlaneApp.java new file mode 100644 index 00000000..12689a56 --- /dev/null +++ b/main-gdxapp/src/main/love/distributedrebirth/gdxapp/desktop/apps/SystemBaseUnicodePlaneApp.java @@ -0,0 +1,52 @@ +package love.distributedrebirth.gdxapp.desktop.apps; + +import java.util.Locale; +import java.util.ResourceBundle; + +import imgui.ImGui; +import imgui.flag.ImGuiTableFlags; +import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.gdxapp.desktop.DefaultDeskApp; +import love.distributedrebirth.gdxapp.desktop.DeskAppContourSection; +import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer; +import love.distributedrebirth.unicode4d.UnicodePlaneᶻᴰ; + +@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") +public class SystemBaseUnicodePlaneApp extends DefaultDeskApp { + + private String getTxt(String key) { + ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp.Main", new Locale("en")); + return bundle.getString("SystemBaseUnicodePlaneApp."+key); + } + + public SystemBaseUnicodePlaneApp() { + setTitle(getTxt("title")); + getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() { + + @Override + public void render() { + int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV | ImGuiTableFlags.Resizable; + ImGui.beginTable("base-part", 2, flags); + ImGui.tableSetupColumn(getTxt("colPlane")); + ImGui.tableSetupColumn(getTxt("colText")); + ImGui.tableHeadersRow(); + for (UnicodePlaneᶻᴰ plane:UnicodePlaneᶻᴰ.values()) { + ImGui.tableNextRow(); + ImGui.tableNextColumn(); + ImGui.text(plane.name()); + ImGui.tableNextColumn(); + StringBuilder buf = new StringBuilder(); + for (int i=plane.getStart();i