mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- fixed initialization of joystick menu with bogus MENUDEFS
This commit is contained in:
parent
cfeb1724fe
commit
ccb083ed25
4 changed files with 14 additions and 9 deletions
|
@ -138,9 +138,13 @@ DEFINE_ACTION_FUNCTION(IJoystickConfig, GetNumAxes)
|
|||
void UpdateJoystickMenu(IJoystickConfig *selected)
|
||||
{
|
||||
DMenuDescriptor **desc = MenuDescriptors.CheckKey(NAME_JoystickOptions);
|
||||
DMenuDescriptor **ddesc = MenuDescriptors.CheckKey("JoystickOptionsDefaults");
|
||||
if (ddesc == nullptr) return; // without any data the menu cannot be set up and must remain empty.
|
||||
if (desc != NULL && (*desc)->IsKindOf(RUNTIME_CLASS(DOptionMenuDescriptor)))
|
||||
{
|
||||
DOptionMenuDescriptor *opt = (DOptionMenuDescriptor *)*desc;
|
||||
DOptionMenuDescriptor *dopt = (DOptionMenuDescriptor *)*ddesc;
|
||||
if (dopt == nullptr) return;
|
||||
DMenuItemBase *it;
|
||||
|
||||
int i;
|
||||
|
@ -162,11 +166,7 @@ void UpdateJoystickMenu(IJoystickConfig *selected)
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef _WIN32
|
||||
opt->mItems.Resize(8);
|
||||
#else
|
||||
opt->mItems.Resize(5);
|
||||
#endif
|
||||
opt->mItems = dopt->mItems;
|
||||
|
||||
it = opt->GetItem("ConfigureMessage");
|
||||
if (it != nullptr) it->SetValue(0, !!Joysticks.Size());
|
||||
|
|
|
@ -112,7 +112,7 @@ class DMenuDescriptor : public DObject
|
|||
public:
|
||||
FName mMenuName;
|
||||
FString mNetgameMessage;
|
||||
PClass *mClass;
|
||||
PClass *mClass = nullptr;
|
||||
|
||||
virtual size_t PropagateMark() { return 0; }
|
||||
};
|
||||
|
|
|
@ -950,9 +950,9 @@ void M_ParseMenuDefs()
|
|||
}
|
||||
}
|
||||
}
|
||||
DefaultListMenuClass = DefaultListMenuSettings->GetClass();
|
||||
DefaultListMenuClass = DefaultListMenuSettings->mClass;
|
||||
DefaultListMenuSettings = nullptr;
|
||||
DefaultOptionMenuClass = DefaultOptionMenuSettings->GetClass();
|
||||
DefaultOptionMenuClass = DefaultOptionMenuSettings->mClass;
|
||||
DefaultOptionMenuSettings = nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -558,7 +558,7 @@ OptionMenu "MouseOptions"
|
|||
//
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
OptionMenu "JoystickOptions"
|
||||
OptionMenu "JoystickOptionsDefaults"
|
||||
{
|
||||
Title "$JOYMNU_OPTIONS"
|
||||
Option "$JOYMNU_ENABLE", "use_joystick", "YesNo"
|
||||
|
@ -576,6 +576,11 @@ OptionMenu "JoystickOptions"
|
|||
// The rest will be filled in by joystick code if devices get connected or disconnected
|
||||
}
|
||||
|
||||
OptionMenu "JoystickOptions"
|
||||
{
|
||||
Title "$JOYMNU_OPTIONS"
|
||||
}
|
||||
|
||||
OptionValue "JoyAxisMapNames"
|
||||
{
|
||||
-1, "$OPTVAL_NONE"
|
||||
|
|
Loading…
Reference in a new issue