add hints to bios selection

This commit is contained in:
Matthew Berry 2022-10-22 12:53:02 -07:00
parent e37ca13dd5
commit 2fe794edba
2 changed files with 18 additions and 2 deletions

View file

@ -16,7 +16,9 @@ class BiosSelection < Resolvable
end
def render : Nil
ImGui.text("GBC BIOS File:")
ImGui.text("GBC BIOS:")
ImGui.same_line
help_marker("A BIOS is only necessary if you want to see the boot animation. It serves no other purpose. If you decide to use one, make sure to use a BIOS for the CGB, not the DMG.")
ImGui.same_line
gbc_bios_text_buffer_valid = @gbc_bios_text_buffer_valid
ImGui.push_style_color(ImGui::ImGuiCol::Text, RED_TEXT_COL) unless gbc_bios_text_buffer_valid
@ -28,7 +30,9 @@ class BiosSelection < Resolvable
ImGui.same_line
gbc_bios_browse = ImGui.button("Browse##gbc_bios")
ImGui.text("GBA BIOS File:")
ImGui.text("GBA BIOS:")
ImGui.same_line
help_marker("While a BIOS is included for you, using the official GBA BIOS will *always* be more accurate.")
ImGui.same_line
gba_bios_text_buffer_valid = @gba_bios_text_buffer_valid
ImGui.push_style_color(ImGui::ImGuiCol::Text, RED_TEXT_COL) unless gba_bios_text_buffer_valid

View file

@ -0,0 +1,12 @@
# Display a little (?) mark which shows a tooltip when hovered. Translated from
# the demo code.
def help_marker(desc : String) : Nil
ImGui.text_disabled("(?)")
if ImGui.is_item_hovered
ImGui.tooltip do
ImGui.with_text_wrap_pos(ImGui.get_font_size * 35_f32) do
ImGui.text_unformatted(desc)
end
end
end
end