@@ -63,54 +63,93 @@ void Gui::MainWindow::act()
63
63
64
64
ImGui::Begin (" GW2 addon manager" );
65
65
66
+ ImGui::Text (" Active addons" );
67
+ ImGui::NewLine ();
68
+
69
+ int idx = 0 ;
70
+ char perAddonTag[256 ];
71
+
66
72
for (const auto & i : gAddon ().main .GetAddonList ())
67
73
{
68
- ImGui::Text (" %S" , i.name );
74
+ ++idx;
75
+ if ((i.status != GW2AL_OK) || !i.dsc )
76
+ continue ;
77
+
78
+ ImGui::Text (" %S v%u.%u build %u" , i.name , i.dsc ->majorVer , i.dsc ->minorVer , i.dsc ->revision );
69
79
70
- if (i.status == GW2AL_OK)
80
+ sprintf_s (perAddonTag, " O##%S" , i.name );
81
+
82
+ ImGui::SameLine ();
83
+ if (ImGui::Button (perAddonTag) && idx != activeIndex)
84
+ activeIndex = idx;
85
+
86
+ if (idx == activeIndex)
71
87
{
72
- ImGui::SameLine ();
73
- if (!i.dsc )
74
- {
75
- ImGui::Text (" E: [no description found]" );
76
- continue ;
77
- }
78
-
79
- ImGui::Text (" v%u.%u build %u" , i.dsc ->majorVer , i.dsc ->minorVer , i.dsc ->revision );
80
- // TODO: make it a hover popup
88
+ ImGui::NewLine ();
81
89
ImGui::Text (" %S" , i.dsc ->description );
82
- }
83
- else {
84
- ImGui::SameLine ();
85
- switch (i.status )
90
+ if (i.menuShowProc )
86
91
{
87
- case GW2AL_BAD_DLL:
88
- ImGui::Text (" E: [missing one of export functions]" );
89
- break ;
90
- case GW2AL_NOT_FOUND:
91
- ImGui::Text (" E: [dll not found]" );
92
- break ;
93
- case GW2AL_DEP_NOT_LOADED:
94
- ImGui::Text (" E: [dependency missing]" );
95
- break ;
96
- case GW2AL_DEP_OUTDATED:
97
- ImGui::Text (" E: [dependency outdated]" );
98
- break ;
99
- default :
100
- ImGui::Text (" E: [general failure]" );
101
- break ;
102
- }
92
+ sprintf_s (perAddonTag, " Show addon menu##%S" , i.name );
93
+ if (ImGui::Button (perAddonTag))
94
+ {
95
+ i.menuShowProc ();
96
+ }
97
+ }
98
+ // TODO: make this work
99
+ ImGui::SameLine ();
100
+ ImGui::Button (" Update" );
101
+ ImGui::SameLine ();
102
+ ImGui::Button (" Reload" );
103
+ ImGui::SameLine ();
104
+ ImGui::Button (" Disable" );
103
105
}
106
+ }
104
107
105
- // TODO: make this work
106
- ImGui::Button (" Update" );
107
- ImGui::SameLine ();
108
- ImGui::Button (" Reload" );
109
- ImGui::SameLine ();
110
- ImGui::Button (" Disable" );
111
- ImGui::SameLine ();
112
- ImGui::Button (" Open config menu" );
108
+ ImGui::Separator ();
109
+ ImGui::Text (" Inactive addons" );
110
+ ImGui::NewLine ();
111
+
112
+ for (const auto & i : gAddon ().main .GetAddonList ())
113
+ {
114
+ if ((i.status == GW2AL_OK) && i.dsc )
115
+ continue ;
116
+
117
+ ImGui::Text (" %S" , i.name );
118
+
119
+ switch (i.status )
120
+ {
121
+ case GW2AL_BAD_DLL:
122
+ ImGui::Text (" E: [missing one of export functions]" );
123
+ break ;
124
+ case GW2AL_NOT_FOUND:
125
+ ImGui::Text (" E: [dll not found]" );
126
+ break ;
127
+ case GW2AL_DEP_NOT_LOADED:
128
+ ImGui::Text (" E: [dependency missing]" );
129
+ break ;
130
+ case GW2AL_DEP_OUTDATED:
131
+ ImGui::Text (" E: [dependency outdated]" );
132
+ break ;
133
+ case GW2AL_OK:
134
+ ImGui::Text (" E: [no description found]" );
135
+ break ;
136
+ default :
137
+ ImGui::Text (" E: [general failure]" );
138
+ break ;
139
+ }
140
+
141
+ ImGui::NewLine ();
113
142
}
143
+
144
+ ImGui::Separator ();
145
+
146
+ // TODO: make this work
147
+ ImGui::SameLine ();
148
+ ImGui::Button (" Update all" );
149
+ ImGui::SameLine ();
150
+ ImGui::Button (" Reload all" );
151
+ ImGui::SameLine ();
152
+ ImGui::Button (" Disable all" );
114
153
115
154
ImGui::End ();
116
155
}
0 commit comments