Skip to content

Commit

Permalink
ui/selmenu.cpp, ui/selgame.cpp, debugger/debugimgui.cpp: Hacked stuff…
Browse files Browse the repository at this point in the history
… out until it builds again.
  • Loading branch information
cuavas committed Apr 7, 2024
1 parent 4d3595b commit d79c319
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/frontend/mame/ui/selgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ bool menu_select_game::handle(event const *ev)
}
break;

#if 0
case IPT_CUSTOM:
// handle IPT_CUSTOM (mouse right click)
if (!m_populated_favorites)
Expand All @@ -303,6 +304,7 @@ bool menu_select_game::handle(event const *ev)
});
}
break;
#endif

case IPT_UI_LEFT:
if (right_panel() == RP_IMAGES)
Expand Down
29 changes: 29 additions & 0 deletions src/frontend/mame/ui/selmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ std::pair<char const *, char const *> RIGHT_PANEL_NAMES[RP_LAST + 1] = {
{ "image", N_("Images") },
{ "info", N_("Info") } };

enum
{
HOVER_DAT_UP = -1000,
HOVER_DAT_DOWN,
HOVER_UI_LEFT,
HOVER_UI_RIGHT,
HOVER_B_FAV,
HOVER_B_EXPORT,
HOVER_B_AUDIT,
HOVER_B_DATS,
HOVER_BACKTRACK,
HOVER_INFO_TEXT
};

enum
{
FIRST_VIEW = 0,
Expand Down Expand Up @@ -512,6 +526,7 @@ menu_select_launch::menu_select_launch(mame_ui_manager &mui, render_container &c
, m_cache(mui.get_session_data<menu_select_launch, cache_wrapper>(machine()))
, m_is_swlist(is_swlist)
, m_focus(focused_menu::MAIN)
, m_hover(1)
, m_pointer_action(pointer_action::NONE)
, m_scroll_repeat(std::chrono::steady_clock::time_point::min())
, m_base_pointer(0.0F, 0.0F)
Expand Down Expand Up @@ -971,6 +986,7 @@ void menu_select_launch::draw_common_arrow(float origx1, float origy1, float ori
fgcolor_right = fgcolor_left = ui().colors().text_color();

// set hover
#if 0
if (mouse_in_rect(ar_x0, ar_y0, ar_x1, ar_y1) && current != dmax)
{
ui().draw_textured_box(container(), ar_x0 + 0.01f, ar_y0, ar_x1 - 0.01f, ar_y1, ui().colors().mouseover_bg_color(), rgb_t(43, 43, 43),
Expand All @@ -985,6 +1001,7 @@ void menu_select_launch::draw_common_arrow(float origx1, float origy1, float ori
set_hover(HOVER_UI_LEFT);
fgcolor_left = ui().colors().mouseover_color();
}
#endif

// apply arrow
if (dmax == dmin)
Expand All @@ -1009,6 +1026,7 @@ void menu_select_launch::draw_info_arrow(int ub, float origx1, float origx2, flo
{
rgb_t fgcolor = ui().colors().text_color();

#if 0
if (mouse_in_rect(origx1, oy1, origx2, oy1 + line_height))
{
ui().draw_textured_box(
Expand All @@ -1020,6 +1038,7 @@ void menu_select_launch::draw_info_arrow(int ub, float origx1, float origx2, flo
set_hover(!ub ? HOVER_DAT_UP : HOVER_DAT_DOWN);
fgcolor = ui().colors().mouseover_color();
}
#endif

u32 const orientation = !ub ? ROT0 : (ROT0 ^ ORIENTATION_FLIP_Y);
draw_arrow(
Expand Down Expand Up @@ -1395,6 +1414,7 @@ void menu_select_launch::draw_toolbar(float x1, float y1, float x2, float y2)

// add backtrack button
rgb_t color(0xffcccccc);
#if 0
if (mouse_in_rect(backtrack_pos, y1, x2, y2))
{
set_hover(HOVER_BACKTRACK);
Expand All @@ -1406,6 +1426,7 @@ void menu_select_launch::draw_toolbar(float x1, float y1, float x2, float y2)
text_layout::text_justify::RIGHT, 1.0f - lr_border(), ypos,
ui().colors().background_color());
}
#endif
container().add_quad(
backtrack_pos, y1, x2, y2,
color,
Expand All @@ -1419,6 +1440,7 @@ void menu_select_launch::draw_toolbar(float x1, float y1, float x2, float y2)
auto const bitmap = toolbar_bitmaps[z];
x2 = x1 + x_size;
color = rgb_t (0xffcccccc);
#if 0
if (mouse_in_rect(x1, y1, x2, y2))
{
bool const need_selection = (TOOLBAR_BITMAP_FAVORITE == bitmap) || (TOOLBAR_BITMAP_INFO == bitmap);
Expand All @@ -1434,6 +1456,7 @@ void menu_select_launch::draw_toolbar(float x1, float y1, float x2, float y2)
text_layout::text_justify::CENTER, (x1 + x2) * 0.5f, ypos,
ui().colors().background_color());
}
#endif
container().add_quad(
x1, y1, x2, y2,
color,
Expand Down Expand Up @@ -1569,6 +1592,7 @@ bool menu_select_launch::handle_events(u32 flags, event &ev)
}
break;

#if 0
// if we are hovering over a valid item, select it with a single click
case ui_event::type::MOUSE_DOWN:
{
Expand Down Expand Up @@ -1610,6 +1634,7 @@ bool menu_select_launch::handle_events(u32 flags, event &ev)
}
}
break;
#endif

// caught scroll event
case ui_event::type::MOUSE_WHEEL:
Expand Down Expand Up @@ -1659,6 +1684,7 @@ bool menu_select_launch::handle_events(u32 flags, event &ev)
}
break;

#if 0
case ui_event::type::MOUSE_RDOWN:
if (hover() >= 0 && hover() < item_count() - m_skip_main_items)
{
Expand All @@ -1671,6 +1697,7 @@ bool menu_select_launch::handle_events(u32 flags, event &ev)
stop = true;
}
break;
#endif

// ignore everything else
default:
Expand Down Expand Up @@ -3482,8 +3509,10 @@ void menu_select_launch::infos_render(float origx1, float origy1, float origx2,
bool const down_arrow = (m_topline_datsview + m_right_visible_lines) < m_total_lines;
int const r_visible_lines = m_right_visible_lines - (up_arrow ? 1 : 0) - (down_arrow ? 1 : 0);

#if 0
if (mouse_in_rect(origx1 + gutter_width, oy1, origx2 - gutter_width, origy2))
set_hover(HOVER_INFO_TEXT);
#endif

if (up_arrow)
draw_info_arrow(0, origx1, origx2, oy1, m_info_line_height, m_info_line_height * aspect);
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/mame/ui/selmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ class menu_select_launch : public menu
float right_divider_left() const noexcept { return 1.0F - lr_border() - m_right_panel_width - m_divider_width; }
float right_divider_right() const noexcept { return 1.0F - lr_border() - m_right_panel_width; }

int hover() const { return m_hover; }
void set_hover(int index) { m_hover = index; }

bool snapx_valid() const { return m_cache.snapx_bitmap().valid(); }

Expand Down Expand Up @@ -403,6 +405,7 @@ class menu_select_launch : public menu
cache &m_cache;
bool m_is_swlist;
focused_menu m_focus;
int m_hover; // which item is being hovered over

pointer_action m_pointer_action;
std::chrono::steady_clock::time_point m_scroll_repeat;
Expand Down
2 changes: 2 additions & 0 deletions src/osd/modules/debugger/debugimgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,13 @@ bool debug_imgui::get_view_source(void* data, int idx, const char** out_text)

void debug_imgui::handle_mouse()
{
#if 0
m_prev_mouse_button = m_mouse_button;
m_machine->ui_input().find_mouse(&m_mouse_x, &m_mouse_y, &m_mouse_button);
ImGuiIO& io = ImGui::GetIO();
io.MousePos = ImVec2(m_mouse_x,m_mouse_y);
io.MouseDown[0] = m_mouse_button;
#endif
}

void debug_imgui::handle_mouse_views()
Expand Down

0 comments on commit d79c319

Please sign in to comment.