mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-01 03:32:07 +00:00
cellSaveData/overlays: initialize with focused entry
This commit is contained in:
parent
b3c1759853
commit
2d29a33ea8
@ -1168,7 +1168,7 @@ namespace rsx
|
||||
std::unique_ptr<overlay_element> m_highlight_box;
|
||||
|
||||
u16 m_elements_height = 0;
|
||||
s16 m_selected_entry = -1;
|
||||
s32 m_selected_entry = -1;
|
||||
u16 m_elements_count = 0;
|
||||
|
||||
bool m_cancel_only = false;
|
||||
@ -1178,6 +1178,7 @@ namespace rsx
|
||||
|
||||
void update_selection();
|
||||
|
||||
void select_entry(s32 entry);
|
||||
void select_next(u16 count = 1);
|
||||
void select_previous(u16 count = 1);
|
||||
|
||||
|
@ -91,24 +91,25 @@ namespace rsx
|
||||
refresh();
|
||||
}
|
||||
|
||||
void list_view::select_next(u16 count)
|
||||
void list_view::select_entry(s32 entry)
|
||||
{
|
||||
const int max_entry = m_elements_count - 1;
|
||||
const s32 max_entry = m_elements_count - 1;
|
||||
|
||||
if (m_selected_entry < max_entry)
|
||||
if (m_selected_entry != entry)
|
||||
{
|
||||
m_selected_entry = std::min(m_selected_entry + count, max_entry);
|
||||
m_selected_entry = std::max(0, std::min(entry, max_entry));
|
||||
update_selection();
|
||||
}
|
||||
}
|
||||
|
||||
void list_view::select_next(u16 count)
|
||||
{
|
||||
select_entry(m_selected_entry + count);
|
||||
}
|
||||
|
||||
void list_view::select_previous(u16 count)
|
||||
{
|
||||
if (m_selected_entry > 0)
|
||||
{
|
||||
m_selected_entry = std::max(0, m_selected_entry - count);
|
||||
update_selection();
|
||||
}
|
||||
select_entry(m_selected_entry - count);
|
||||
}
|
||||
|
||||
void list_view::add_entry(std::unique_ptr<overlay_element>& entry)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "overlays.h"
|
||||
|
||||
namespace rsx
|
||||
@ -154,7 +154,7 @@ namespace rsx
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 save_dialog::show(std::vector<SaveDataEntry>& save_entries, u32 op, vm::ptr<CellSaveDataListSet> listSet)
|
||||
s32 save_dialog::show(std::vector<SaveDataEntry>& save_entries, u32 focused, u32 op, vm::ptr<CellSaveDataListSet> listSet)
|
||||
{
|
||||
std::vector<u8> icon;
|
||||
std::vector<std::unique_ptr<overlay_element>> entries;
|
||||
@ -241,6 +241,8 @@ namespace rsx
|
||||
m_list->set_cancel_only(true);
|
||||
}
|
||||
|
||||
m_list->select_entry(focused);
|
||||
|
||||
static_cast<label*>(m_description.get())->auto_resize();
|
||||
|
||||
if (auto err = run_input_loop())
|
||||
|
@ -515,7 +515,7 @@ namespace rsx
|
||||
|
||||
compiled_resource get_compiled() override;
|
||||
|
||||
s32 show(std::vector<SaveDataEntry>& save_entries, u32 op, vm::ptr<CellSaveDataListSet> listSet);
|
||||
s32 show(std::vector<SaveDataEntry>& save_entries, u32 focused, u32 op, vm::ptr<CellSaveDataListSet> listSet);
|
||||
};
|
||||
|
||||
struct message_dialog : public user_interface
|
||||
|
@ -9,7 +9,7 @@ s32 save_data_dialog::ShowSaveDataList(std::vector<SaveDataEntry>& save_entries,
|
||||
// TODO: Install native shell as an Emu callback
|
||||
if (auto manager = fxm::get<rsx::overlays::display_manager>())
|
||||
{
|
||||
auto result = manager->create<rsx::overlays::save_dialog>()->show(save_entries, op, listSet);
|
||||
auto result = manager->create<rsx::overlays::save_dialog>()->show(save_entries, focused, op, listSet);
|
||||
if (result != rsx::overlays::user_interface::selection_code::error)
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user