guiGameListMenuCtrl.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _GuiGameListMenuCtrl_H_
  23. #define _GuiGameListMenuCtrl_H_
  24. #include "gui/core/guiControl.h"
  25. #include "gui/controls/guiBitmapCtrl.h"
  26. class GuiGameListMenuProfile;
  27. /// \class GuiGameListMenuCtrl
  28. /// A base class for cross platform menu controls that are gamepad friendly.
  29. class GuiGameListMenuCtrl : public GuiControl
  30. {
  31. public:
  32. typedef GuiControl Parent;
  33. typedef GuiGameListMenuProfile Profile;
  34. protected:
  35. /// \struct OptionEntry
  36. /// Display text and ID key for each entry in an option row.
  37. struct OptionEntry
  38. {
  39. StringTableEntry mDisplayText; ///< The text that is displayed for the option
  40. StringTableEntry mKeyString; ///< Key value that is associated with this option
  41. OptionEntry() : mDisplayText(StringTable->EmptyString()), mKeyString(StringTable->EmptyString()) {}
  42. virtual ~OptionEntry() {}
  43. };
  44. /// \struct Row
  45. /// Internal data representation of a single row in the control.
  46. struct Row
  47. {
  48. StringTableEntry mLabel; ///< Text to display in the row as a label
  49. StringTableEntry mScriptCallback; ///< Script callback when row is activated
  50. StringTableEntry mTooltip; ///< A descriptive tooltip message for what the row is
  51. S32 mIconIndex; ///< Index of the icon to display on the row (-1 = no icon)
  52. S32 mHeightPad; ///< Extra amount to pad above this row
  53. bool mUseHighlightIcon; ///< Toggle the use of the highlight icon
  54. bool mEnabled; ///< If this row is enabled or not (grayed out)
  55. enum Mode
  56. {
  57. Default = 0,
  58. OptionList,
  59. Slider,
  60. Keybind
  61. };
  62. Mode mMode;
  63. //List options
  64. Vector<OptionEntry> mOptions; ///< Collection of options available to display
  65. S32 mSelectedOption; ///< Index into mOptions pointing at the selected option
  66. bool mWrapOptions; ///< Determines if options should "wrap around" at the ends
  67. //Slider option
  68. F32 mValue; ///< When working as a slider, this contains the value
  69. F32 mStepSize; ///< When working as a slider, this is the increment levels in the range
  70. Point2F mRange; ///< When working as a slider, this sets our min/max range
  71. //Keybind option
  72. StringTableEntry mBitmap;
  73. GFXTexHandle mBitmapTex;
  74. Row() : mLabel(StringTable->EmptyString()), mScriptCallback(StringTable->EmptyString()), mTooltip(StringTable->EmptyString()), mIconIndex(-1), mHeightPad(0), mUseHighlightIcon(false), mEnabled(true),
  75. mSelectedOption(0), mWrapOptions(false), mMode(Mode::Default), mValue(0), mStepSize(1), mRange(Point2F(0, 1)), mBitmap(StringTable->EmptyString()), mBitmapTex(nullptr)
  76. {
  77. VECTOR_SET_ASSOCIATION(mOptions);
  78. }
  79. virtual ~Row() {}
  80. };
  81. public:
  82. /// \return The index of the highlighted row or NO_ROW if none of the rows
  83. /// are currently highlighted.
  84. virtual S32 getHighlighted() const { return mHighlighted; }
  85. /// \return The index of the selected row or NO_ROW if none of the rows are
  86. /// currently selected.
  87. virtual S32 getSelected() const { return mSelected; }
  88. /// Sets the selected row. Only rows that are enabled can be selected. Input is
  89. /// clamped to [0, mRows.size())
  90. ///
  91. /// \param index The index to set as selected.
  92. virtual void setSelected(S32 index);
  93. /// Determines if the specified row is enabled or disabled.
  94. ///
  95. /// \param index Index of the row to check.
  96. /// \return True if the specified row is enabled. False if the row is not
  97. /// enabled or the given index was not valid.
  98. virtual bool isRowEnabled(S32 index) const;
  99. /// Sets a row's enabled status according to the given parameters.
  100. ///
  101. /// \param index The row to set the enabled status of.
  102. /// \param enabled Indicate true to enable the row or false to disable it.
  103. virtual void setRowEnabled(S32 index, bool enabled);
  104. /// Gets the label displayed on the specified row.
  105. ///
  106. /// \param rowIndex Index of the row to get the label of.
  107. /// \return The label for the row.
  108. virtual StringTableEntry getRowLabel(S32 rowIndex) const;
  109. /// Sets the label on the given row.
  110. ///
  111. /// \param rowIndex Index of the row to set the label on.
  112. /// \param label Text to set as the label of the row.
  113. virtual void setRowLabel(S32 rowIndex, const char * label);
  114. /// Adds a row to the control.
  115. ///
  116. /// \param label The text to display on the row as a label.
  117. /// \param callback Name of a script function to use as a callback when this
  118. /// row is activated.
  119. /// \param icon [optional] Index of the icon to use as a marker. Default -1
  120. /// means no icon will be shown on this row.
  121. /// \param yPad [optional] An extra amount of height padding before the row.
  122. /// \param enabled [optional] If this row is initially enabled. Default true.
  123. virtual void addRow(const char* label, const char* callback, S32 icon = -1, S32 yPad = 0, bool useHighlightIcon = true, bool enabled = true, S32 mode = 0, const char* tooltip = "");
  124. /// Adds a row to the control.
  125. ///
  126. /// \param label The text to display on the row as a label.
  127. /// \param optionsList A tab separated list of options for the control.
  128. /// \param wrapOptions Specify true to allow options to wrap at the ends or
  129. /// false to prevent wrapping.
  130. /// \param callback [optional] Name of a script function to use as a callback
  131. /// when this row is activated. Default NULL means no callback.
  132. /// \param icon [optional] Index of the icon to use as a marker. Default -1
  133. /// means no icon will be shown on this row.
  134. /// \param yPad [optional] An extra amount of height padding before the row.
  135. /// \param enabled [optional] If this row is initially enabled. Default true.
  136. void addRow(const char* label, const char* optionsList, bool wrapOptions, const char* callback, S32 icon, S32 yPad, bool enabled, const char* tooltip = "", const char* defaultValue = "");
  137. /// Adds a row to the control.
  138. ///
  139. /// \param label The text to display on the row as a label.
  140. /// \param defaultValue A float indicating the slider's default value
  141. /// \param increments A float indicating the incremental values the slider snaps along between it's range
  142. /// \param range A Point2F that indicates the minimum and maximum value range
  143. /// \param callback [optional] Name of a script function to use as a callback
  144. /// when this row is activated. Default NULL means no callback.
  145. /// \param icon [optional] Index of the icon to use as a marker. Default -1
  146. /// means no icon will be shown on this row.
  147. /// \param yPad [optional] An extra amount of height padding before the row.
  148. /// \param enabled [optional] If this row is initially enabled. Default true.
  149. void addRow(const char* label, F32 defaultValue, F32 increments, Point2F range, const char* callback, S32 icon, S32 yPad, bool enabled, const char* tooltip = "");
  150. void addRow(const char* label, const char* bitmapName, const char* callback, S32 icon, S32 yPad, bool enabled, const char* tooltip);
  151. //Removes row at the provided index
  152. void removeRow(const S32& row);
  153. /// Gets the text for the currently selected option of the given row.
  154. ///
  155. /// \param rowIndex Index of the row to get the option from.
  156. /// \return A string representing the text currently displayed as the selected
  157. /// option on the given row. If there is no such displayed text then the empty
  158. /// string is returned.
  159. StringTableEntry getCurrentOption(S32 rowIndex) const;
  160. /// Gets the key string for the currently selected option of the given row
  161. ///
  162. /// \param rowIndex Index of the row to get the option from.
  163. /// \return The key (or id) that was assigned to the selected option on the
  164. /// given row. If there is no selected option then the empty string is returned.
  165. StringTableEntry getCurrentOptionKey(S32 rowIndex) const;
  166. /// Gets the index into the option list for the currently selected option of the given row.
  167. ///
  168. /// \param rowIndex Index of the row to get the option from.
  169. /// \return The index of the selected option on the given row. If there is no
  170. /// selected option then -1 is returned.
  171. S32 getCurrentOptionIndex(S32 rowIndex) const;
  172. /// Attempts to set the given row to the specified selected option. The option
  173. /// will only be set if the option exists in the control.
  174. ///
  175. /// \param rowIndex Index of the row to set an option on.
  176. /// \param option The option to be made active.
  177. /// \return True if the row contained the option and was set, false otherwise.
  178. bool selectOption(S32 rowIndex, const char* option);
  179. /// Attempts to set the given row to the option with the specified key. The
  180. /// option will only be set if the key exists in the control.
  181. ///
  182. /// \param rowIndex Index of the row to set an option on.
  183. /// \param optionKey The key string that was assigned to the option to be made active.
  184. /// \return True if the row contained the key and the option and was set, false otherwise.
  185. bool selectOptionByKey(S32 rowIndex, const char* optionKey);
  186. /// Attempts to set the given row to the option at the specified index. The option
  187. /// will only be set if the index is valid.
  188. ///
  189. /// \param rowIndex Index of the row to set an option on.
  190. /// \param optionIndex The index of the option to be made active.
  191. /// \return True if the index was valid and the option and was set, false otherwise.
  192. bool selectOptionByIndex(S32 rowIndex, S32 optionIndex);
  193. /// Sets the list of options on the given row.
  194. ///
  195. /// \param rowIndex Index of the row to set options on.
  196. /// \param optionsList A tab separated list of options for the control.
  197. void setOptions(S32 rowIndex, const char* optionsList);
  198. /// Adds an option to the list of options on the given row.
  199. ///
  200. /// \param rowIndex Index of the row to set options on.
  201. /// \param displayText The text to display for this option.
  202. /// \param keyText The id string to associate with this value. If NULL the
  203. /// id will be the same as the display text.
  204. void addOption(S32 rowIndex, const char* displayText, const char* keyText);
  205. /// Activates the current row. The script callback of the current row will
  206. /// be called (if it has one).
  207. virtual void activateRow();
  208. /// Gets the number of rows in the control.
  209. ///
  210. /// \return The number of rows in this control.
  211. virtual S32 getRowCount() const { return mRows.size(); }
  212. /// Gets the value of a row
  213. ///
  214. /// \param rowIndex Index of the row to get the value of.
  215. F32 getValue(S32 rowIndex);
  216. /// Sets the value of a row
  217. ///
  218. /// \param rowIndex Index of the row to set the value of.
  219. /// \param value The new value to be set.
  220. void setValue(S32 rowIndex, F32 value);
  221. /// Gets the tooltip of a row
  222. ///
  223. /// \param rowIndex Index of the row to get the tooltip of.
  224. const char* getTooltip(S32 rowIndex);
  225. GuiGameListMenuCtrl();
  226. ~GuiGameListMenuCtrl();
  227. void onRender(Point2I offset, const RectI &updateRect);
  228. void onRenderListOption(Row* row, Point2I currentOffset);
  229. void onRenderSliderOption(Row* row, Point2I currentOffset);
  230. void onRenderKeybindOption(Row* row, Point2I currentOffset);
  231. /// Callback when the object is registered with the sim.
  232. ///
  233. /// \return True if the profile was successfully added, false otherwise.
  234. bool onAdd();
  235. /// Callback when the control wakes up.
  236. bool onWake();
  237. /// Callback when a key is pressed.
  238. ///
  239. /// \param event The event that triggered this callback.
  240. bool onKeyDown(const GuiEvent &event);
  241. /// Callback when a key is repeating.
  242. ///
  243. /// \param event The event that triggered this callback.
  244. bool onKeyRepeat(const GuiEvent &event){ return onKeyDown(event); }
  245. /// Callback when the mouse button is clicked on the control.
  246. ///
  247. /// \param event A reference to the event that triggered the callback.
  248. void onMouseDown(const GuiEvent &event);
  249. /// Callback when the mouse is dragged on the control.
  250. ///
  251. /// \param event A reference to the event that triggered the callback.
  252. void onMouseDragged(const GuiEvent &event){ onMouseDown(event); }
  253. /// Callback when the mouse leaves the control.
  254. ///
  255. /// \param event A reference to the event that triggered the callback.
  256. void onMouseLeave(const GuiEvent &event);
  257. /// Callback when the mouse is moving over this control
  258. ///
  259. /// \param event A reference to the event that triggered the callback.
  260. void onMouseMove(const GuiEvent &event);
  261. /// Callback when the mouse button is released.
  262. ///
  263. /// \param event A reference to the event that triggered the callback.
  264. void onMouseUp(const GuiEvent &event);
  265. virtual bool onInputEvent(const InputEventInfo& event);
  266. /// Callback when the gamepad axis is activated.
  267. ///
  268. /// \param event A reference to the event that triggered the callback.
  269. virtual bool onGamepadAxisUp(const GuiEvent & event);
  270. /// Callback when the gamepad axis is activated.
  271. ///
  272. /// \param event A reference to the event that triggered the callback.
  273. virtual bool onGamepadAxisDown(const GuiEvent & event);
  274. /// Callback when the gamepad axis is activated.
  275. ///
  276. /// \param event A reference to the event that triggered the callback.
  277. virtual bool onGamepadAxisLeft(const GuiEvent& event);
  278. /// Callback when the gamepad axis is activated.
  279. ///
  280. /// \param event A reference to the event that triggered the callback.
  281. virtual bool onGamepadAxisRight(const GuiEvent& event);
  282. void clearRows();
  283. void refresh();
  284. RectI getRowBounds(S32 rowIndex);
  285. DECLARE_CONOBJECT(GuiGameListMenuCtrl);
  286. DECLARE_CATEGORY( "Gui Game" );
  287. DECLARE_DESCRIPTION( "Base class for cross platform menu controls that are gamepad friendly." );
  288. /// Initializes fields accessible through the console.
  289. static void initPersistFields();
  290. static const S32 NO_ROW = -1; ///< Indicates a query result of no row found.
  291. static const S32 NO_ICON = -1; ///< Indicates a row has no extra icon available
  292. static const S32 NO_OPTION = -1; ///< Indicates there is no option
  293. protected:
  294. /// Adds a row to the control.
  295. ///
  296. /// \param row A reference to the row object to fill.
  297. /// \param label The text to display on the row as a label.
  298. /// \param callback Name of a script function to use as a callback when this
  299. /// row is activated.
  300. /// \param icon [optional] Index of the icon to use as a marker. Default -1
  301. /// means no icon will be shown on this row.
  302. /// \param yPad [optional] An extra amount of height padding before the row.
  303. /// \param enabled [optional] If this row is initially enabled. Default true.
  304. virtual void addRow(Row * row, const char* label, const char* callback, S32 icon, S32 yPad, bool useHighlightIcon, bool enabled, S32 mode = 0, const char* tooltip = "");
  305. /// Determines if the given index is a valid row index. Any index pointing at
  306. /// an existing row is valid.
  307. ///
  308. /// \param index The index to check for validity.
  309. /// \return True if the index points at a valid row, false otherwise.
  310. virtual bool isValidRowIndex(S32 index) const;
  311. /// Sets the script variable $ThisControl to reflect this control.
  312. virtual void setThisControl();
  313. /// Called to implement debug rendering which displays colored lines to
  314. /// provide visual feedback on extents and hit zones.
  315. virtual void onDebugRender(Point2I offset);
  316. /// Looks up the row having a hit area at the given global point.
  317. ///
  318. /// \param globalPoint The point we want to check for hitting a row.
  319. /// \return The index of the hit row or NO_ROW if no row was hit.
  320. virtual S32 getRow(Point2I globalPoint);
  321. /// Checks to make sure our control has a profile of the correct type.
  322. ///
  323. /// \return True if the profile is of type GuiGameListMenuProfile or false if
  324. /// the profile is of any other type.
  325. virtual bool hasValidProfile() const;
  326. /// Enforces the validity of the fields on this control and its profile (if
  327. /// the profile is valid, see: hasValidProfile).
  328. virtual void enforceConstraints();
  329. /// @name Callbacks
  330. /// @{
  331. DECLARE_CALLBACK( void, onChange, () );
  332. DECLARE_CALLBACK(void, onInputEvent, (const char* device, const char* action, bool state));
  333. DECLARE_CALLBACK(void, onAxisEvent, (const char* device, const char* action, F32 axisValue));
  334. /// @}
  335. /// Evaluates some script. If the command is empty then nothing is evaluated.
  336. ///
  337. /// \param command The script to evaluate.
  338. void doScriptCommand(StringTableEntry command);
  339. StringTableEntry mCallbackOnA; ///< Script callback when the 'A' button is pressed
  340. StringTableEntry mCallbackOnB; ///< Script callback when the 'B' button is pressed
  341. StringTableEntry mCallbackOnX; ///< Script callback when the 'X' button is pressed
  342. StringTableEntry mCallbackOnY; ///< Script callback when the 'Y' button is pressed
  343. bool mDebugRender; ///< Determines when to show debug render lines
  344. Vector<Row *> mRows; ///< Holds data wrappers on all the rows we have
  345. private:
  346. /// Performs a click on the current option row. The x position is used to
  347. /// determine if the left or right arrow were clicked. If one was clicked, the
  348. /// option will be changed. If neither was clicked, the option is unaffected.
  349. /// This method should only be called when there is an actively selected row.
  350. ///
  351. /// \param row The row to perform the click on.
  352. /// \param xPos The x position of the the click, relative to the control.
  353. void clickOption(Row* row, S32 xPos);
  354. /// Changes the option on the currently selected row. If there is no row
  355. /// selected, this method does nothing.
  356. ///
  357. /// \param delta The amount to change the option selection by. Typically this
  358. /// will be 1 or -1.
  359. void changeOption(S32 delta);
  360. /// Changes the option on the given row.
  361. ///
  362. /// \param row The row to change the option on.
  363. /// \param delta The amount to change the option selection by. Typically this
  364. /// will be 1 or -1.
  365. void changeOption(Row* row, S32 delta);
  366. /// Performs a click on the current slider row. The x position is used to
  367. /// determine if the left or right arrow were clicked, or if it landed somewhere on the sliderbar.
  368. /// If one was clicked, the option will be changed. If neither was clicked, the option is unaffected.
  369. /// This method should only be called when there is an actively selected row.
  370. ///
  371. /// \param row The row to perform the click on.
  372. /// \param xPos The x position of the the click, relative to the control.
  373. void clickSlider(Row* row, S32 xPos);
  374. void clickKeybind(Row* row, S32 xPos);
  375. private:
  376. /// Recalculates the height of this control based on the stored row height and
  377. /// and padding on the rows.
  378. virtual Point2I getMinExtent() const;
  379. /// Makes sure the height will allow all rows to be displayed without being
  380. /// truncated.
  381. void updateHeight();
  382. /// Sets the first enabled row as selected. If there are no enabled rows then
  383. /// selected will be set to NO_ROW.
  384. void selectFirstEnabledRow();
  385. /// Changes the currently selected row.
  386. ///
  387. /// \param delta The amount to change the row selection by. Typically this will
  388. /// be 1 or -1.
  389. void changeRow(S32 delta);
  390. S32 mSelected; ///< index of the currently selected row
  391. S32 mHighlighted; ///< index of the currently highlighted row
  392. bool mCallbackOnInputs;
  393. bool mConsumeKeyInputEvents;
  394. };
  395. /// \class GuiGameListMenuProfile
  396. /// A gui profile with additional fields specific to GuiGameListMenuCtrl.
  397. class GuiGameListMenuProfile : public GuiControlProfile
  398. {
  399. typedef GuiControlProfile Parent;
  400. public:
  401. /// Enforces range constraints on all required fields.
  402. virtual void enforceConstraints();
  403. /// Get the height of rows in this profile. All rows are considered to be the
  404. /// same base height. Rows can have an extra amount of y padding defined when
  405. /// they are added to the control.
  406. ///
  407. /// \return The height of rows in this profile.
  408. S32 getRowHeight() { return (mRowSize.y) ? mRowSize.y : getBitmapArrayRect(TEX_NORMAL).extent.y; }
  409. /// Get the width of rows in this profile. All rows are considered to be the
  410. /// same width.
  411. ///
  412. /// \return The width of rows in this profile.
  413. S32 getRowWidth() { return (mRowSize.x) ? mRowSize.x : getBitmapArrayRect(TEX_NORMAL).extent.x; }
  414. /// Row scale is the ratio between the defined row size and the raw size of
  415. /// the bitmap.
  416. ///
  417. /// \return The row scale.
  418. const Point2F & getRowScale() const { return mRowScale; }
  419. /// Gets the extent of icons for this profile. If there are no icons you will
  420. /// get a point of (0, 0);
  421. ///
  422. /// \return The extent of icons or (0, 0) if there aren't any.
  423. Point2I getIconExtent();
  424. /// Gets the extent of arrows for this profile. If there are no arrows you
  425. /// will get a point of (0, 0).
  426. ///
  427. /// \return The extent of icons or (0, 0) if there aren't any.
  428. Point2I getArrowExtent();
  429. /// Gets the extent of the defined hit area for this profile. If the hit area
  430. /// is not defined then it defaults to the full size of a row.
  431. ///
  432. /// \return The extents of the defined hit area or the full size of the row.
  433. Point2I getHitAreaExtent();
  434. /// Determines if this profile has textures for the left and right arrows.
  435. ///
  436. /// \return True if the profile's bitmap has textures for the arrows, false
  437. /// otherwise.
  438. bool hasArrows(){ return (! getBitmapArrayRect(TEX_FIRST_ARROW).extent.isZero()); }
  439. /// Callback when the object is registered with the sim.
  440. ///
  441. /// \return True if the profile was successfully added, false otherwise.
  442. bool onAdd();
  443. Point2I mHitAreaUpperLeft; ///< Offset for the upper left corner of the hit area
  444. Point2I mHitAreaLowerRight; ///< Offset for the lower right corner of the hit area
  445. Point2I mIconOffset; ///< Offset for a row's extra icon
  446. Point2I mRowSize; ///< The base size of a row
  447. S32 mColumnSplit; ///< Absolute position of the split between columns
  448. S32 mRightPad; ///< Extra padding between the right arrow and the hit area
  449. GuiGameListMenuProfile();
  450. DECLARE_CONOBJECT(GuiGameListMenuProfile);
  451. /// Initializes fields accessible through the console.
  452. static void initPersistFields();
  453. enum
  454. {
  455. TEX_NORMAL = 0, ///< texture index for a normal, unselected row
  456. TEX_SELECTED = 1, ///< texture index for a selected row
  457. TEX_HIGHLIGHT = 2, ///< texture index for a highlighted row (moused over, not selected)
  458. TEX_DISABLED = 3, ///< texture index for a disabled row
  459. TEX_L_ARROW_OFF = 4, ///< texture index for the left arrow of an unselected row
  460. TEX_L_ARROW_ON = 5, ///< texture index for the left arrow of a selected row
  461. TEX_R_ARROW_OFF = 6, ///< texture index for the right arrow of an unselected row
  462. TEX_R_ARROW_ON = 7, ///< texture index for the right arrow of a selected row
  463. TEX_FIRST_ARROW = 4, ///< texture index for the first arrow
  464. TEX_FIRST_ICON = 8, ///< texture index for the first row marker icon
  465. };
  466. private:
  467. Point2F mRowScale; ///< Ratio of row size to actual bitmap size
  468. };
  469. #endif