Merge pull request #316 from Areloch/UpdatedWindowsSettingsOptions

Updated version of OTHGMars' updated window and resolution options modes.
This commit is contained in:
Brian Roberts 2020-09-20 16:02:35 -05:00 committed by GitHub
commit add299e1b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 559 additions and 152 deletions

View file

@ -533,6 +533,14 @@ void GuiGameListMenuCtrl::addRow(const char* label, const char* bitmapName, cons
addRow(row, label, callback, icon, yPad, true, enabled, Row::Mode::Keybind, tooltip);
}
void GuiGameListMenuCtrl::removeRow(const S32& row)
{
if (row == -1 || row >= mRows.size())
return;
mRows.erase(row);
}
Point2I GuiGameListMenuCtrl::getMinExtent() const
{
Point2I parentMin = Parent::getMinExtent();
@ -1521,6 +1529,12 @@ DefineEngineMethod(GuiGameListMenuCtrl, addKeybindRow, void,
object->addRow(label, bitmapName, callback, icon, yPad, enabled, tooltip);
}
DefineEngineMethod(GuiGameListMenuCtrl, removeRow, void, (S32 row),,
"Removes the row at the provided index")
{
object->removeRow(row);
}
DefineEngineMethod(GuiGameListMenuCtrl, getCurrentOption, const char*, (S32 row), ,
"Gets the text for the currently selected option of the given row.\n\n"
"@param row Index of the row to get the option from.\n"

View file

@ -163,6 +163,9 @@ public:
void addRow(const char* label, const char* bitmapName, const char* callback, S32 icon, S32 yPad, bool enabled, const char* tooltip);
//Removes row at the provided index
void GuiGameListMenuCtrl::removeRow(const S32& row);
/// Gets the text for the currently selected option of the given row.
///
/// \param rowIndex Index of the row to get the option from.