aboutsummaryrefslogtreecommitdiffstats
path: root/Malmstone/Windows/ConfigWindow.cs
blob: 37b9490ced4c2cd46c0ab1a55f4fda7b71c04b2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System;
using System.Numerics;
using Dalamud.Interface.Windowing;
using ImGuiNET;

namespace Malmstone.Windows;

public class ConfigWindow : Window, IDisposable
{
    private Configuration Configuration;
    private Plugin Plugin;
    private string[] ToastOptions = {"Normal", "Quest", "Error"};

    public ConfigWindow(Plugin Plugin) : base("Malmstone Config")
    {
        Flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollbar |
                ImGuiWindowFlags.NoScrollWithMouse;
        Size = new Vector2(350, 400);
        Configuration = Plugin.Configuration;
        this.Plugin = Plugin;
    }

    public void Dispose() { }

    public override void PreDraw()
    {
    }

    public override void Draw()
    {
        ImGui.Text("Default Target Series Level");
        var savedTargetSeriesRank = Configuration.DefaultTargetRankProperty;
        if (ImGui.InputInt("##SavedTargetSeriesRank", ref savedTargetSeriesRank, 1))
        {
            if (savedTargetSeriesRank < 1) savedTargetSeriesRank = 1;
            if (savedTargetSeriesRank > 107397) savedTargetSeriesRank = 107397;
            Configuration.DefaultTargetRankProperty = savedTargetSeriesRank;
            Configuration.Save();
        }

        ImGui.Separator();

        ImGui.Text("Show XP to next level after PVP matches");
        ImGui.SameLine();
        var showProgressionToastPostMatch = Configuration.ShowProgressionToastPostMatch;
        if (ImGui.Checkbox("##ShowProgressionToastPostMatch", ref showProgressionToastPostMatch))
        {
            Configuration.ShowProgressionToastPostMatch = showProgressionToastPostMatch;
            Configuration.Save();
        }

        ImGui.Text("Notification Type");
        int selectedPostMatchToastType = Configuration.PostmatchProgressionToastType;
        if (ImGui.Combo("##MatchOptions", ref selectedPostMatchToastType, ToastOptions, ToastOptions.Length))
        {
            switch (selectedPostMatchToastType)
            {
                case 0:
                    Plugin.ToastGui.ShowNormal("[Malmstone Calculator] Normal Toast Selected");
                    break;
                case 1:
                    Plugin.ToastGui.ShowQuest("[Malmstone Calculator] Quest Toast Selected");
                    break;
                case 2:
                    Plugin.ToastGui.ShowError("[Malmstone Calculator] Error Toast Selected");
                    break;
            }
            Configuration.PostmatchProgressionToastType = selectedPostMatchToastType;
            Configuration.Save();
        }

        ImGui.Separator();
        ImGui.Text("Show matches until next rank in chat after");


        var showCCMatchesRemainingPostGame = Configuration.ShowProgressionChatPostCC;
        if (ImGui.Checkbox("##ShowCCMatchesRemainingPostGame", ref showCCMatchesRemainingPostGame))
        {
            Configuration.ShowProgressionChatPostCC = showCCMatchesRemainingPostGame;
            if (showCCMatchesRemainingPostGame)
                Plugin.PvPAddon.EnableCrystallineConflictPostMatch();
            else
                Plugin.PvPAddon.DisableCrystallineConflictPostMatch();
            Configuration.Save();
        }
        ImGui.SameLine();
        ImGui.Text("Crystalline Conflict");


        var showFLMatchesRemainingPostGame = Configuration.ShowProgressionChatPostFL;
        if (ImGui.Checkbox("##ShowFLMatchesRemainingPostGame", ref showFLMatchesRemainingPostGame))
        {
            Configuration.ShowProgressionChatPostFL = showFLMatchesRemainingPostGame;
            if (showFLMatchesRemainingPostGame)
                Plugin.PvPAddon.EnableFrontlinePostMatch();
            else
                Plugin.PvPAddon.DisableFrontlinePostMatch();
            Configuration.Save();
        }
        ImGui.SameLine();
        ImGui.Text("Frontlines");


        var showRWMatchesRemainingPostGame = Configuration.ShowProgressionChatPostRW;
        if (ImGui.Checkbox("##ShowRWMatchesRemainingPostGame", ref showRWMatchesRemainingPostGame))
        {
            Configuration.ShowProgressionChatPostRW = showRWMatchesRemainingPostGame;
            if (showRWMatchesRemainingPostGame)
                Plugin.PvPAddon.EnableRivalWingsPostMatch();
            else
                Plugin.PvPAddon.DisableRivalWingsPostMatch();
            Configuration.Save();
        }
        ImGui.SameLine();
        ImGui.Text("Rival Wings");


        ImGui.Separator();
        ImGui.Spacing();
        ImGui.Text("Changes saved automatically");

    }
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage