mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 09:35:09 +02:00
Remove the UI::EventReturn return values. Makes editing the UI nicer.
This commit is contained in:
+16
-28
@@ -65,11 +65,11 @@ public:
|
||||
private:
|
||||
void Refresh();
|
||||
|
||||
UI::EventReturn OnAdd(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnAddMouse(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnDelete(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnReplace(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnReplaceAll(UI::EventParams ¶ms);
|
||||
void OnAdd(UI::EventParams ¶ms);
|
||||
void OnAddMouse(UI::EventParams ¶ms);
|
||||
void OnDelete(UI::EventParams ¶ms);
|
||||
void OnReplace(UI::EventParams ¶ms);
|
||||
void OnReplaceAll(UI::EventParams ¶ms);
|
||||
|
||||
void MappedCallback(const MultiInputMapping &kdf);
|
||||
|
||||
@@ -201,32 +201,28 @@ void SingleControlMapper::MappedCallback(const MultiInputMapping &kdf) {
|
||||
g_IsMappingMouseInput = false;
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnReplace(UI::EventParams ¶ms) {
|
||||
void SingleControlMapper::OnReplace(UI::EventParams ¶ms) {
|
||||
actionIndex_ = atoi(params.v->Tag().c_str());
|
||||
action_ = REPLACEONE;
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnReplaceAll(UI::EventParams ¶ms) {
|
||||
void SingleControlMapper::OnReplaceAll(UI::EventParams ¶ms) {
|
||||
action_ = REPLACEALL;
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnAdd(UI::EventParams ¶ms) {
|
||||
void SingleControlMapper::OnAdd(UI::EventParams ¶ms) {
|
||||
action_ = ADD;
|
||||
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
UI::EventReturn SingleControlMapper::OnAddMouse(UI::EventParams ¶ms) {
|
||||
void SingleControlMapper::OnAddMouse(UI::EventParams ¶ms) {
|
||||
action_ = ADD;
|
||||
g_IsMappingMouseInput = true;
|
||||
scrm_->push(new KeyMappingNewMouseKeyDialog(pspKey_, true, std::bind(&SingleControlMapper::MappedCallback, this, std::placeholders::_1), I18NCat::KEYMAPPING));
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn SingleControlMapper::OnDelete(UI::EventParams ¶ms) {
|
||||
void SingleControlMapper::OnDelete(UI::EventParams ¶ms) {
|
||||
int index = atoi(params.v->Tag().c_str());
|
||||
KeyMap::DeleteNthMapping(pspKey_, index);
|
||||
|
||||
@@ -234,7 +230,6 @@ UI::EventReturn SingleControlMapper::OnDelete(UI::EventParams ¶ms) {
|
||||
rows_[index]->SetFocus();
|
||||
else
|
||||
SetFocus();
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -263,11 +258,9 @@ void ControlMappingScreen::CreateViews() {
|
||||
LinearLayout *leftColumn = new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(200, FILL_PARENT, Margins(10, 0, 0, 10)));
|
||||
leftColumn->Add(new Choice(km->T("Clear All")))->OnClick.Add([](UI::EventParams &) {
|
||||
KeyMap::ClearAllMappings();
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
leftColumn->Add(new Choice(km->T("Default All")))->OnClick.Add([](UI::EventParams &) {
|
||||
KeyMap::RestoreDefault();
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
std::string sysName = System_GetProperty(SYSPROP_NAME);
|
||||
// If there's a builtin controller, restore to default should suffice. No need to conf the controller on top.
|
||||
@@ -277,7 +270,6 @@ void ControlMappingScreen::CreateViews() {
|
||||
|
||||
leftColumn->Add(new Choice(km->T("Show PSP")))->OnClick.Add([=](UI::EventParams &) {
|
||||
screenManager()->push(new VisualMappingScreen(gamePath_));
|
||||
return UI::EVENT_DONE;
|
||||
});
|
||||
leftColumn->Add(new CheckBox(&g_Config.bAllowMappingCombos, km->T("Allow combo mappings")));
|
||||
leftColumn->Add(new CheckBox(&g_Config.bStrictComboOrder, km->T("Strict combo input order")));
|
||||
@@ -330,7 +322,7 @@ void ControlMappingScreen::update() {
|
||||
SetVRAppMode(VRAppMode::VR_MENU_MODE);
|
||||
}
|
||||
|
||||
UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams ¶ms) {
|
||||
void ControlMappingScreen::OnAutoConfigure(UI::EventParams ¶ms) {
|
||||
std::vector<std::string> items;
|
||||
const auto seenPads = KeyMap::GetSeenPads();
|
||||
for (auto s = seenPads.begin(), end = seenPads.end(); s != end; ++s) {
|
||||
@@ -341,7 +333,6 @@ UI::EventReturn ControlMappingScreen::OnAutoConfigure(UI::EventParams ¶ms) {
|
||||
if (params.v)
|
||||
autoConfList->SetPopupOrigin(params.v);
|
||||
screenManager()->push(autoConfList);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
void ControlMappingScreen::dialogFinished(const Screen *dialog, DialogResult result) {
|
||||
@@ -599,13 +590,12 @@ void AnalogSetupScreen::CreateViews() {
|
||||
AddStandardBack(leftColumn);
|
||||
}
|
||||
|
||||
UI::EventReturn AnalogSetupScreen::OnResetToDefaults(UI::EventParams &e) {
|
||||
void AnalogSetupScreen::OnResetToDefaults(UI::EventParams &e) {
|
||||
g_Config.fAnalogDeadzone = 0.15f;
|
||||
g_Config.fAnalogInverseDeadzone = 0.0f;
|
||||
g_Config.fAnalogSensitivity = 1.1f;
|
||||
g_Config.bAnalogIsCircular = false;
|
||||
g_Config.fAnalogAutoRotSpeed = 8.0f;
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
class Backplate : public UI::InertView {
|
||||
@@ -793,7 +783,7 @@ private:
|
||||
UI::AnchorLayoutParams *LayoutSize(float w, float h, float l, float t);
|
||||
MockButton *AddButton(int button, ImageID img, ImageID bg, float angle, UI::LayoutParams *lp);
|
||||
|
||||
UI::EventReturn OnSelectButton(UI::EventParams &e);
|
||||
void OnSelectButton(UI::EventParams &e);
|
||||
|
||||
std::unordered_map<int, MockButton *> buttons_;
|
||||
UI::TextView *labelView_ = nullptr;
|
||||
@@ -890,7 +880,7 @@ MockButton *MockPSP::AddButton(int button, ImageID img, ImageID bg, float angle,
|
||||
return view;
|
||||
}
|
||||
|
||||
UI::EventReturn MockPSP::OnSelectButton(UI::EventParams &e) {
|
||||
void MockPSP::OnSelectButton(UI::EventParams &e) {
|
||||
auto view = (MockButton *)e.v;
|
||||
e.a = view->Button();
|
||||
return ButtonClick.Dispatch(e);
|
||||
@@ -992,17 +982,15 @@ void VisualMappingScreen::resized() {
|
||||
RecreateViews();
|
||||
}
|
||||
|
||||
UI::EventReturn VisualMappingScreen::OnMapButton(UI::EventParams &e) {
|
||||
void VisualMappingScreen::OnMapButton(UI::EventParams &e) {
|
||||
nextKey_ = e.a;
|
||||
MapNext(false);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
UI::EventReturn VisualMappingScreen::OnBindAll(UI::EventParams &e) {
|
||||
void VisualMappingScreen::OnBindAll(UI::EventParams &e) {
|
||||
bindAll_ = 0;
|
||||
nextKey_ = bindAllOrder[bindAll_];
|
||||
MapNext(false);
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
void VisualMappingScreen::HandleKeyMapping(const KeyMap::MultiInputMapping &key) {
|
||||
|
||||
Reference in New Issue
Block a user