mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 13:30:02 +00:00
Make Toggle All actually function.
This commit is contained in:
parent
c5c0945559
commit
d099692ed0
@ -192,16 +192,16 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename)
|
||||
IniFile::Section *control = iniFile.GetOrCreateSection("Control");
|
||||
control->Get("HapticFeedback", &bHapticFeedback, true);
|
||||
control->Get("ShowAnalogStick", &bShowTouchAnalogStick, true);
|
||||
control->Get("ShowTouchCross", bShowTouchCross);
|
||||
control->Get("ShowTouchCircle", bShowTouchCircle);
|
||||
control->Get("ShowTouchSquare", bShowTouchSquare);
|
||||
control->Get("ShowTouchTriangle", bShowTouchTriangle);
|
||||
control->Get("ShowTouchStart", bShowTouchStart);
|
||||
control->Get("ShowTouchSelect", bShowTouchSelect);
|
||||
control->Get("ShowTouchLTrigger", bShowTouchLTrigger);
|
||||
control->Get("ShowTouchRTrigger", bShowTouchRTrigger);
|
||||
control->Get("ShowAnalogStick", bShowTouchAnalogStick);
|
||||
control->Get("ShowTouchUnthrottle", bShowTouchUnthrottle);
|
||||
control->Get("ShowTouchCross", &bShowTouchCross);
|
||||
control->Get("ShowTouchCircle", &bShowTouchCircle);
|
||||
control->Get("ShowTouchSquare", &bShowTouchSquare);
|
||||
control->Get("ShowTouchTriangle", &bShowTouchTriangle);
|
||||
control->Get("ShowTouchStart", &bShowTouchStart);
|
||||
control->Get("ShowTouchSelect", &bShowTouchSelect);
|
||||
control->Get("ShowTouchLTrigger", &bShowTouchLTrigger);
|
||||
control->Get("ShowTouchRTrigger", &bShowTouchRTrigger);
|
||||
control->Get("ShowAnalogStick", &bShowTouchAnalogStick);
|
||||
control->Get("ShowTouchUnthrottle", &bShowTouchUnthrottle);
|
||||
|
||||
#if defined(USING_GLES2)
|
||||
std::string name = System_GetProperty(SYSPROP_NAME);
|
||||
@ -391,7 +391,6 @@ void Config::Save() {
|
||||
|
||||
IniFile::Section *control = iniFile.GetOrCreateSection("Control");
|
||||
control->Set("HapticFeedback", bHapticFeedback);
|
||||
|
||||
control->Set("ShowTouchControls", bShowTouchControls);
|
||||
control->Set("ShowTouchCross", bShowTouchCross);
|
||||
control->Set("ShowTouchCircle", bShowTouchCircle);
|
||||
|
@ -217,7 +217,6 @@ void GameSettingsScreen::CreateViews() {
|
||||
controlsSettings->Add(new Choice("Control Visibility..."))->OnClick.Handle(this, &GameSettingsScreen::OnTouchControlVisibility);
|
||||
controlsSettings->Add(new PopupSliderChoice(&g_Config.iTouchButtonOpacity, 0, 100, c->T("Button Opacity"), screenManager()));
|
||||
controlsSettings->Add(new PopupSliderChoiceFloat(&g_Config.fButtonScale, 0.80, 2.0, c->T("Button Scaling"), screenManager()));
|
||||
controlsSettings->Add(new Choice("Control Visibility..."))->OnClick.Handle(this, &GameSettingsScreen::OnTouchControlVisibility);
|
||||
|
||||
// System
|
||||
ViewGroup *systemSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
|
||||
|
@ -433,12 +433,16 @@ UI::ViewGroup *CreatePadLayout(bool *pause) {
|
||||
|
||||
float scale = g_Config.fButtonScale;
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
|
||||
#if USE_PAUSE_BUTTON
|
||||
root->Add(new BoolButton(pause, I_ROUND, I_ARROW, scale, new AnchorLayoutParams(halfW, 20, NONE, NONE, true)))->SetAngle(90);
|
||||
#endif
|
||||
|
||||
=======
|
||||
=======
|
||||
|
||||
>>>>>>> 4936897... Make Toggle All actually function.
|
||||
if (g_Config.bShowTouchCircle)
|
||||
>>>>>>> 86338a5... Add a touch control visibility screen. All touch controls can now be toggled on or off, except for the Pause button on platforms that have it, as a safety precaution.
|
||||
root->Add(new PSPButton(CTRL_CIRCLE, I_ROUND, I_CIRCLE, scale, new AnchorLayoutParams(Action_circle_button_X, Action_circle_button_Y, NONE, NONE, true)));
|
||||
|
@ -272,7 +272,7 @@ void TouchControlLayoutScreen::CreateViews() {
|
||||
rbutton->FlipImageH(true);
|
||||
controls_.push_back(rbutton);
|
||||
|
||||
if (g_Config.bShowAnalogStick) {
|
||||
if (g_Config.bShowTouchAnalogStick) {
|
||||
controls_.push_back(new DragDropButton(g_Config.iAnalogStickX, g_Config.iAnalogStickY, I_STICKBG, I_STICK, scale));
|
||||
};
|
||||
I18NCategory *ms = GetI18NCategory("MainSettings");
|
||||
|
@ -23,10 +23,6 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
TouchControlVisibilityScreen::TouchControlVisibilityScreen() {
|
||||
|
||||
}
|
||||
|
||||
void TouchControlVisibilityScreen::CreateViews() {
|
||||
using namespace UI;
|
||||
|
||||
@ -58,7 +54,6 @@ void TouchControlVisibilityScreen::CreateViews() {
|
||||
keyImages["L"] = I_L;
|
||||
keyImages["R"] = I_R;
|
||||
|
||||
std::map<std::string, bool*> keyToggles;
|
||||
keyToggles["Circle"] = &g_Config.bShowTouchCircle;
|
||||
keyToggles["Cross"] = &g_Config.bShowTouchCross;
|
||||
keyToggles["Square"] = &g_Config.bShowTouchSquare;
|
||||
@ -98,5 +93,8 @@ UI::EventReturn TouchControlVisibilityScreen::OnBack(UI::EventParams &e) {
|
||||
}
|
||||
|
||||
UI::EventReturn TouchControlVisibilityScreen::OnToggleAll(UI::EventParams &e) {
|
||||
for (auto i = keyToggles.begin(); i != keyToggles.end(); ++i)
|
||||
*i->second = !*i->second;
|
||||
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
class TouchControlVisibilityScreen : public UIScreenWithBackground {
|
||||
public:
|
||||
TouchControlVisibilityScreen();
|
||||
TouchControlVisibilityScreen::TouchControlVisibilityScreen() { }
|
||||
|
||||
virtual void CreateViews();
|
||||
|
||||
@ -33,7 +33,5 @@ protected:
|
||||
virtual UI::EventReturn OnToggleAll(UI::EventParams &e);
|
||||
|
||||
private:
|
||||
//DragDropButton *pickedControl_;
|
||||
//std::vector<DragDropButton *> controls_;
|
||||
//DragDropButton *getPickedControl(const int x, const int y);
|
||||
std::map<std::string, bool*> keyToggles;
|
||||
};
|
Loading…
Reference in New Issue
Block a user