Skip to content

Commit 7e540e9

Browse files
committed
Finished tooltips for waypoint gui
1 parent bbadc48 commit 7e540e9

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

HCMInternal/EditOrAddWaypointDialog.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
2424
void renderGlobalOption(bool& useGlobal, SimpleMath::Vector4& customColor, std::string optionName)
2525
{
2626
ImGui::Checkbox(std::format("Use Global {}", optionName).c_str(), &useGlobal);
27-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
27+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip(std::format("Use the global setting for {} or customise it per waypoint", optionName).c_str()); }
2828

2929
{
3030
ImGui::BeginDisabled(useGlobal);
3131

3232
ImGui::ColorEdit4(std::format("{}", optionName).c_str(), &customColor.x, editFlags);
33-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
33+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip(std::format("What colour should {} for this waypoint be?", optionName).c_str()); }
3434

3535
ImGui::EndDisabled();
3636
}
@@ -39,14 +39,14 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
3939
void renderGlobalOption(bool& useGlobal, float customScale, std::string optionName)
4040
{
4141
ImGui::Checkbox(std::format("Use Global {}", optionName).c_str(), &useGlobal);
42-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
42+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip(std::format("Use the global setting for {} or customise it per waypoint", optionName).c_str()); }
4343

4444
{
4545
ImGui::BeginDisabled(useGlobal);
4646

4747
ImGui::SetNextItemWidth(100.f);
4848
ImGui::InputFloat(std::format("{}", optionName).c_str(), &customScale);
49-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
49+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip(std::format("What scale (size) should {} for this waypoint be?", optionName).c_str()); }
5050

5151
ImGui::EndDisabled();
5252
}
@@ -55,14 +55,14 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
5555
void renderGlobalOption(bool& useGlobal, int customPrecision, std::string optionName)
5656
{
5757
ImGui::Checkbox(std::format("Use Global {}", optionName).c_str(), &useGlobal);
58-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
58+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip(std::format("Use the global setting for {} or customise it per waypoint", optionName).c_str()); }
5959

6060
{
6161
ImGui::BeginDisabled(useGlobal);
6262

6363
ImGui::SetNextItemWidth(100.f);
6464
ImGui::InputInt(std::format("{}", optionName).c_str(), &customPrecision);
65-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
65+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("How precise (ie how many decimal points) should the decimal digit be?"); }
6666

6767
ImGui::EndDisabled();
6868
}
@@ -81,15 +81,12 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
8181

8282
ImGui::SetNextItemWidth(100);
8383
ImGui::InputFloat("x position", &workingWaypoint.position.x, 0, 0, "%.6f");
84-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
8584

8685
ImGui::SetNextItemWidth(100);
8786
ImGui::InputFloat("y position", &workingWaypoint.position.y, 0, 0, "%.6f");
88-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
8987

9088
ImGui::SetNextItemWidth(100);
9189
ImGui::InputFloat("z position", &workingWaypoint.position.z, 0, 0, "%.6f");
92-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
9390

9491
if (mPlayerPosition.has_value())
9592
{
@@ -103,11 +100,11 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
103100
ImGui::InputText("Label", &workingWaypoint.label);
104101

105102
ImGui::Checkbox("Enabled", &workingWaypoint.waypointEnabled);
106-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
103+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Whether this waypoint is enabled (visible) or not."); }
107104

108105
{
109106
ImGui::Checkbox("Show Sprite", &workingWaypoint.showSprite);
110-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
107+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Whether to show the crosshair sprite for this waypoint"); }
111108

112109
ImGui::BeginDisabled(workingWaypoint.showSprite == false);
113110
renderGlobalOption(workingWaypoint.spriteColorUseGlobal, workingWaypoint.spriteColor, "Sprite Color");
@@ -117,7 +114,7 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
117114

118115
{
119116
ImGui::Checkbox("Show Label", &workingWaypoint.showLabel);
120-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
117+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Whether to show the label (name) of this waypoint"); }
121118

122119
ImGui::BeginDisabled(workingWaypoint.showLabel == false);
123120
renderGlobalOption(workingWaypoint.labelColorUseGlobal, workingWaypoint.labelColor, "Label Text Color");
@@ -128,7 +125,7 @@ class EditOrAddWaypointDialog : public IModalDialogReturner<std::optional<Waypoi
128125
if (mCanMeasureDistance) // requires optional services that might fail
129126
{
130127
ImGui::Checkbox("Show Distance Measure", &workingWaypoint.showDistance);
131-
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("todo"); }
128+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Whether to show the distance measurement between the player and the waypoint"); }
132129

133130
ImGui::BeginDisabled(workingWaypoint.showDistance == false);
134131
ImGui::Checkbox("Measure Horizontal Only", &workingWaypoint.measureHorizontalOnly);

HCMInternal/GUIWaypointList.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ class GUIWaypointList : public IGUIElement {
8888
auto& newThread = mFireEventThreads.emplace_back(std::thread([mEvent = mEventToFire, &waypointList]() {mEvent->operator()(waypointList); }));
8989
newThread.detach();
9090
}
91+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Add a new waypoint to the waypoint list"); }
9192
currentHeight += GUIFrameHeightWithSpacing;
9293

9394
// draw copy list to clipboard button
@@ -100,6 +101,7 @@ class GUIWaypointList : public IGUIElement {
100101
ss << "</waypoint3DList>";
101102
ImGui::SetClipboardText(ss.str().c_str());
102103
}
104+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Copy the entire waypoint list to the clipboard"); }
103105
currentHeight += GUIFrameHeightWithSpacing;
104106

105107
// draw paste list from clipboard button
@@ -118,6 +120,7 @@ class GUIWaypointList : public IGUIElement {
118120
}
119121

120122
}
123+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Paste a waypoint list from the clipboard"); }
121124
currentHeight += GUIFrameHeightWithSpacing;
122125

123126
// draw waypoint list
@@ -167,7 +170,7 @@ class GUIWaypointList : public IGUIElement {
167170
{
168171
PLOG_VERBOSE << "waypoint list toggling enabled flag";
169172
}
170-
173+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Whether this waypoint is enabled (visible) or not."); }
171174

172175

173176
// draw edit button
@@ -185,6 +188,8 @@ class GUIWaypointList : public IGUIElement {
185188
auto& newThread = mFireEventThreads.emplace_back(std::thread([mEvent = mEventToFire, &waypoint,&waypointList]() {mEvent->operator()(waypoint, waypointList); }));
186189
newThread.detach();
187190
}
191+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Open the edit dialog with more settings for this specific waypoint"); }
192+
188193

189194
// draw delete button
190195
ImGui::SameLine();
@@ -202,6 +207,8 @@ class GUIWaypointList : public IGUIElement {
202207
newThread.detach();
203208

204209
}
210+
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled)) { ImGui::SetTooltip("Deletes this waypoint from the waypoint list"); }
211+
205212

206213
// draw label text
207214
ImGui::SameLine();

0 commit comments

Comments
 (0)