mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-30 07:31:12 +00:00
115 lines
2.1 KiB
Text
115 lines
2.1 KiB
Text
|
|
class Menu : Object native
|
|
{
|
|
enum EMenuKey
|
|
{
|
|
MKEY_Up,
|
|
MKEY_Down,
|
|
MKEY_Left,
|
|
MKEY_Right,
|
|
MKEY_PageUp,
|
|
MKEY_PageDown,
|
|
MKEY_Enter,
|
|
MKEY_Back,
|
|
MKEY_Clear,
|
|
NUM_MKEYS,
|
|
|
|
// These are not buttons but events sent from other menus
|
|
|
|
MKEY_Input,
|
|
MKEY_Abort,
|
|
MKEY_MBYes,
|
|
MKEY_MBNo,
|
|
}
|
|
|
|
enum EMenuMouse
|
|
{
|
|
MOUSE_Click,
|
|
MOUSE_Move,
|
|
MOUSE_Release
|
|
};
|
|
|
|
//native static int MenuTime();
|
|
|
|
native virtual bool MenuEvent (int mkey, bool fromcontroller);
|
|
native virtual bool MouseEvent(int type, int mx, int my);
|
|
native virtual void Drawer();
|
|
|
|
void MenuSound(Sound snd)
|
|
{
|
|
S_Sound (snd, CHAN_VOICE | CHAN_UI, snd_menuvolume, ATTN_NONE);
|
|
}
|
|
|
|
}
|
|
|
|
class MenuDescriptor : Object native
|
|
{
|
|
native Name mMenuName;
|
|
native String mNetgameMessage;
|
|
native Class<Menu> mClass;
|
|
}
|
|
|
|
class MenuItemBase : object native
|
|
{
|
|
native int mXpos, mYpos;
|
|
native Name mAction;
|
|
native bool mEnabled;
|
|
|
|
// making this virtual now would require exporting all classes at once.
|
|
native /*virtual*/ bool MenuEvent (int mkey, bool fromcontroller);
|
|
|
|
}
|
|
|
|
struct FOptionMenuSettings
|
|
{
|
|
int mTitleColor;
|
|
int mFontColor;
|
|
int mFontColorValue;
|
|
int mFontColorMore;
|
|
int mFontColorHeader;
|
|
int mFontColorHighlight;
|
|
int mFontColorSelection;
|
|
int mLinespacing;
|
|
}
|
|
|
|
class OptionMenuDescriptor : MenuDescriptor native
|
|
{
|
|
native Array<OptionMenuItem> mItems;
|
|
native String mTitle;
|
|
native int mSelectedItem;
|
|
native int mDrawTop;
|
|
native int mScrollTop;
|
|
native int mScrollPos;
|
|
native int mIndent;
|
|
native int mPosition;
|
|
native bool mDontDim;
|
|
|
|
//native void CalcIndent();
|
|
//native OptionMenuItem GetItem(Name iname);
|
|
void Reset()
|
|
{
|
|
// Reset the default settings (ignore all other values in the struct)
|
|
mPosition = 0;
|
|
mScrollTop = 0;
|
|
mIndent = 0;
|
|
mDontDim = 0;
|
|
}
|
|
}
|
|
|
|
class OptionMenuItem : MenuItemBase native
|
|
{
|
|
native String mLabel;
|
|
native bool mCentered;
|
|
|
|
//native void drawLabel(int indent, int y, EColorRange color, bool grayed = false);
|
|
}
|
|
|
|
class OptionMenu : Menu native
|
|
{
|
|
native bool CanScrollUp;
|
|
native bool CanScrollDown;
|
|
native int VisBottom;
|
|
native OptionMenuItem mFocusControl;
|
|
native OptionMenuDescriptor mDesc;
|
|
}
|
|
|