overlay: help tooltip updates (#279)

## Link to GitHub Issue, if one exists
n/a

## Description of change

In Options (and in Advanced/API/Search tabs), remove the help marker
`(?)` and instead add a tooltip to the option name label and the control
widgets like the checkbox, text input, and combo. This is to help with
discoverability as many users failed to discover the `(?)` widget.

Similarly, update the Patches tab to remove `(?)` and add tooltips to
widgets. Patches with warnings `(!)` will continue to show it to
distinguish it from other patches.

Update styling for the tooltip (dark red background -> dark gray) so
that it stands out from other widgets.

Remove the purple option text used for game-specific options.

## Compiling
👍 

## Testing
Tested in spicecfg, and in-game overlay.
This commit is contained in:
bicarus-dev
2025-03-28 20:34:58 -07:00
committed by GitHub
parent 104a9cbffd
commit 4f1ada7a2f
5 changed files with 97 additions and 35 deletions
+23 -6
View File
@@ -2629,9 +2629,8 @@ namespace overlay::windows {
// list entry
ImGui::PushID(&option);
ImGui::AlignTextToFramePadding();
ImGui::HelpMarker(definition.desc.c_str());
ImGui::SameLine();
if (option.is_active()) {
// active option
if (option.disabled || definition.disabled) {
ImGui::TextColored(ImVec4(1.f, 0.4f, 0.f, 1.f), "%s", definition.title.c_str());
} else {
@@ -2639,18 +2638,21 @@ namespace overlay::windows {
}
} else if (definition.hidden
|| (!definition.game_name.empty() && definition.game_name != this->games_selected_name)) {
// wrong game - grayed out
ImGui::TextColored(ImVec4(0.5f, 0.5f, 0.5f, 1.f), "%s", definition.title.c_str());
} else if (definition.game_name == this->games_selected_name) {
ImGui::TextColored(ImVec4(0.8f, 0, 0.8f, 1.f), "%s", definition.title.c_str());
} else {
// normal text
ImGui::Text("%s", definition.title.c_str());
}
if (ImGui::IsItemHovered()) {
ImGui::HelpTooltip(definition.desc.c_str());
}
ImGui::NextColumn();
ImGui::AlignTextToFramePadding();
if (definition.display_name.empty()) {
ImGui::Text("-%s", definition.name.c_str());
ImGui::TextDisabled("-%s", definition.name.c_str());
} else {
ImGui::Text("-%s", definition.display_name.c_str());
ImGui::TextDisabled("-%s", definition.display_name.c_str());
}
ImGui::NextColumn();
if (option.disabled || definition.disabled) {
@@ -2665,6 +2667,9 @@ namespace overlay::windows {
option.value = state ? "/ENABLED" : "";
::Config::getInstance().updateBinding(games_list[games_selected], option);
}
if (ImGui::IsItemHovered()) {
ImGui::HelpTooltip(definition.desc.c_str());
}
break;
}
case OptionType::Integer: {
@@ -2691,6 +2696,9 @@ namespace overlay::windows {
option.value = buffer;
::Config::getInstance().updateBinding(games_list[games_selected], option);
}
if (ImGui::IsItemHovered()) {
ImGui::HelpTooltip(definition.desc.c_str());
}
break;
}
case OptionType::Hex: {
@@ -2724,6 +2732,9 @@ namespace overlay::windows {
option.value = buffer;
::Config::getInstance().updateBinding(games_list[games_selected], option);
}
if (ImGui::IsItemHovered()) {
ImGui::HelpTooltip(definition.desc.c_str());
}
break;
}
case OptionType::Text: {
@@ -2741,6 +2752,9 @@ namespace overlay::windows {
option.value = buffer;
::Config::getInstance().updateBinding(games_list[games_selected], option);
}
if (ImGui::IsItemHovered()) {
ImGui::HelpTooltip(definition.desc.c_str());
}
break;
}
case OptionType::Enum: {
@@ -2771,6 +2785,9 @@ namespace overlay::windows {
}
ImGui::EndCombo();
}
if (ImGui::IsItemHovered()) {
ImGui::HelpTooltip(definition.desc.c_str());
}
break;
}
default: {