overlays/osk: Add more buttons to native dialog and other improvements

- Adds all the major buttons to native dialog input options
- Adds more button options for the native osk
- Brighten osk cell backgrounds a bit to improve visibility
This commit is contained in:
kd-11 2019-01-30 12:50:29 +03:00 committed by kd-11
parent 9ed9d7e947
commit c434e0ce27
4 changed files with 107 additions and 50 deletions

View file

@ -479,10 +479,16 @@ namespace rsx
{ {
fade_top = 1, fade_top = 1,
fade_bottom, fade_bottom,
select,
start,
cross, cross,
circle, circle,
triangle, triangle,
square, square,
L1,
R1,
L2,
R2,
save, save,
new_entry new_entry
}; };
@ -495,10 +501,16 @@ namespace rsx
{ {
texture_resource_files.push_back("fade_top.png"); texture_resource_files.push_back("fade_top.png");
texture_resource_files.push_back("fade_bottom.png"); texture_resource_files.push_back("fade_bottom.png");
texture_resource_files.push_back("select.png");
texture_resource_files.push_back("start.png");
texture_resource_files.push_back("cross.png"); texture_resource_files.push_back("cross.png");
texture_resource_files.push_back("circle.png"); texture_resource_files.push_back("circle.png");
texture_resource_files.push_back("triangle.png"); texture_resource_files.push_back("triangle.png");
texture_resource_files.push_back("square.png"); texture_resource_files.push_back("square.png");
texture_resource_files.push_back("L1.png");
texture_resource_files.push_back("R1.png");
texture_resource_files.push_back("L2.png");
texture_resource_files.push_back("R2.png");
texture_resource_files.push_back("save.png"); texture_resource_files.push_back("save.png");
texture_resource_files.push_back("new.png"); texture_resource_files.push_back("new.png");
} }

View file

@ -105,23 +105,35 @@ namespace rsx
_cell.pos += grid_origin; _cell.pos += grid_origin;
} }
m_btn_shift.set_pos(frame_x + 50, frame_y + frame_h + 10); m_btn_cancel.set_pos(frame_x, frame_y + frame_h + 10);
m_btn_shift.set_size(140, 30);
m_btn_shift.set_text("Shift");
m_btn_shift.set_text_vertical_adjust(5);
m_btn_accept.set_pos(frame_x + 200, frame_y + frame_h + 10);
m_btn_accept.set_size(140, 30);
m_btn_accept.set_text("Accept");
m_btn_accept.set_text_vertical_adjust(5);
m_btn_cancel.set_pos(frame_x + 350, frame_y + frame_h + 10);
m_btn_cancel.set_size(140, 30); m_btn_cancel.set_size(140, 30);
m_btn_cancel.set_text("Cancel"); m_btn_cancel.set_text("Cancel");
m_btn_cancel.set_text_vertical_adjust(5); m_btn_cancel.set_text_vertical_adjust(5);
m_btn_shift.set_image_resource(resource_config::standard_image_resource::triangle); m_btn_space.set_pos(frame_x + 100, frame_y + frame_h + 10);
m_btn_accept.set_image_resource(resource_config::standard_image_resource::square); m_btn_space.set_size(100, 30);
m_btn_space.set_text("Space");
m_btn_space.set_text_vertical_adjust(5);
m_btn_delete.set_pos(frame_x + 200, frame_y + frame_h + 10);
m_btn_delete.set_size(100, 30);
m_btn_delete.set_text("Backspace");
m_btn_delete.set_text_vertical_adjust(5);
m_btn_shift.set_pos(frame_x + 320, frame_y + frame_h + 10);
m_btn_shift.set_size(80, 30);
m_btn_shift.set_text("Shift");
m_btn_shift.set_text_vertical_adjust(5);
m_btn_accept.set_pos(frame_x + 400, frame_y + frame_h + 10);
m_btn_accept.set_size(100, 30);
m_btn_accept.set_text("Accept");
m_btn_accept.set_text_vertical_adjust(5);
m_btn_shift.set_image_resource(resource_config::standard_image_resource::select);
m_btn_accept.set_image_resource(resource_config::standard_image_resource::start);
m_btn_space.set_image_resource(resource_config::standard_image_resource::triangle);
m_btn_delete.set_image_resource(resource_config::standard_image_resource::square);
if (g_cfg.sys.enter_button_assignment == enter_button_assign::circle) if (g_cfg.sys.enter_button_assignment == enter_button_assign::circle)
{ {
@ -274,14 +286,24 @@ namespace rsx
} }
break; break;
} }
case pad_button::select:
{
on_shift("");
break;
}
case pad_button::start:
{
Close(true);
break;
}
case pad_button::triangle: case pad_button::triangle:
{ {
on_shift("Shift"); on_space("");
break; break;
} }
case pad_button::square: case pad_button::square:
{ {
Close(true); on_backspace("");
break; break;
} }
case pad_button::cross: case pad_button::cross:
@ -400,6 +422,8 @@ namespace rsx
m_cached_resource.add(m_btn_accept.get_compiled()); m_cached_resource.add(m_btn_accept.get_compiled());
m_cached_resource.add(m_btn_cancel.get_compiled()); m_cached_resource.add(m_btn_cancel.get_compiled());
m_cached_resource.add(m_btn_shift.get_compiled()); m_cached_resource.add(m_btn_shift.get_compiled());
m_cached_resource.add(m_btn_space.get_compiled());
m_cached_resource.add(m_btn_delete.get_compiled());
overlay_element tmp; overlay_element tmp;
label m_label; label m_label;
@ -488,9 +512,9 @@ namespace rsx
LOG_WARNING(RSX, "Native OSK dialog does not support multiline text!"); LOG_WARNING(RSX, "Native OSK dialog does not support multiline text!");
} }
color4f default_bg = { 0.5f, 0.5f, 0.5f, 1.f }; color4f default_bg = { 0.8f, 0.8f, 0.8f, 1.f };
color4f special_bg = { 0.5f, 0.5f, 0.8f, 1.f }; color4f special_bg = { 0.2f, 0.7f, 0.7f, 1.f };
color4f special2_bg = { 0.8f, 0.8f, 0.5f, 1.f }; color4f special2_bg = { 0.93f, 0.91f, 0.67f, 1.f };
num_rows = 5; num_rows = 5;
num_columns = 10; num_columns = 10;

View file

@ -49,7 +49,7 @@ namespace rsx
std::array<std::chrono::steady_clock::time_point, CELL_PAD_MAX_PORT_NUM> timestamp; std::array<std::chrono::steady_clock::time_point, CELL_PAD_MAX_PORT_NUM> timestamp;
timestamp.fill(std::chrono::steady_clock::now()); timestamp.fill(std::chrono::steady_clock::now());
std::array<std::array<bool, 8>, CELL_PAD_MAX_PORT_NUM> button_state; std::array<std::array<bool, pad_button::pad_button_max_enum>, CELL_PAD_MAX_PORT_NUM> button_state;
for (auto& state : button_state) for (auto& state : button_state)
{ {
state.fill(true); state.fill(true);
@ -105,6 +105,12 @@ namespace rsx
case CELL_PAD_CTRL_UP: case CELL_PAD_CTRL_UP:
button_id = pad_button::dpad_up; button_id = pad_button::dpad_up;
break; break;
case CELL_PAD_CTRL_SELECT:
button_id = pad_button::select;
break;
case CELL_PAD_CTRL_START:
button_id = pad_button::start;
break;
} }
} }
else if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL2) else if (button.m_offset == CELL_PAD_BTN_OFFSET_DIGITAL2)
@ -123,6 +129,12 @@ namespace rsx
case CELL_PAD_CTRL_CROSS: case CELL_PAD_CTRL_CROSS:
button_id = g_cfg.sys.enter_button_assignment == enter_button_assign::circle ? pad_button::circle : pad_button::cross; button_id = g_cfg.sys.enter_button_assignment == enter_button_assign::circle ? pad_button::circle : pad_button::cross;
break; break;
case CELL_PAD_CTRL_L1:
button_id = pad_button::L1;
break;
case CELL_PAD_CTRL_R1:
button_id = pad_button::R1;
break;
} }
} }

View file

@ -62,10 +62,16 @@ namespace rsx
dpad_down, dpad_down,
dpad_left, dpad_left,
dpad_right, dpad_right,
select,
start,
triangle, triangle,
circle, circle,
square, square,
cross cross,
L1,
R1,
pad_button_max_enum
}; };
Timer input_timer; Timer input_timer;
@ -401,6 +407,7 @@ namespace rsx
color4f backcolor{}; color4f backcolor{};
border_flags flags = default_cell; border_flags flags = default_cell;
bool selected = false; bool selected = false;
bool enabled = false;
std::vector<std::string> outputs; std::vector<std::string> outputs;
callback_t callback; callback_t callback;
@ -422,6 +429,8 @@ namespace rsx
image_button m_btn_accept; image_button m_btn_accept;
image_button m_btn_cancel; image_button m_btn_cancel;
image_button m_btn_shift; image_button m_btn_shift;
image_button m_btn_space;
image_button m_btn_delete;
// Grid // Grid
u32 cell_size_x = 0; u32 cell_size_x = 0;