2017-02-03 23:19:25 +00:00
|
|
|
|
|
|
|
class Menu : Object native
|
|
|
|
{
|
2017-02-10 10:44:46 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2017-02-03 23:19:25 +00:00
|
|
|
//native static int MenuTime();
|
2017-02-09 19:18:53 +00:00
|
|
|
|
|
|
|
native virtual bool MenuEvent (int mkey, bool fromcontroller);
|
2017-02-10 10:44:46 +00:00
|
|
|
native virtual bool MouseEvent(int type, int mx, int my);
|
2017-02-10 12:20:19 +00:00
|
|
|
native virtual void Drawer();
|
2017-02-09 19:18:53 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2017-02-09 23:25:50 +00:00
|
|
|
// making this virtual now would require exporting all classes at once.
|
|
|
|
native /*virtual*/ bool MenuEvent (int mkey, bool fromcontroller);
|
2017-02-09 19:18:53 +00:00
|
|
|
|
2017-02-03 23:19:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct FOptionMenuSettings
|
|
|
|
{
|
|
|
|
int mTitleColor;
|
|
|
|
int mFontColor;
|
|
|
|
int mFontColorValue;
|
|
|
|
int mFontColorMore;
|
|
|
|
int mFontColorHeader;
|
|
|
|
int mFontColorHighlight;
|
|
|
|
int mFontColorSelection;
|
|
|
|
int mLinespacing;
|
|
|
|
}
|
2017-02-09 19:18:53 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|