diff --git a/Data/NotoSansCJKjp-Medium.otf b/Data/NotoSansCJKjp-Medium.otf deleted file mode 100644 index ba41937..0000000 Binary files a/Data/NotoSansCJKjp-Medium.otf and /dev/null differ diff --git a/Data/currencyAlert.json b/Data/currencyAlert.json deleted file mode 100644 index b2b99e5..0000000 --- a/Data/currencyAlert.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "Author": "your name here", - "Name": "Sample Plugin", - "Punchline": "A short one-liner that shows up in /xlplugins.", - "Description": "A description that shows up in /xlplugins. List any major slash-command(s).", - "InternalName": "samplePlugin", - "ApplicableVersion": "any", - "Tags": [ - "sample", - "plugin", - "goats" - ] -} diff --git a/Data/gamesym.ttf b/Data/gamesym.ttf deleted file mode 100644 index 8bfc546..0000000 Binary files a/Data/gamesym.ttf and /dev/null differ diff --git a/Data/goat.png b/Data/goat.png deleted file mode 100644 index 4ca06ac..0000000 Binary files a/Data/goat.png and /dev/null differ diff --git a/SamplePlugin/CurrencyAlert.csproj b/SamplePlugin/CurrencyAlert.csproj index a9eeb5e..e269565 100644 --- a/SamplePlugin/CurrencyAlert.csproj +++ b/SamplePlugin/CurrencyAlert.csproj @@ -3,7 +3,7 @@ - 0.2.0.0 + 0.2.2.0 Currency Alert https://github.com/Lharz/xiv-currency-alert diff --git a/SamplePlugin/currencyAlert.json b/SamplePlugin/currencyAlert.json index 0162245..b5f052f 100644 --- a/SamplePlugin/currencyAlert.json +++ b/SamplePlugin/currencyAlert.json @@ -1,5 +1,5 @@ { - "Author": "Lharz Zobby@Ragnarok", + "Author": "Lharz", "Name": "Currency Alert", "Punchline": "Configure alerts thresholds for various currencies.", "Description": "/currencyalert: show the configuration panel.", diff --git a/UIDev/Framework/IPluginUIMock.cs b/UIDev/Framework/IPluginUIMock.cs deleted file mode 100644 index 6f356cd..0000000 --- a/UIDev/Framework/IPluginUIMock.cs +++ /dev/null @@ -1,10 +0,0 @@ -using ImGuiScene; -using System; - -namespace UIDev -{ - interface IPluginUIMock : IDisposable - { - void Initialize(SimpleImGuiScene scene); - } -} diff --git a/UIDev/Framework/UIBootstrap.cs b/UIDev/Framework/UIBootstrap.cs deleted file mode 100644 index afa8144..0000000 --- a/UIDev/Framework/UIBootstrap.cs +++ /dev/null @@ -1,90 +0,0 @@ -using ImGuiNET; -using ImGuiScene; -using System.Numerics; -using System.Runtime.InteropServices; -using static SDL2.SDL; - -namespace UIDev -{ - class UIBootstrap - { - public static unsafe void Inititalize(IPluginUIMock pluginUI) - { - // you can edit this if you want more control over things - // mainly if you want a regular window instead of transparent overlay - // Typically you don't want to change any colors here if you keep the fullscreen overlay - using var scene = new SimpleImGuiScene(RendererFactory.RendererBackend.DirectX11, new WindowCreateInfo - { - Title = "UI Test", - Fullscreen = true, - TransparentColor = new float[] { 0, 0, 0 }, - }); - - // the background color of your window - typically don't change this for fullscreen overlays - scene.Renderer.ClearColor = new Vector4(0, 0, 0, 0); - - // this just makes the application quit if you hit escape - scene.Window.OnSDLEvent += (ref SDL_Event sdlEvent) => - { - if (sdlEvent.type == SDL_EventType.SDL_KEYDOWN && sdlEvent.key.keysym.scancode == SDL_Scancode.SDL_SCANCODE_ESCAPE) - { - scene.ShouldQuit = true; - } - }; - - // all of this is taken straight from dalamud - - ImFontConfigPtr fontConfig = ImGuiNative.ImFontConfig_ImFontConfig(); - fontConfig.MergeMode = true; - fontConfig.PixelSnapH = true; - - var fontPathJp = "NotoSansCJKjp-Medium.otf"; - ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathJp, 17.0f, null, ImGui.GetIO().Fonts.GetGlyphRangesJapanese()); - - var fontPathGame = "gamesym.ttf"; - var rangeHandle = GCHandle.Alloc(new ushort[] { 0xE020, 0xE0DB, 0 }, GCHandleType.Pinned); - ImGui.GetIO().Fonts.AddFontFromFileTTF(fontPathGame, 17.0f, fontConfig, rangeHandle.AddrOfPinnedObject()); - - ImGui.GetIO().Fonts.Build(); - - fontConfig.Destroy(); - rangeHandle.Free(); - - - ImGui.GetStyle().GrabRounding = 3f; - ImGui.GetStyle().FrameRounding = 4f; - ImGui.GetStyle().WindowRounding = 4f; - ImGui.GetStyle().WindowBorderSize = 0f; - ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Right; - ImGui.GetStyle().ScrollbarSize = 16f; - - ImGui.GetStyle().Colors[(int)ImGuiCol.WindowBg] = new Vector4(0.06f, 0.06f, 0.06f, 0.87f); - ImGui.GetStyle().Colors[(int)ImGuiCol.FrameBg] = new Vector4(0.29f, 0.29f, 0.29f, 0.54f); - ImGui.GetStyle().Colors[(int)ImGuiCol.FrameBgHovered] = new Vector4(0.54f, 0.54f, 0.54f, 0.40f); - ImGui.GetStyle().Colors[(int)ImGuiCol.FrameBgActive] = new Vector4(0.64f, 0.64f, 0.64f, 0.67f); - ImGui.GetStyle().Colors[(int)ImGuiCol.TitleBgActive] = new Vector4(0.29f, 0.29f, 0.29f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.CheckMark] = new Vector4(0.86f, 0.86f, 0.86f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.SliderGrab] = new Vector4(0.54f, 0.54f, 0.54f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.SliderGrabActive] = new Vector4(0.67f, 0.67f, 0.67f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.Button] = new Vector4(0.71f, 0.71f, 0.71f, 0.40f); - ImGui.GetStyle().Colors[(int)ImGuiCol.ButtonHovered] = new Vector4(0.47f, 0.47f, 0.47f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.ButtonActive] = new Vector4(0.74f, 0.74f, 0.74f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.Header] = new Vector4(0.59f, 0.59f, 0.59f, 0.31f); - ImGui.GetStyle().Colors[(int)ImGuiCol.HeaderHovered] = new Vector4(0.50f, 0.50f, 0.50f, 0.80f); - ImGui.GetStyle().Colors[(int)ImGuiCol.HeaderActive] = new Vector4(0.60f, 0.60f, 0.60f, 1.00f); - ImGui.GetStyle().Colors[(int)ImGuiCol.ResizeGrip] = new Vector4(0.79f, 0.79f, 0.79f, 0.25f); - ImGui.GetStyle().Colors[(int)ImGuiCol.ResizeGripHovered] = new Vector4(0.78f, 0.78f, 0.78f, 0.67f); - ImGui.GetStyle().Colors[(int)ImGuiCol.ResizeGripActive] = new Vector4(0.88f, 0.88f, 0.88f, 0.95f); - ImGui.GetStyle().Colors[(int)ImGuiCol.Tab] = new Vector4(0.23f, 0.23f, 0.23f, 0.86f); - ImGui.GetStyle().Colors[(int)ImGuiCol.TabHovered] = new Vector4(0.71f, 0.71f, 0.71f, 0.80f); - ImGui.GetStyle().Colors[(int)ImGuiCol.TabActive] = new Vector4(0.36f, 0.36f, 0.36f, 1.00f); - // end dalamud copy - - pluginUI.Initialize(scene); - - scene.Run(); - - pluginUI.Dispose(); - } - } -} diff --git a/UIDev/UIDev.csproj b/UIDev/UIDev.csproj deleted file mode 100644 index 218daaa..0000000 --- a/UIDev/UIDev.csproj +++ /dev/null @@ -1,49 +0,0 @@ - - - - net5.0-windows - x64 - enable - WinExe - latest - true - - - - $(appdata)\XIVLauncher\addon\Hooks\dev\ - - - - - $(DalamudLibPath)Newtonsoft.Json.dll - - - $(DalamudLibPath)ImGui.NET.dll - - - $(DalamudLibPath)ImGuiScene.dll - - - $(DalamudLibPath)SDL2-CS.dll - - - - - - PreserveNewest - false - - - PreserveNewest - false - - - PreserveNewest - false - - - - - - - diff --git a/UIDev/UITest.cs b/UIDev/UITest.cs deleted file mode 100644 index ea5d6db..0000000 --- a/UIDev/UITest.cs +++ /dev/null @@ -1,121 +0,0 @@ -using ImGuiNET; -using ImGuiScene; -using System.Numerics; - -namespace UIDev -{ - class UITest : IPluginUIMock - { - public static void Main(string[] args) - { - UIBootstrap.Inititalize(new UITest()); - } - - private TextureWrap? goatImage; - private SimpleImGuiScene? scene; - - public void Initialize(SimpleImGuiScene scene) - { - // scene is a little different from what you have access to in dalamud - // but it can accomplish the same things, and is really only used for initial setup here - - // eg, to load an image resource for use with ImGui - this.goatImage = scene.LoadImage("goat.png"); - - scene.OnBuildUI += Draw; - - this.Visible = true; - - // saving this only so we can kill the test application by closing the window - // (instead of just by hitting escape) - this.scene = scene; - } - - public void Dispose() - { - this.goatImage?.Dispose(); - } - - // You COULD go all out here and make your UI generic and work on interfaces etc, and then - // mock dependencies and conceivably use exactly the same class in this testbed and the actual plugin - // That is, however, a bit excessive in general - it could easily be done for this sample, but I - // don't want to imply that is easy or the best way to go usually, so it's not done here either - private void Draw() - { - DrawMainWindow(); - DrawSettingsWindow(); - - if (!Visible) - { - this.scene!.ShouldQuit = true; - } - } - - #region Nearly a copy/paste of PluginUI - private bool visible = false; - public bool Visible - { - get { return this.visible; } - set { this.visible = value; } - } - - private bool settingsVisible = false; - public bool SettingsVisible - { - get { return this.settingsVisible; } - set { this.settingsVisible = value; } - } - - // this is where you'd have to start mocking objects if you really want to match - // but for simple UI creation purposes, just hardcoding values works - private bool fakeConfigBool = true; - - public void DrawMainWindow() - { - if (!Visible) - { - return; - } - - ImGui.SetNextWindowSize(new Vector2(375, 330), ImGuiCond.FirstUseEver); - ImGui.SetNextWindowSizeConstraints(new Vector2(375, 330), new Vector2(float.MaxValue, float.MaxValue)); - if (ImGui.Begin("My Amazing Window", ref this.visible, ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)) - { - ImGui.Text($"The random config bool is {this.fakeConfigBool}"); - - if (ImGui.Button("Show Settings")) - { - SettingsVisible = true; - } - - ImGui.Spacing(); - - ImGui.Text("Have a goat:"); - ImGui.Indent(55); - ImGui.Image(this.goatImage!.ImGuiHandle, new Vector2(this.goatImage.Width, this.goatImage.Height)); - ImGui.Unindent(55); - } - ImGui.End(); - } - - public void DrawSettingsWindow() - { - if (!SettingsVisible) - { - return; - } - - ImGui.SetNextWindowSize(new Vector2(232, 75), ImGuiCond.Always); - if (ImGui.Begin("A Wonderful Configuration Window", ref this.settingsVisible, - ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse)) - { - if (ImGui.Checkbox("Random Config Bool", ref this.fakeConfigBool)) - { - // nothing to do in a fake ui! - } - } - ImGui.End(); - } - #endregion - } -}