minor UI update to Power-on options dialog

This commit is contained in:
Thomas Jentzsch 2022-12-16 09:07:18 +01:00
parent 47a6b1de32
commit e1ef0045ac
4 changed files with 17 additions and 22 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -4204,11 +4204,11 @@
<tr><td>TV type</td><td>-tv</td></tr> <tr><td>TV type</td><td>-tv</td></tr>
<tr><td>Left difficulty</td><td>-ld</td></tr> <tr><td>Left difficulty</td><td>-ld</td></tr>
<tr><td>Right difficulty</td><td>-rd</td></tr> <tr><td>Right difficulty</td><td>-rd</td></tr>
<tr><td>Startup mode</td><td>-debug</td></tr>
<tr><td>Left joy items</td><td>-holdjoy0</td></tr> <tr><td>Left joy items</td><td>-holdjoy0</td></tr>
<tr><td>Right joy items</td><td>-holdjoy1</td></tr> <tr><td>Right joy items</td><td>-holdjoy1</td></tr>
<tr><td>Console: Select</td><td>-holdselect</td></tr> <tr><td>Console: Select</td><td>-holdselect</td></tr>
<tr><td>Console: Reset</td><td>-holdreset</td></tr> <tr><td>Console: Reset</td><td>-holdreset</td></tr>
<tr><td>Start in Debugger mode</td><td>-debug</td></tr>
</table> </table>
<p></p> <p></p>
</td> </td>

View File

@ -93,18 +93,6 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
wid.push_back(myRightDiff); wid.push_back(myRightDiff);
ypos += lineHeight + VGAP * 3; ypos += lineHeight + VGAP * 3;
// Start in debugger mode
new StaticTextWidget(this, font, xpos, ypos+1, "Startup mode");
items.clear();
VarList::push_back(items, "Console", "false");
#ifdef DEBUGGER_SUPPORT
VarList::push_back(items, "Debugger", "true");
#endif
myDebug = new PopUpWidget(this, font, xpos+lwidth, ypos,
pwidth, lineHeight, items, "");
wid.push_back(myDebug);
ypos += lineHeight + VGAP * 3;
// Start console with buttons held down // Start console with buttons held down
new StaticTextWidget(this, font, xpos, ypos+1, new StaticTextWidget(this, font, xpos, ypos+1,
"Start with the following held down:"); "Start with the following held down:");
@ -114,10 +102,17 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
// Start with console joystick direction/buttons held down // Start with console joystick direction/buttons held down
xpos = fontWidth * 4; ypos += infofont.getLineHeight() + VGAP * 2; xpos = fontWidth * 4; ypos += infofont.getLineHeight() + VGAP * 2;
addHoldWidgets(font, xpos, ypos, wid); ypos = addHoldWidgets(font, xpos, ypos, wid) + VGAP * 4;
xpos = HBORDER;
// Start in debugger mode
myDebug = new CheckboxWidget(this, font, xpos, ypos, "Start in Debugger mode");
#ifndef DEBUGGER_SUPPORT
myDebug->setEnabled(false);
#endif
wid.push_back(myDebug);
// Add message concerning usage // Add message concerning usage
xpos = HBORDER;
ypos = _h - VBORDER - buttonHeight - VGAP * 3 - infofont.getLineHeight() * 2; ypos = _h - VBORDER - buttonHeight - VGAP * 3 - infofont.getLineHeight() * 2;
new StaticTextWidget(this, infofont, xpos, ypos, new StaticTextWidget(this, infofont, xpos, ypos,
"(*) These options are not saved, but apply to all"); "(*) These options are not saved, but apply to all");
@ -157,7 +152,6 @@ int GlobalPropsDialog::addHoldWidgets(const GUI::Font& font, int x, int y,
ypos += myJoy[kJ0Down]->getHeight() * 2 + VGAP * 2; ypos += myJoy[kJ0Down]->getHeight() * 2 + VGAP * 2;
myJoy[kJ0Fire] = new CheckboxWidget(this, font, xpos, ypos, "Fire", kJ0Fire); myJoy[kJ0Fire] = new CheckboxWidget(this, font, xpos, ypos, "Fire", kJ0Fire);
const int final_y = ypos;
xpos = _w / 3; ypos = y; xpos = _w / 3; ypos = y;
// Right joystick // Right joystick
@ -194,7 +188,7 @@ int GlobalPropsDialog::addHoldWidgets(const GUI::Font& font, int x, int y,
wid.push_back(myHoldSelect); wid.push_back(myHoldSelect);
wid.push_back(myHoldReset); wid.push_back(myHoldReset);
return final_y; return myJoy[kJ0Fire]->getBottom();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -206,7 +200,6 @@ void GlobalPropsDialog::loadConfig()
myLeftDiff->setSelected(settings.getString("ld"), "DEFAULT"); myLeftDiff->setSelected(settings.getString("ld"), "DEFAULT");
myRightDiff->setSelected(settings.getString("rd"), "DEFAULT"); myRightDiff->setSelected(settings.getString("rd"), "DEFAULT");
myTVType->setSelected(settings.getString("tv"), "DEFAULT"); myTVType->setSelected(settings.getString("tv"), "DEFAULT");
myDebug->setSelected(settings.getBool("debug") ? "true" : "false");
const string& holdjoy0 = settings.getString("holdjoy0"); const string& holdjoy0 = settings.getString("holdjoy0");
for(int i = kJ0Up; i <= kJ0Fire; ++i) for(int i = kJ0Up; i <= kJ0Fire; ++i)
@ -217,6 +210,7 @@ void GlobalPropsDialog::loadConfig()
myHoldSelect->setState(settings.getBool("holdselect")); myHoldSelect->setState(settings.getBool("holdselect"));
myHoldReset->setState(settings.getBool("holdreset")); myHoldReset->setState(settings.getBool("holdreset"));
myDebug->setState(settings.getBool("debug"));
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -241,8 +235,6 @@ void GlobalPropsDialog::saveConfig()
if(s == "DEFAULT") s = ""; if(s == "DEFAULT") s = "";
settings.setValue("tv", s); settings.setValue("tv", s);
settings.setValue("debug", myDebug->getSelectedTag().toBool());
s = ""; s = "";
for(int i = kJ0Up; i <= kJ0Fire; ++i) for(int i = kJ0Up; i <= kJ0Fire; ++i)
if(myJoy[i]->getState()) s += ourJoyState[i]; if(myJoy[i]->getState()) s += ourJoyState[i];
@ -254,6 +246,8 @@ void GlobalPropsDialog::saveConfig()
settings.setValue("holdselect", myHoldSelect->getState()); settings.setValue("holdselect", myHoldSelect->getState());
settings.setValue("holdreset", myHoldReset->getState()); settings.setValue("holdreset", myHoldReset->getState());
settings.setValue("debug", myDebug->getState());
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -263,13 +257,14 @@ void GlobalPropsDialog::setDefaults()
myLeftDiff->setSelected("DEFAULT"); myLeftDiff->setSelected("DEFAULT");
myRightDiff->setSelected("DEFAULT"); myRightDiff->setSelected("DEFAULT");
myTVType->setSelected("DEFAULT"); myTVType->setSelected("DEFAULT");
myDebug->setSelected("false");
for(int i = kJ0Up; i <= kJ1Fire; ++i) for(int i = kJ0Up; i <= kJ1Fire; ++i)
myJoy[i]->setState(false); myJoy[i]->setState(false);
myHoldSelect->setState(false); myHoldSelect->setState(false);
myHoldReset->setState(false); myHoldReset->setState(false);
myDebug->setState(false);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -52,11 +52,11 @@ class GlobalPropsDialog : public Dialog, public CommandSender
PopUpWidget* myLeftDiff{nullptr}; PopUpWidget* myLeftDiff{nullptr};
PopUpWidget* myRightDiff{nullptr}; PopUpWidget* myRightDiff{nullptr};
PopUpWidget* myTVType{nullptr}; PopUpWidget* myTVType{nullptr};
PopUpWidget* myDebug{nullptr};
std::array<CheckboxWidget*, 10> myJoy{nullptr}; std::array<CheckboxWidget*, 10> myJoy{nullptr};
CheckboxWidget* myHoldSelect{nullptr}; CheckboxWidget* myHoldSelect{nullptr};
CheckboxWidget* myHoldReset{nullptr}; CheckboxWidget* myHoldReset{nullptr};
CheckboxWidget* myDebug{nullptr};
static const std::array<string, 10> ourJoyState; static const std::array<string, 10> ourJoyState;