@@ -11,7 +11,9 @@ class MiscManager : public BaseManager {
11
11
12
12
void drawImGui () {
13
13
14
- if (ImGui::CollapsingHeader (" Misc" )) {
14
+ ImGui::SetNextTreeNodeOpen (isGuiOpened);
15
+
16
+ if ((isGuiOpened = ImGui::CollapsingHeader (" Misc" ))) {
15
17
16
18
if (ImGui::Checkbox (" Show Window On Top" , &showWindowTop)) {
17
19
WindowUtils::setWindowOnTop (showWindowTop);
@@ -29,12 +31,37 @@ class MiscManager : public BaseManager {
29
31
ImGui::PushStyleVar (ImGuiStyleVar_WindowRounding, 2 );
30
32
ImGui::Begin (" Help" , &showHelp, ImGuiWindowFlags_AlwaysAutoResize);
31
33
32
- ImGui::Text (" Left click drag: Rotate camera\n "
33
- " Right click drag: Zoom camera\n "
34
- " Hold [H] whilst left click drag: Pan camera\n "
35
- " [R]: Reset camera\n "
36
- " [C]: Toggle control panel\n "
37
- " [1-9]: Switch cameras in the scene file" );
34
+ static const vector<pair<string, string>> helpTexts = {
35
+ {" Left click drag" , " Rotate camera" },
36
+ {" Right click drag" , " Zoom camera" },
37
+ {" Middle click drag" , " Pan camera" },
38
+ {" [H] + Left click drag" , " " },
39
+ {" [R]" , " Reset camera" },
40
+ {" [1-9]" , " Switch cameras in the scene file" },
41
+ {" " , " " },
42
+ {" [F]" , " Toggle fullscreen" },
43
+ {" [C]" , " Toggle control panel" },
44
+ {" [G]" , " Toggle showing guides" },
45
+ {" [W]" , " Toggle showing wireframe" }
46
+ };
47
+
48
+ static stringstream sskey, ssdesc;
49
+
50
+ sskey.str (" " );
51
+ ssdesc.str (" " );
52
+
53
+ for (auto & line : helpTexts) {
54
+ sskey << line.first << " \n " ;
55
+ ssdesc << line.second << " \n " ;
56
+ }
57
+
58
+ ImGui::Columns (2 , NULL , true );
59
+
60
+ ImGui::Text (" %s" , sskey.str ().c_str ());
61
+ ImGui::NextColumn ();
62
+ ImGui::Text (" %s" , ssdesc.str ().c_str ());
63
+
64
+ ImGui::Columns (1 );
38
65
39
66
ImGui::End ();
40
67
ImGui::PopStyleVar ();
@@ -48,6 +75,8 @@ class MiscManager : public BaseManager {
48
75
49
76
settings.pushTag (" misc" );
50
77
78
+ isGuiOpened = settings.getValue (" isGuiOpened" , isGuiOpened);
79
+
51
80
showWindowTop = settings.getValue (" showWindowTop" , showWindowTop);
52
81
WindowUtils::setWindowOnTop (showWindowTop);
53
82
@@ -61,6 +90,8 @@ class MiscManager : public BaseManager {
61
90
settings.addTag (" misc" );
62
91
settings.pushTag (" misc" );
63
92
93
+ settings.setValue (" isGuiOpened" , isGuiOpened);
94
+
64
95
settings.setValue (" showWindowTop" , showWindowTop);
65
96
66
97
settings.popTag ();
0 commit comments