Make Toggle All actually function.

This commit is contained in:
The Dax 2013-10-19 23:14:51 -04:00
parent c5c0945559
commit d099692ed0
6 changed files with 23 additions and 25 deletions

View File

@ -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);

View File

@ -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));

View File

@ -286,7 +286,7 @@ void InitPadLayout() {
int Action_button_center_X = dp_xres - Action_button_spacing * 2;
int Action_button_center_Y = dp_yres - Action_button_spacing * 2;
if(g_Config.iActionButtonCenterX == -1 || g_Config.iActionButtonCenterY == -1 ){
if(g_Config.iActionButtonCenterX == -1 || g_Config.iActionButtonCenterY == -1 ) {
//setup defaults
g_Config.iActionButtonCenterX = Action_button_center_X;
g_Config.iActionButtonCenterY = Action_button_center_Y;
@ -297,7 +297,7 @@ void InitPadLayout() {
//radius to the D-pad
const int D_pad_Radius = 40 * scale;
if (g_Config.iDpadRadius == -1){
if (g_Config.iDpadRadius == -1) {
g_Config.iDpadRadius = D_pad_Radius;
}
@ -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)));

View File

@ -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");

View File

@ -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;
}

View File

@ -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;
};