From e17c20c8e6d5fb3e692f1ac7e8ea2fc1f7e9902d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sat, 30 Mar 2024 18:41:06 +0100 Subject: [PATCH 01/14] Implemented a templated MI_SelectField alternative --- src/common/ui/MI_SelectField.cpp | 317 +++++++++++++++++++++++++++++++ src/common/ui/MI_SelectField.h | 125 ++++++++++++ 2 files changed, 442 insertions(+) diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index db8429d5..b5f9cc0a 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -481,3 +481,320 @@ void MI_SelectField::Refresh() else if (fValue) SetKey(*fValue ? 1 : 0); } + + +template +MI_SelectFieldDyn::MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std::string name, short width, short indent) + : UI_Control(x, y) + , m_spr(nspr) + , m_name(std::move(name)) + , m_adjustmentY(width > 256 ? 0 : 128) + , m_width(width) + , m_indent(indent) +{ + miModifyImageLeft = std::make_unique(nspr, ix + indent - 26, iy + 4, 32, 64, 26, 24, 4, 1, 8); + miModifyImageLeft->Show(false); + + miModifyImageRight = std::make_unique(nspr, ix + width - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); + miModifyImageRight->Show(false); +} + + +template +void MI_SelectFieldDyn::Update() +{ + miModifyImageRight->Update(); + miModifyImageLeft->Update(); +} + + +template +void MI_SelectFieldDyn::Draw() +{ + if (!fShow) + return; + + if (m_indent == 0) { + short iHalfWidth = m_width / 2; + m_spr->draw(ix, iy, 0, (fSelected ? 32 : 0) + m_adjustmentY, iHalfWidth, 32); + m_spr->draw(ix + iHalfWidth, iy, 512 - iHalfWidth, (fSelected ? 32 : 0) + m_adjustmentY, m_width - iHalfWidth, 32); + } else { + m_spr->draw(ix, iy, 0, (fSelected ? 32 : 0) + m_adjustmentY, m_indent - 16, 32); + m_spr->draw(ix + m_indent - 16, iy, 0, (fSelected ? 96 : 64), 32, 32); + m_spr->draw(ix + m_indent + 16, iy, 528 - m_width + m_indent, (fSelected ? 32 : 0) + m_adjustmentY, m_width - m_indent - 16, 32); + } + + if (m_indent> 0) + rm->menu_font_large.drawChopRight(ix + 16, iy + 5, m_indent - 8, m_name.c_str()); + + if (!m_items.empty()) { + const short indent = (m_indent > 0) ? m_indent : 8; + rm->menu_font_large.drawChopRight(ix + indent + 8, iy + 5, m_width - indent - 24, currentItem().name.c_str()); + } + + const bool drawLeft = m_index > 0; + if (m_wraps || drawLeft) + miModifyImageLeft->Draw(); + + const bool drawRight = (m_index + 1) < m_items.size(); + if (m_wraps || drawRight) + miModifyImageRight->Draw(); +} + + +template +MenuCodeEnum MI_SelectFieldDyn::Modify(bool modify) +{ + if (fDisable) + return MENU_CODE_UNSELECT_ITEM; + + if (m_autoAdvance && modify) { + moveNext(); + return mcItemChangedCode; + } + + if (MENU_CODE_NONE != mcControlSelectedCode) + return mcControlSelectedCode; + + miModifyImageLeft->Show(modify); + miModifyImageRight->Show(modify); + fModifying = modify; + return MENU_CODE_MODIFY_ACCEPTED; +} + + +template +MenuCodeEnum MI_SelectFieldDyn::SendInput(CPlayerInput * playerInput) +{ + for (int iPlayer = 0; iPlayer < 4; iPlayer++) { + short iNumMoves = 1; + if (m_fastScroll && playerInput->outputControls[iPlayer].menu_scrollfast.fDown) + iNumMoves = 10; + + if (playerInput->outputControls[iPlayer].menu_right.fPressed || playerInput->outputControls[iPlayer].menu_down.fPressed) { + bool fMoved = false; + + for (short iMove = 0; iMove < iNumMoves; iMove++) + fMoved |= moveNext(); + + if (fMoved) + return mcItemChangedCode; + } + + if (playerInput->outputControls[iPlayer].menu_left.fPressed || playerInput->outputControls[iPlayer].menu_up.fPressed) { + bool fMoved = false; + + for (short iMove = 0; iMove < iNumMoves; iMove++) + fMoved |= movePrev(); + + if (fMoved) + return mcItemChangedCode; + } + + if (playerInput->outputControls[iPlayer].menu_random.fPressed) { + if (moveRandom()) + return mcItemChangedCode; + } + + if (playerInput->outputControls[iPlayer].menu_select.fPressed || playerInput->outputControls[iPlayer].menu_cancel.fPressed) { + miModifyImageLeft->Show(false); + miModifyImageRight->Show(false); + + fModifying = false; + + updateOutput(); + + return MENU_CODE_UNSELECT_ITEM; + } + } + + return MENU_CODE_NONE; +} + + +template +MenuCodeEnum MI_SelectFieldDyn::MouseClick(short iMouseX, short iMouseY) { + if (fDisable) + return MENU_CODE_NONE; + + //If we are modifying this control, see if we clicked on a next/prev button + if (fModifying) { + short x, y, w, h; + + miModifyImageLeft->GetPositionAndSize(x, y, w, h); + if (x <= iMouseX && iMouseX < x + w && y <= iMouseY && iMouseY < y + h) { + if (movePrev()) { + return mcItemChangedCode == MENU_CODE_NONE + ? MENU_CODE_CLICKED + : mcItemChangedCode; + } + } + + miModifyImageRight->GetPositionAndSize(x, y, w, h); + if (x <= iMouseX && iMouseX < x + w && y <= iMouseY && iMouseY < y + h) { + if (moveNext()) { + return mcItemChangedCode == MENU_CODE_NONE + ? MENU_CODE_CLICKED + : mcItemChangedCode; + } + } + } + + //Otherwise just check to see if we clicked on the whole control + if (ix <= iMouseX && iMouseX < ix + m_width && iy <= iMouseY && iMouseY < iy + 32) + return MENU_CODE_CLICKED; + + //Otherwise this control wasn't clicked at all + return MENU_CODE_NONE; +} + + +template +void MI_SelectFieldDyn::Refresh() +{ + if (m_outputPtr) + setCurrentValue(*m_outputPtr); +} + + +template +bool MI_SelectFieldDyn::setCurrentValue(T value) +{ + for (m_index = 0; m_index < m_items.size(); m_index++) { + if (m_items[m_index].value == value) { + updateOutput(); + return true; + } + } + return false; +} + + +template +bool MI_SelectFieldDyn::setCurrentIndex(size_t index) +{ + if (m_index < m_items.size()) { + m_index = index; + updateOutput(); + return true; + } + return false; +} + + +template +void MI_SelectFieldDyn::updateOutput() const +{ + if (m_outputPtr) + *m_outputPtr = currentValue(); +} + + +template +void MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool goodRandom, short iconOverride) +{ + size_t new_idx = m_items.size(); + m_items.emplace_back(std::move(name), std::move(value), hidden, iconOverride); + m_index = 0; + + if (goodRandom) + m_goodRandomIndices.push_back(new_idx); +} + + +template +void MI_SelectFieldDyn::clear() +{ + m_items.clear(); + m_goodRandomIndices.clear(); +} + + +template +void MI_SelectFieldDyn::hideItem(T value, bool hide) +{ + for (Item& item : m_items) { + if (item.value == value) + item.hidden = hide; + } + if (currentItem().hidden) + moveNext() || movePrev(); +} + + +template +void MI_SelectFieldDyn::hideAllItems(bool hide) +{ + for (Item& item : m_items) { + item.hidden = hide; + } +} + + +template +bool MI_SelectFieldDyn::moveNext() +{ + if (m_items.empty()) + return false; + + // stop when detecting a restart or a loop + const size_t stop_idx = m_wraps ? m_index : 0; + + while (true) { + m_index = (m_index + 1) % m_items.size(); + if (m_index == stop_idx) + break; + if (!currentItem().hidden) { + updateOutput(); + return true; + } + } + + return false; +} + + +template +bool MI_SelectFieldDyn::movePrev() +{ + if (m_items.empty()) + return false; + + // stop when detecting a restart or a loop + const size_t stop_idx = m_wraps ? m_index : (m_items.size() - 1); + + while (true) { + m_index = (m_index + m_items.size() - 1) % m_items.size(); + if (m_index == stop_idx) + break; + if (!currentItem().hidden) { + updateOutput(); + return true; + } + } + + return false; +} + + +template +bool MI_SelectFieldDyn::moveRandom() +{ + std::vector valid_indices; + valid_indices.reserve(m_items.size()); + + for (size_t idx = 0; idx < m_items.size(); idx++) { + if (!m_items[idx].hidden && idx != m_index) + valid_indices.push_back(idx); + } + if (valid_indices.size() <= 1) + return false; + + m_index = valid_indices[RANDOM_INT(valid_indices.size())]; + updateOutput(); + return true; +} + + +// Actual typed classes +template class MI_SelectFieldDyn; diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 2ae0b3d2..2714c32d 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -7,6 +7,7 @@ #include #include +#include #include @@ -186,4 +187,128 @@ class MI_SelectField : public UI_Control bool fFastScroll = false; }; + +template +struct SF_ListItemDyn { + SF_ListItemDyn(std::string&& name, T value, bool hidden, short iconOverride) + : name(std::move(name)) + , value(value) + , hidden(hidden) + , iconOverride(iconOverride) + { + static_assert(std::is_trivially_copyable::value, ""); + } + + /*SF_ListItemDyn(const SF_ListItemDyn& other) + : name(other.name) + , value(other.value) + , hidden(other.hidden) + , iconOverride(other.iconOverride) + {}*/ + + const std::string name; //!< Display name + const T value; + bool hidden = false; + short iconOverride = -1; +}; + + +template +class MI_SelectFieldDyn : public UI_Control { + using Item = SF_ListItemDyn; + +public: + MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std::string name, short width, short indent); + virtual ~MI_SelectFieldDyn() = default; + + //! Set the displayed name. + void setTitle(std::string name) { + m_name = std::move(name); + } + //! When this control is selected, advance the value one instead of modifying the control. + void setAutoAdvance(bool advance) { + m_autoAdvance = advance; + } + void allowWrap(bool wraps) { + m_wraps = wraps; + } + //When the item is changed, this code will be returned from SendInput() + void setItemChangedCode(MenuCodeEnum code) { + mcItemChangedCode = code; + } + void setControlSelectedCode(MenuCodeEnum code) { + mcControlSelectedCode = code; + } + void allowFastScroll(bool fastscroll) { + m_fastScroll = fastscroll; + } + //! Set where the data of this control is written to (some member of game_values probably) + void setOutputPtr(T* ptr) { + m_outputPtr = ptr; + } + + //! Gets the currently selected item + const Item& currentItem() const { + return m_items.at(m_index); + } + //! Gets the currently selected item's value + T currentValue() const { + return currentItem().value; + } + //! Gets a random value, but does not set the control to that value + T randomValue() const { + const size_t idx = m_goodRandomIndices.at(RANDOM_INT(m_goodRandomIndices.size())); + return m_items.at(idx).value; + } + + //! Set the current selected item based on its value + bool setCurrentValue(T value); + //! Sets the currently selected item + bool setCurrentIndex(size_t index); + //! Adds an item to the list + void add(std::string name, T value, bool hidden = false, bool goodRandom = true, short iconOverride = -1); + //! Removes all items + void clear(); + //! Hides the items containing the specified value + void hideItem(T value, bool hide); + //! Hides all items + void hideAllItems(bool hide); + +public: + void Update() override; //! Updates animations or other events every frame + void Draw() override; //! Draws every frame + void Refresh() override; + MenuCodeEnum Modify(bool modify) override; //! Called when user selects this control to change it's value + MenuCodeEnum SendInput(CPlayerInput* playerInput) override; //! Sends player input to control on every frame + MenuCodeEnum MouseClick(short iMouseX, short iMouseY) override; + +protected: + gfxSprite* m_spr = nullptr; + std::string m_name; + + std::unique_ptr miModifyImageLeft; + std::unique_ptr miModifyImageRight; + + MenuCodeEnum mcItemChangedCode = MENU_CODE_NONE; + MenuCodeEnum mcControlSelectedCode = MENU_CODE_NONE; + + bool m_autoAdvance = false; + bool m_wraps = true; + bool m_fastScroll = false; + short m_adjustmentY = 0; + short m_width = 0; + short m_indent = 0; + + std::vector m_items; + std::vector m_goodRandomIndices; + size_t m_index = 0; + T* m_outputPtr = nullptr; + + void updateOutput() const; + bool moveNext(); + bool movePrev(); + bool moveRandom(); +}; + + #endif // UI_SELECT_FIELD_H From cfe34d760c2c36bcd0685d2258f60e3da208bd07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sat, 30 Mar 2024 18:44:18 +0100 Subject: [PATCH 02/14] Use the templated selection field for bools --- src/common/ui/MI_SelectField.h | 6 - src/smw/menu/ModeOptionsMenu.cpp | 210 ++++++++++++++-------------- src/smw/menu/ModeOptionsMenu.h | 31 ++-- src/smw/ui/MI_FrenzyModeOptions.cpp | 14 +- src/smw/ui/MI_FrenzyModeOptions.h | 2 +- 5 files changed, 129 insertions(+), 134 deletions(-) diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 2714c32d..d536ccd0 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -85,17 +85,11 @@ class MI_SelectField : public UI_Control std::string GetStringValue() { return (*current)->sValue; } - bool GetBoolValue() { - return (*current)->fValue; - } //Gets a random value, but does not set the control to that value short GetRandomShortValue() { return goodRandomItems[RANDOM_INT(goodRandomItems.size())]->iValue; } - bool GetRandomBoolValue() { - return goodRandomItems[RANDOM_INT(goodRandomItems.size())]->fValue; - } //sets the currently selected item bool SetKey(short iID); diff --git a/src/smw/menu/ModeOptionsMenu.cpp b/src/smw/menu/ModeOptionsMenu.cpp index 7d742cb6..df09a0a0 100644 --- a/src/smw/menu/ModeOptionsMenu.cpp +++ b/src/smw/menu/ModeOptionsMenu.cpp @@ -177,12 +177,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miJailModeTimeFreeField->SetData(&game_values.gamemodemenusettings.jail.timetofree, NULL, NULL); miJailModeTimeFreeField->SetKey(game_values.gamemodemenusettings.jail.timetofree); - miJailModeTagFreeField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Tag Free", 400, 150); - miJailModeTagFreeField->Add("Off", 0, "", false, false); - miJailModeTagFreeField->Add("On", 1, "", true, false); - miJailModeTagFreeField->SetData(NULL, NULL, &game_values.gamemodemenusettings.jail.tagfree); - miJailModeTagFreeField->SetKey(game_values.gamemodemenusettings.jail.tagfree ? 1 : 0); - miJailModeTagFreeField->SetAutoAdvance(true); + miJailModeTagFreeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Tag Free", 400, 150); + miJailModeTagFreeField->add("Off", false); + miJailModeTagFreeField->add("On", true); + miJailModeTagFreeField->setOutputPtr(&game_values.gamemodemenusettings.jail.tagfree); + miJailModeTagFreeField->setCurrentValue(game_values.gamemodemenusettings.jail.tagfree ? 1 : 0); + miJailModeTagFreeField->setAutoAdvance(true); miJailModeJailKeyField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Jail Key", 400, 150, 384); miJailModeJailKeyField->Add("0", 0, "", false, false, false); @@ -235,12 +235,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Coins Mode Settings //*********************** - miCoinModePenaltyField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Penalty", 400, 150); - miCoinModePenaltyField->Add("Off", 0, "", false, false); - miCoinModePenaltyField->Add("On", 1, "", true, false); - miCoinModePenaltyField->SetData(NULL, NULL, &game_values.gamemodemenusettings.coins.penalty); - miCoinModePenaltyField->SetKey(game_values.gamemodemenusettings.coins.penalty ? 1 : 0); - miCoinModePenaltyField->SetAutoAdvance(true); + miCoinModePenaltyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Penalty", 400, 150); + miCoinModePenaltyField->add("Off", false); + miCoinModePenaltyField->add("On", true); + miCoinModePenaltyField->setOutputPtr(&game_values.gamemodemenusettings.coins.penalty); + miCoinModePenaltyField->setCurrentValue(game_values.gamemodemenusettings.coins.penalty ? 1 : 0); + miCoinModePenaltyField->setAutoAdvance(true); miCoinModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Quantity", 400, 150); miCoinModeQuantityField->Add("1", 1, "", false, false); @@ -451,19 +451,19 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModeSpeedField->SetKey(game_values.gamemodemenusettings.flag.speed); miFlagModeSpeedField->SetNoWrap(true); - miFlagModeTouchReturnField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Touch Return", 400, 180); - miFlagModeTouchReturnField->Add("Off", 0, "", false, false); - miFlagModeTouchReturnField->Add("On", 1, "", true, false); - miFlagModeTouchReturnField->SetData(NULL, NULL, &game_values.gamemodemenusettings.flag.touchreturn); - miFlagModeTouchReturnField->SetKey(game_values.gamemodemenusettings.flag.touchreturn ? 1 : 0); - miFlagModeTouchReturnField->SetAutoAdvance(true); + miFlagModeTouchReturnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Touch Return", 400, 180); + miFlagModeTouchReturnField->add("Off", false); + miFlagModeTouchReturnField->add("On", true); + miFlagModeTouchReturnField->setOutputPtr(&game_values.gamemodemenusettings.flag.touchreturn); + miFlagModeTouchReturnField->setCurrentValue(game_values.gamemodemenusettings.flag.touchreturn ? 1 : 0); + miFlagModeTouchReturnField->setAutoAdvance(true); - miFlagModePointMoveField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Point Move", 400, 180); - miFlagModePointMoveField->Add("Off", 0, "", false, false); - miFlagModePointMoveField->Add("On", 1, "", true, false); - miFlagModePointMoveField->SetData(NULL, NULL, &game_values.gamemodemenusettings.flag.pointmove); - miFlagModePointMoveField->SetKey(game_values.gamemodemenusettings.flag.pointmove ? 1 : 0); - miFlagModePointMoveField->SetAutoAdvance(true); + miFlagModePointMoveField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Point Move", 400, 180); + miFlagModePointMoveField->add("Off", false); + miFlagModePointMoveField->add("On", true); + miFlagModePointMoveField->setOutputPtr(&game_values.gamemodemenusettings.flag.pointmove); + miFlagModePointMoveField->setCurrentValue(game_values.gamemodemenusettings.flag.pointmove ? 1 : 0); + miFlagModePointMoveField->setAutoAdvance(true); miFlagModeAutoReturnField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Auto Return", 400, 180); miFlagModeAutoReturnField->Add("None", 0, "", false, false); @@ -482,19 +482,19 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModeAutoReturnField->SetData(&game_values.gamemodemenusettings.flag.autoreturn, NULL, NULL); miFlagModeAutoReturnField->SetKey(game_values.gamemodemenusettings.flag.autoreturn); - miFlagModeHomeScoreField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Need Home", 400, 180); - miFlagModeHomeScoreField->Add("Off", 0, "", false, false); - miFlagModeHomeScoreField->Add("On", 1, "", true, false); - miFlagModeHomeScoreField->SetData(NULL, NULL, &game_values.gamemodemenusettings.flag.homescore); - miFlagModeHomeScoreField->SetKey(game_values.gamemodemenusettings.flag.homescore ? 1 : 0); - miFlagModeHomeScoreField->SetAutoAdvance(true); + miFlagModeHomeScoreField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Need Home", 400, 180); + miFlagModeHomeScoreField->add("Off", false); + miFlagModeHomeScoreField->add("On", true); + miFlagModeHomeScoreField->setOutputPtr(&game_values.gamemodemenusettings.flag.homescore); + miFlagModeHomeScoreField->setCurrentValue(game_values.gamemodemenusettings.flag.homescore ? 1 : 0); + miFlagModeHomeScoreField->setAutoAdvance(true); - miFlagModeCenterFlagField = new MI_SelectField(&rm->spr_selectfield, 120, 320, "Center Flag", 400, 180); - miFlagModeCenterFlagField->Add("Off", 0, "", false, false); - miFlagModeCenterFlagField->Add("On", 1, "", true, false); - miFlagModeCenterFlagField->SetData(NULL, NULL, &game_values.gamemodemenusettings.flag.centerflag); - miFlagModeCenterFlagField->SetKey(game_values.gamemodemenusettings.flag.centerflag ? 1 : 0); - miFlagModeCenterFlagField->SetAutoAdvance(true); + miFlagModeCenterFlagField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Center Flag", 400, 180); + miFlagModeCenterFlagField->add("Off", false); + miFlagModeCenterFlagField->add("On", true); + miFlagModeCenterFlagField->setOutputPtr(&game_values.gamemodemenusettings.flag.centerflag); + miFlagModeCenterFlagField->setCurrentValue(game_values.gamemodemenusettings.flag.centerflag ? 1 : 0); + miFlagModeCenterFlagField->setAutoAdvance(true); miFlagModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miFlagModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -524,19 +524,19 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Chicken Mode Settings //*********************** - miChickenModeShowTargetField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Show Target", 400, 180); - miChickenModeShowTargetField->Add("Off", 0, "", false, false); - miChickenModeShowTargetField->Add("On", 1, "", true, false); - miChickenModeShowTargetField->SetData(NULL, NULL, &game_values.gamemodemenusettings.chicken.usetarget); - miChickenModeShowTargetField->SetKey(game_values.gamemodemenusettings.chicken.usetarget ? 1 : 0); - miChickenModeShowTargetField->SetAutoAdvance(true); + miChickenModeShowTargetField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Show Target", 400, 180); + miChickenModeShowTargetField->add("Off", false); + miChickenModeShowTargetField->add("On", true); + miChickenModeShowTargetField->setOutputPtr(&game_values.gamemodemenusettings.chicken.usetarget); + miChickenModeShowTargetField->setCurrentValue(game_values.gamemodemenusettings.chicken.usetarget ? 1 : 0); + miChickenModeShowTargetField->setAutoAdvance(true); - miChickenModeGlideField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Chicken Glide", 400, 180); - miChickenModeGlideField->Add("Off", 0, "", false, false); - miChickenModeGlideField->Add("On", 1, "", true, false); - miChickenModeGlideField->SetData(NULL, NULL, &game_values.gamemodemenusettings.chicken.glide); - miChickenModeGlideField->SetKey(game_values.gamemodemenusettings.chicken.glide ? 1 : 0); - miChickenModeGlideField->SetAutoAdvance(true); + miChickenModeGlideField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Chicken Glide", 400, 180); + miChickenModeGlideField->add("Off", false); + miChickenModeGlideField->add("On", true); + miChickenModeGlideField->setOutputPtr(&game_values.gamemodemenusettings.chicken.glide); + miChickenModeGlideField->setCurrentValue(game_values.gamemodemenusettings.chicken.glide ? 1 : 0); + miChickenModeGlideField->setAutoAdvance(true); miChickenModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miChickenModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -562,12 +562,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Tag Mode Settings //*********************** - miTagModeTagOnTouchField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Touch Tag", 400, 180); - miTagModeTagOnTouchField->Add("Off", 0, "", false, false); - miTagModeTagOnTouchField->Add("On", 1, "", true, false); - miTagModeTagOnTouchField->SetData(NULL, NULL, &game_values.gamemodemenusettings.tag.tagontouch); - miTagModeTagOnTouchField->SetKey(game_values.gamemodemenusettings.tag.tagontouch ? 1 : 0); - miTagModeTagOnTouchField->SetAutoAdvance(true); + miTagModeTagOnTouchField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Touch Tag", 400, 180); + miTagModeTagOnTouchField->add("Off", false); + miTagModeTagOnTouchField->add("On", true); + miTagModeTagOnTouchField->setOutputPtr(&game_values.gamemodemenusettings.tag.tagontouch); + miTagModeTagOnTouchField->setCurrentValue(game_values.gamemodemenusettings.tag.tagontouch ? 1 : 0); + miTagModeTagOnTouchField->setAutoAdvance(true); miTagModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miTagModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -712,26 +712,26 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miDominationModeDeathText = new MI_Text("On Death", 120, 210, 0, true, TextAlign::LEFT); - miDominationModeLoseOnDeathField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Lose Bases", 400, 180); - miDominationModeLoseOnDeathField->Add("Off", 0, "", false, false); - miDominationModeLoseOnDeathField->Add("On", 1, "", true, false); - miDominationModeLoseOnDeathField->SetData(NULL, NULL, &game_values.gamemodemenusettings.domination.loseondeath); - miDominationModeLoseOnDeathField->SetKey(game_values.gamemodemenusettings.domination.loseondeath ? 1 : 0); - miDominationModeLoseOnDeathField->SetAutoAdvance(true); + miDominationModeLoseOnDeathField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Lose Bases", 400, 180); + miDominationModeLoseOnDeathField->add("Off", false); + miDominationModeLoseOnDeathField->add("On", true); + miDominationModeLoseOnDeathField->setOutputPtr(&game_values.gamemodemenusettings.domination.loseondeath); + miDominationModeLoseOnDeathField->setCurrentValue(game_values.gamemodemenusettings.domination.loseondeath ? 1 : 0); + miDominationModeLoseOnDeathField->setAutoAdvance(true); - miDominationModeRelocateOnDeathField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Move Bases", 400, 180); - miDominationModeRelocateOnDeathField->Add("Off", 0, "", false, false); - miDominationModeRelocateOnDeathField->Add("On", 1, "", true, false); - miDominationModeRelocateOnDeathField->SetData(NULL, NULL, &game_values.gamemodemenusettings.domination.relocateondeath); - miDominationModeRelocateOnDeathField->SetKey(game_values.gamemodemenusettings.domination.relocateondeath ? 1 : 0); - miDominationModeRelocateOnDeathField->SetAutoAdvance(true); + miDominationModeRelocateOnDeathField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Move Bases", 400, 180); + miDominationModeRelocateOnDeathField->add("Off", false); + miDominationModeRelocateOnDeathField->add("On", true); + miDominationModeRelocateOnDeathField->setOutputPtr(&game_values.gamemodemenusettings.domination.relocateondeath); + miDominationModeRelocateOnDeathField->setCurrentValue(game_values.gamemodemenusettings.domination.relocateondeath ? 1 : 0); + miDominationModeRelocateOnDeathField->setAutoAdvance(true); - miDominationModeStealOnDeathField = new MI_SelectField(&rm->spr_selectfield, 120, 320, "Steal Bases", 400, 180); - miDominationModeStealOnDeathField->Add("Off", 0, "", false, false); - miDominationModeStealOnDeathField->Add("On", 1, "", true, false); - miDominationModeStealOnDeathField->SetData(NULL, NULL, &game_values.gamemodemenusettings.domination.stealondeath); - miDominationModeStealOnDeathField->SetKey(game_values.gamemodemenusettings.domination.stealondeath ? 1 : 0); - miDominationModeStealOnDeathField->SetAutoAdvance(true); + miDominationModeStealOnDeathField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Steal Bases", 400, 180); + miDominationModeStealOnDeathField->add("Off", false); + miDominationModeStealOnDeathField->add("On", true); + miDominationModeStealOnDeathField->setOutputPtr(&game_values.gamemodemenusettings.domination.stealondeath); + miDominationModeStealOnDeathField->setCurrentValue(game_values.gamemodemenusettings.domination.stealondeath ? 1 : 0); + miDominationModeStealOnDeathField->setAutoAdvance(true); miDominationModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); @@ -938,12 +938,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miSurvivalModeSpeedField->SetData(&game_values.gamemodemenusettings.survival.speed, NULL, NULL); miSurvivalModeSpeedField->SetKey(game_values.gamemodemenusettings.survival.speed); - miSurvivalModeShieldField = new MI_SelectField(&rm->spr_selectfield, 120, 320, "Shield", 400, 180); - miSurvivalModeShieldField->Add("Off", 0, "", false, false); - miSurvivalModeShieldField->Add("On", 1, "", true, false); - miSurvivalModeShieldField->SetData(NULL, NULL, &game_values.gamemodemenusettings.survival.shield); - miSurvivalModeShieldField->SetKey(game_values.gamemodemenusettings.survival.shield ? 1 : 0); - miSurvivalModeShieldField->SetAutoAdvance(true); + miSurvivalModeShieldField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Shield", 400, 180); + miSurvivalModeShieldField->add("Off", false); + miSurvivalModeShieldField->add("On", true); + miSurvivalModeShieldField->setOutputPtr(&game_values.gamemodemenusettings.survival.shield); + miSurvivalModeShieldField->setCurrentValue(game_values.gamemodemenusettings.survival.shield ? 1 : 0); + miSurvivalModeShieldField->setAutoAdvance(true); miSurvivalModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miSurvivalModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -991,12 +991,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModeCoinLife->SetData(&game_values.gamemodemenusettings.greed.coinlife, NULL, NULL); miGreedModeCoinLife->SetKey(game_values.gamemodemenusettings.greed.coinlife); - miGreedModeOwnCoins = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Own Coins", 400, 150); - miGreedModeOwnCoins->Add("Yes", 1, "", true, false); - miGreedModeOwnCoins->Add("No", 0, "", false, false); - miGreedModeOwnCoins->SetData(NULL, NULL, &game_values.gamemodemenusettings.greed.owncoins); - miGreedModeOwnCoins->SetKey(game_values.gamemodemenusettings.greed.owncoins); - miGreedModeOwnCoins->SetAutoAdvance(true); + miGreedModeOwnCoins = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Own Coins", 400, 150); + miGreedModeOwnCoins->add("Yes", true); + miGreedModeOwnCoins->add("No", false); + miGreedModeOwnCoins->setOutputPtr(&game_values.gamemodemenusettings.greed.owncoins); + miGreedModeOwnCoins->setCurrentValue(game_values.gamemodemenusettings.greed.owncoins); + miGreedModeOwnCoins->setAutoAdvance(true); miGreedModeMultiplier = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Multipler", 400, 150); miGreedModeMultiplier->Add("0.5", 1, "", false, false, false); @@ -1277,12 +1277,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Shyguy Tag Mode Settings //*********************** - miShyGuyTagModeTagOnSuicideField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Suicide Tag", 400, 180); - miShyGuyTagModeTagOnSuicideField->Add("Off", 0, "", false, false); - miShyGuyTagModeTagOnSuicideField->Add("On", 1, "", true, false); - miShyGuyTagModeTagOnSuicideField->SetData(NULL, NULL, &game_values.gamemodemenusettings.shyguytag.tagonsuicide); - miShyGuyTagModeTagOnSuicideField->SetKey(game_values.gamemodemenusettings.shyguytag.tagonsuicide ? 1 : 0); - miShyGuyTagModeTagOnSuicideField->SetAutoAdvance(true); + miShyGuyTagModeTagOnSuicideField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Suicide Tag", 400, 180); + miShyGuyTagModeTagOnSuicideField->add("Off", false); + miShyGuyTagModeTagOnSuicideField->add("On", true); + miShyGuyTagModeTagOnSuicideField->setOutputPtr(&game_values.gamemodemenusettings.shyguytag.tagonsuicide); + miShyGuyTagModeTagOnSuicideField->setCurrentValue(game_values.gamemodemenusettings.shyguytag.tagonsuicide ? 1 : 0); + miShyGuyTagModeTagOnSuicideField->setAutoAdvance(true); miShyGuyTagModeTagOnStompField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Tag Transfer", 400, 180); miShyGuyTagModeTagOnStompField->Add("Touch Only", 0, "", false, false); @@ -1411,10 +1411,10 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) } else if (iMode == game_mode_jail) { // jail game_values.gamemodesettings.jail.style = miJailModeStyleField->GetRandomShortValue(); game_values.gamemodesettings.jail.timetofree = miJailModeTimeFreeField->GetRandomShortValue(); - game_values.gamemodesettings.jail.tagfree = miJailModeTagFreeField->GetRandomBoolValue(); + game_values.gamemodesettings.jail.tagfree = miJailModeTagFreeField->randomValue(); game_values.gamemodesettings.jail.percentkey = miJailModeJailKeyField->GetRandomShortValue(); } else if (iMode == game_mode_coins) { // coins - game_values.gamemodesettings.coins.penalty = miCoinModePenaltyField->GetRandomBoolValue(); + game_values.gamemodesettings.coins.penalty = miCoinModePenaltyField->randomValue(); game_values.gamemodesettings.coins.quantity = miCoinModeQuantityField->GetRandomShortValue(); game_values.gamemodesettings.coins.percentextracoin = miCoinModePercentExtraCoin->GetRandomShortValue(); } else if (iMode == game_mode_stomp) { // stomp @@ -1432,25 +1432,25 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) game_values.gamemodesettings.egg.explode = miEggModeExplosionTimeField->GetRandomShortValue(); } else if (iMode == game_mode_ctf) { // capture the flag game_values.gamemodesettings.flag.speed = miFlagModeSpeedField->GetRandomShortValue(); - game_values.gamemodesettings.flag.touchreturn = miFlagModeTouchReturnField->GetRandomBoolValue(); - game_values.gamemodesettings.flag.pointmove = miFlagModePointMoveField->GetRandomBoolValue(); + game_values.gamemodesettings.flag.touchreturn = miFlagModeTouchReturnField->randomValue(); + game_values.gamemodesettings.flag.pointmove = miFlagModePointMoveField->randomValue(); game_values.gamemodesettings.flag.autoreturn = miFlagModeAutoReturnField->GetRandomShortValue(); - game_values.gamemodesettings.flag.homescore = miFlagModeHomeScoreField->GetRandomBoolValue(); - game_values.gamemodesettings.flag.centerflag = miFlagModeCenterFlagField->GetRandomBoolValue(); + game_values.gamemodesettings.flag.homescore = miFlagModeHomeScoreField->randomValue(); + game_values.gamemodesettings.flag.centerflag = miFlagModeCenterFlagField->randomValue(); } else if (iMode == game_mode_chicken) { // chicken - game_values.gamemodesettings.chicken.usetarget = miChickenModeShowTargetField->GetRandomBoolValue(); - game_values.gamemodesettings.chicken.glide = miChickenModeGlideField->GetRandomBoolValue(); + game_values.gamemodesettings.chicken.usetarget = miChickenModeShowTargetField->randomValue(); + game_values.gamemodesettings.chicken.glide = miChickenModeGlideField->randomValue(); } else if (iMode == game_mode_tag) { // tag - game_values.gamemodesettings.tag.tagontouch = miTagModeTagOnTouchField->GetRandomBoolValue(); + game_values.gamemodesettings.tag.tagontouch = miTagModeTagOnTouchField->randomValue(); } else if (iMode == game_mode_star) { // star game_values.gamemodesettings.star.time = miStarModeTimeField->GetRandomShortValue(); game_values.gamemodesettings.star.shine = miStarModeShineField->GetRandomShortValue(); game_values.gamemodesettings.star.percentextratime = miStarModePercentExtraTime->GetRandomShortValue(); } else if (iMode == game_mode_domination) { // domination game_values.gamemodesettings.domination.quantity = miDominationModeQuantityField->GetRandomShortValue(); - game_values.gamemodesettings.domination.loseondeath = miDominationModeLoseOnDeathField->GetRandomBoolValue(); - game_values.gamemodesettings.domination.relocateondeath = miDominationModeRelocateOnDeathField->GetRandomBoolValue(); - game_values.gamemodesettings.domination.stealondeath = miDominationModeStealOnDeathField->GetRandomBoolValue(); + game_values.gamemodesettings.domination.loseondeath = miDominationModeLoseOnDeathField->randomValue(); + game_values.gamemodesettings.domination.relocateondeath = miDominationModeRelocateOnDeathField->randomValue(); + game_values.gamemodesettings.domination.stealondeath = miDominationModeStealOnDeathField->randomValue(); game_values.gamemodesettings.domination.relocationfrequency = miDominationModeRelocateFrequencyField->GetRandomShortValue(); } else if (iMode == game_mode_koth) { // king of the hill game_values.gamemodesettings.kingofthehill.areasize = miKingOfTheHillModeSizeField->GetRandomShortValue(); @@ -1465,13 +1465,13 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) } else if (iMode == game_mode_survival) { // survival game_values.gamemodesettings.survival.density = miSurvivalModeDensityField->GetRandomShortValue(); game_values.gamemodesettings.survival.speed = miSurvivalModeSpeedField->GetRandomShortValue(); - game_values.gamemodesettings.survival.shield = miSurvivalModeShieldField->GetRandomBoolValue(); + game_values.gamemodesettings.survival.shield = miSurvivalModeShieldField->randomValue(); for (short iEnemy = 0; iEnemy < NUMSURVIVALENEMIES; iEnemy++) game_values.gamemodesettings.survival.enemyweight[iEnemy] = miSurvivalModeEnemySlider[iEnemy]->GetRandomShortValue(); } else if (iMode == game_mode_greed) { // greed game_values.gamemodesettings.greed.coinlife = miGreedModeCoinLife->GetRandomShortValue(); - game_values.gamemodesettings.greed.owncoins = miGreedModeOwnCoins->GetRandomBoolValue(); + game_values.gamemodesettings.greed.owncoins = miGreedModeOwnCoins->randomValue(); game_values.gamemodesettings.greed.multiplier = miGreedModeMultiplier->GetRandomShortValue(); game_values.gamemodesettings.greed.percentextracoin = miGreedModePercentExtraCoin->GetRandomShortValue(); } else if (iMode == game_mode_health) { // health @@ -1489,7 +1489,7 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) for (short iPhanto = 0; iPhanto < 3; iPhanto++) game_values.gamemodesettings.chase.phantoquantity[iPhanto] = miChaseModeQuantitySlider[iPhanto]->GetRandomShortValue(); } else if (iMode == game_mode_shyguytag) { // shyguy tag - game_values.gamemodesettings.shyguytag.tagonsuicide = miShyGuyTagModeTagOnSuicideField->GetRandomBoolValue(); + game_values.gamemodesettings.shyguytag.tagonsuicide = miShyGuyTagModeTagOnSuicideField->randomValue(); game_values.gamemodesettings.shyguytag.tagtransfer = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); game_values.gamemodesettings.shyguytag.freetime = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); } else if (iMode == game_mode_boss_minigame) { // boss diff --git a/src/smw/menu/ModeOptionsMenu.h b/src/smw/menu/ModeOptionsMenu.h index ec69bc5d..82583306 100644 --- a/src/smw/menu/ModeOptionsMenu.h +++ b/src/smw/menu/ModeOptionsMenu.h @@ -9,6 +9,7 @@ class MI_PowerupSlider; class MI_SelectField; class MI_SliderField; class MI_Text; +template class MI_SelectFieldDyn; class UI_ModeOptionsMenu : public UI_Menu { @@ -66,7 +67,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Jail MI_SelectField* miJailModeStyleField; - MI_SelectField* miJailModeTagFreeField; + MI_SelectFieldDyn* miJailModeTagFreeField; MI_SelectField* miJailModeTimeFreeField; MI_SliderField* miJailModeJailKeyField; MI_Button* miJailModeBackButton; @@ -76,7 +77,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miJailModeHeaderText; // Coins - MI_SelectField* miCoinModePenaltyField; + MI_SelectFieldDyn* miCoinModePenaltyField; MI_SelectField* miCoinModeQuantityField; MI_SelectField* miCoinModePercentExtraCoin; MI_Button* miCoinModeBackButton; @@ -97,11 +98,11 @@ class UI_ModeOptionsMenu : public UI_Menu { // Capture The Flag MI_SliderField* miFlagModeSpeedField; - MI_SelectField* miFlagModeTouchReturnField; - MI_SelectField* miFlagModePointMoveField; + MI_SelectFieldDyn* miFlagModeTouchReturnField; + MI_SelectFieldDyn* miFlagModePointMoveField; MI_SelectField* miFlagModeAutoReturnField; - MI_SelectField* miFlagModeHomeScoreField; - MI_SelectField* miFlagModeCenterFlagField; + MI_SelectFieldDyn* miFlagModeHomeScoreField; + MI_SelectFieldDyn* miFlagModeCenterFlagField; MI_Button* miFlagModeBackButton; MI_Image* miFlagModeLeftHeaderBar; @@ -109,8 +110,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miFlagModeHeaderText; // Chicken - MI_SelectField* miChickenModeShowTargetField; - MI_SelectField* miChickenModeGlideField; + MI_SelectFieldDyn* miChickenModeShowTargetField; + MI_SelectFieldDyn* miChickenModeGlideField; MI_Button* miChickenModeBackButton; MI_Image* miChickenModeLeftHeaderBar; @@ -118,7 +119,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miChickenModeHeaderText; // Tag - MI_SelectField* miTagModeTagOnTouchField; + MI_SelectFieldDyn* miTagModeTagOnTouchField; MI_Button* miTagModeBackButton; MI_Image* miTagModeLeftHeaderBar; @@ -137,9 +138,9 @@ class UI_ModeOptionsMenu : public UI_Menu { // Domination MI_SelectField* miDominationModeQuantityField; - MI_SelectField* miDominationModeLoseOnDeathField; - MI_SelectField* miDominationModeRelocateOnDeathField; - MI_SelectField* miDominationModeStealOnDeathField; + MI_SelectFieldDyn* miDominationModeLoseOnDeathField; + MI_SelectFieldDyn* miDominationModeRelocateOnDeathField; + MI_SelectFieldDyn* miDominationModeStealOnDeathField; MI_SelectField* miDominationModeRelocateFrequencyField; MI_Text* miDominationModeDeathText; @@ -191,7 +192,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_PowerupSlider* miSurvivalModeEnemySlider[NUMSURVIVALENEMIES]; MI_SelectField* miSurvivalModeDensityField; MI_SelectField* miSurvivalModeSpeedField; - MI_SelectField* miSurvivalModeShieldField; + MI_SelectFieldDyn* miSurvivalModeShieldField; MI_Button* miSurvivalModeBackButton; MI_Image* miSurvivalModeLeftHeaderBar; @@ -200,7 +201,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Greed MI_SelectField* miGreedModeCoinLife; - MI_SelectField* miGreedModeOwnCoins; + MI_SelectFieldDyn* miGreedModeOwnCoins; MI_SelectField* miGreedModeMultiplier; MI_SelectField* miGreedModePercentExtraCoin; MI_Button* miGreedModeBackButton; @@ -240,7 +241,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miChaseModeHeaderText; // Shyguy Tag - MI_SelectField* miShyGuyTagModeTagOnSuicideField; + MI_SelectFieldDyn* miShyGuyTagModeTagOnSuicideField; MI_SelectField* miShyGuyTagModeTagOnStompField; MI_SelectField* miShyGuyTagModeFreeTimeField; MI_Button* miShyGuyTagModeBackButton; diff --git a/src/smw/ui/MI_FrenzyModeOptions.cpp b/src/smw/ui/MI_FrenzyModeOptions.cpp index 12aca7a8..4f8e3aa9 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.cpp +++ b/src/smw/ui/MI_FrenzyModeOptions.cpp @@ -58,12 +58,12 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short miRateField->SetData(&game_values.gamemodemenusettings.frenzy.rate, NULL, NULL); miRateField->SetKey(game_values.gamemodemenusettings.frenzy.rate); - miStoredShellsField = new MI_SelectField(&rm->spr_selectfield, 120, 120, "Store Shells", 400, 180); - miStoredShellsField->Add("Off", 0, "", false, false); - miStoredShellsField->Add("On", 1, "", true, false); - miStoredShellsField->SetData(NULL, NULL, &game_values.gamemodemenusettings.frenzy.storedshells); - miStoredShellsField->SetKey(game_values.gamemodemenusettings.frenzy.storedshells ? 1 : 0); - miStoredShellsField->SetAutoAdvance(true); + miStoredShellsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 120, "Store Shells", 400, 180); + miStoredShellsField->add("Off", false); + miStoredShellsField->add("On", true); + miStoredShellsField->setOutputPtr(&game_values.gamemodemenusettings.frenzy.storedshells); + miStoredShellsField->setCurrentValue(game_values.gamemodemenusettings.frenzy.storedshells ? 1 : 0); + miStoredShellsField->setAutoAdvance(true); short iPowerupMap[] = {8, 5, 11, 17, 19, 21, 23, 24, 25, 20, 9, 16, 10, 22, 12, 13, 14, 15, 27}; for (short iPowerup = 0; iPowerup < NUMFRENZYCARDS; iPowerup++) { @@ -240,7 +240,7 @@ void MI_FrenzyModeOptions::SetRandomGameModeSettings() { game_values.gamemodesettings.frenzy.quantity = miQuantityField->GetRandomShortValue(); game_values.gamemodesettings.frenzy.rate = miRateField->GetRandomShortValue(); - game_values.gamemodesettings.frenzy.storedshells = miStoredShellsField->GetRandomBoolValue(); + game_values.gamemodesettings.frenzy.storedshells = miStoredShellsField->randomValue(); for (short iPowerup = 0; iPowerup < NUMFRENZYCARDS; iPowerup++) game_values.gamemodesettings.frenzy.powerupweight[iPowerup] = miPowerupSlider[iPowerup]->GetRandomShortValue(); diff --git a/src/smw/ui/MI_FrenzyModeOptions.h b/src/smw/ui/MI_FrenzyModeOptions.h index 4066784c..a50954ef 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.h +++ b/src/smw/ui/MI_FrenzyModeOptions.h @@ -44,7 +44,7 @@ class MI_FrenzyModeOptions : public UI_Control MI_SelectField * miQuantityField; MI_SelectField * miRateField; - MI_SelectField * miStoredShellsField; + MI_SelectFieldDyn* miStoredShellsField; MI_PowerupSlider * miPowerupSlider[NUMFRENZYCARDS]; MI_Button * miBackButton; From 17be6c94f8a947140eb1619976cf7d7db8b388df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sat, 30 Mar 2024 19:04:20 +0100 Subject: [PATCH 03/14] Removed string and bool support from the old MI_SelectField --- src/common/ui/MI_SelectField.cpp | 15 +- src/common/ui/MI_SelectField.h | 23 +- src/smw/menu/MatchSelectionMenu.cpp | 38 +- src/smw/menu/ModeOptionsMenu.cpp | 916 +++++++++--------- src/smw/menu/options/EyeCandyOptionsMenu.cpp | 34 +- src/smw/menu/options/GameplayOptionsMenu.cpp | 160 +-- src/smw/menu/options/GraphicsOptionsMenu.cpp | 56 +- src/smw/menu/options/PowerupSettingsMenu.cpp | 76 +- src/smw/menu/options/ProjectileLimitsMenu.cpp | 216 ++--- .../menu/options/ProjectileOptionsMenu.cpp | 248 ++--- src/smw/menu/options/SoundOptionsMenu.cpp | 38 +- src/smw/menu/options/TeamOptionsMenu.cpp | 24 +- src/smw/menu/xbox/ScreenSettingsMenu.cpp | 30 +- src/smw/ui/MI_FrenzyModeOptions.cpp | 42 +- src/smw/ui/MI_InputControlContainer.cpp | 2 +- src/smw/ui/MI_PowerupSelection.cpp | 42 +- src/worldeditor/worldeditor.cpp | 38 +- 17 files changed, 990 insertions(+), 1008 deletions(-) diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index b5f9cc0a..b7046253 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -114,9 +114,14 @@ bool MI_SelectField::SetIndex(unsigned short index) return true; } -void MI_SelectField::Add(std::string name, short ivalue, std::string svalue, bool fvalue, bool fhidden, bool fGoodRandom, short iIconOverride) +void MI_SelectField::Add(std::string name, short ivalue) { - SF_ListItem * item = new SF_ListItem(name, ivalue, svalue, fvalue, fhidden, iIconOverride); + Add(std::move(name), ivalue, false); +} + +void MI_SelectField::Add(std::string name, short ivalue, bool fhidden, bool fGoodRandom, short iIconOverride) +{ + SF_ListItem * item = new SF_ListItem(name, ivalue, fhidden, iIconOverride); items.push_back(item); if (fGoodRandom) @@ -306,12 +311,6 @@ void MI_SelectField::SetValues() { if (iValue) *iValue = (*current)->iValue; - - if (sValue) - *sValue = (*current)->sValue; - - if (fValue) - *fValue = (*current)->fValue; } bool MI_SelectField::MoveNext() diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index d536ccd0..2f59e71a 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -18,31 +18,21 @@ class SF_ListItem public: SF_ListItem() { sName = ""; - iValue = 0; - sValue = ""; - fValue = false; fHidden = false; iIconOverride = -1; } - SF_ListItem(std::string sname, short ivalue, std::string svalue, bool fvalue, bool fhidden, short iiconoverride) { + SF_ListItem(std::string sname, short ivalue, bool fhidden, short iiconoverride) { sName = sname; - iValue = ivalue; - sValue = svalue; - fValue = fvalue; fHidden = fhidden; iIconOverride = iiconoverride; } SF_ListItem(const SF_ListItem& other) { sName = other.sName; - iValue = other.iValue; - sValue = other.sValue; - fValue = other.fValue; - fHidden = other.fHidden; iIconOverride = other.iIconOverride; } @@ -50,13 +40,8 @@ class SF_ListItem ~SF_ListItem() {} std::string sName; //Display name - short iValue; //int data - std::string sValue; //string data - bool fValue; //bool data for toggle controls - bool fHidden; - short iIconOverride; }; @@ -82,9 +67,6 @@ class MI_SelectField : public UI_Control short GetShortValue() { return (*current)->iValue; } - std::string GetStringValue() { - return (*current)->sValue; - } //Gets a random value, but does not set the control to that value short GetRandomShortValue() { @@ -104,7 +86,8 @@ class MI_SelectField : public UI_Control MenuCodeEnum Modify(bool modify); //Adds an item to the list - void Add(std::string name, short ivalue, std::string svalue, bool fvalue, bool fhidden, bool fGoodRandom = true, short iIconOverride = -1); + void Add(std::string name, short ivalue); + void Add(std::string name, short ivalue, bool fhidden, bool fGoodRandom = true, short iIconOverride = -1); void Clear() { items.clear(); } diff --git a/src/smw/menu/MatchSelectionMenu.cpp b/src/smw/menu/MatchSelectionMenu.cpp index 047da826..0b788519 100644 --- a/src/smw/menu/MatchSelectionMenu.cpp +++ b/src/smw/menu/MatchSelectionMenu.cpp @@ -23,25 +23,25 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miMatchSelectionStartButton->SetCode(MENU_CODE_MATCH_SELECTION_START); miMatchSelectionField = new MI_SelectField(&rm->spr_selectfield, 130, 340, "Match", 380, 100); - miMatchSelectionField->Add("Single Game", MATCH_TYPE_SINGLE_GAME, "", false, false); - miMatchSelectionField->Add("Tournament", MATCH_TYPE_TOURNAMENT, "", false, false); - miMatchSelectionField->Add("Tour", MATCH_TYPE_TOUR, "", false, false); - miMatchSelectionField->Add("World", MATCH_TYPE_WORLD, "", false, false); - miMatchSelectionField->Add("Minigame", MATCH_TYPE_MINIGAME, "", false, false); + miMatchSelectionField->Add("Single Game", MATCH_TYPE_SINGLE_GAME); + miMatchSelectionField->Add("Tournament", MATCH_TYPE_TOURNAMENT); + miMatchSelectionField->Add("Tour", MATCH_TYPE_TOUR); + miMatchSelectionField->Add("World", MATCH_TYPE_WORLD); + miMatchSelectionField->Add("Minigame", MATCH_TYPE_MINIGAME); miMatchSelectionField->SetData(&game_values.matchtype, NULL, NULL); miMatchSelectionField->SetKey(game_values.matchtype); miMatchSelectionField->SetItemChangedCode(MENU_CODE_MATCH_SELECTION_MATCH_CHANGED); miTournamentField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Wins", 380, 100); - miTournamentField->Add("2", 2, "", false, false); - miTournamentField->Add("3", 3, "", false, false); - miTournamentField->Add("4", 4, "", false, false); - miTournamentField->Add("5", 5, "", false, false); - miTournamentField->Add("6", 6, "", false, false); - miTournamentField->Add("7", 7, "", false, false); - miTournamentField->Add("8", 8, "", false, false); - miTournamentField->Add("9", 9, "", false, false); - miTournamentField->Add("10", 10, "", false, false); + miTournamentField->Add("2", 2); + miTournamentField->Add("3", 3); + miTournamentField->Add("4", 4); + miTournamentField->Add("5", 5); + miTournamentField->Add("6", 6); + miTournamentField->Add("7", 7); + miTournamentField->Add("8", 8); + miTournamentField->Add("9", 9); + miTournamentField->Add("10", 10); miTournamentField->SetData(&game_values.tournamentgames, NULL, NULL); miTournamentField->SetKey(game_values.tournamentgames); miTournamentField->Show(false); @@ -67,11 +67,11 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miWorldField->Show(false); miMinigameField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Game", 380, 100); - miMinigameField->Add("Pipe Coin Game", 0, "", false, false); - miMinigameField->Add("Hammer Boss Game", 1, "", false, false); - miMinigameField->Add("Bomb Boss Game", 2, "", false, false); - miMinigameField->Add("Fire Boss Game", 3, "", false, false); - miMinigameField->Add("Boxes Game", 4, "", false, false); + miMinigameField->Add("Pipe Coin Game", 0); + miMinigameField->Add("Hammer Boss Game", 1); + miMinigameField->Add("Bomb Boss Game", 2); + miMinigameField->Add("Fire Boss Game", 3); + miMinigameField->Add("Boxes Game", 4); miMinigameField->SetData(&game_values.selectedminigame, NULL, NULL); miMinigameField->SetKey(game_values.selectedminigame); miMinigameField->Show(false); diff --git a/src/smw/menu/ModeOptionsMenu.cpp b/src/smw/menu/ModeOptionsMenu.cpp index df09a0a0..8ba24f85 100644 --- a/src/smw/menu/ModeOptionsMenu.cpp +++ b/src/smw/menu/ModeOptionsMenu.cpp @@ -22,14 +22,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miClassicModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); - miClassicModeStyleField->Add("Respawn", 0, "", false, false); - miClassicModeStyleField->Add("Shield", 1, "", false, false); + miClassicModeStyleField->Add("Respawn", 0); + miClassicModeStyleField->Add("Shield", 1); miClassicModeStyleField->SetData(&game_values.gamemodemenusettings.classic.style, NULL, NULL); miClassicModeStyleField->SetKey(game_values.gamemodemenusettings.classic.style); miClassicModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); - miClassicModeScoringField->Add("All Kills", 0, "", false, false); - miClassicModeScoringField->Add("Push Kills Only", 1, "", false, false, false); + miClassicModeScoringField->Add("All Kills", 0); + miClassicModeScoringField->Add("Push Kills Only", 1, false, false); miClassicModeScoringField->SetData(&game_values.gamemodemenusettings.classic.scoring, NULL, NULL); miClassicModeScoringField->SetKey(game_values.gamemodemenusettings.classic.scoring); @@ -57,14 +57,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miFragModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); - miFragModeStyleField->Add("Respawn", 0, "", false, false); - miFragModeStyleField->Add("Shield", 1, "", false, false); + miFragModeStyleField->Add("Respawn", 0); + miFragModeStyleField->Add("Shield", 1); miFragModeStyleField->SetData(&game_values.gamemodemenusettings.frag.style, NULL, NULL); miFragModeStyleField->SetKey(game_values.gamemodemenusettings.frag.style); miFragModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); - miFragModeScoringField->Add("All Kills", 0, "", false, false); - miFragModeScoringField->Add("Push Kills Only", 1, "", false, false, false); + miFragModeScoringField->Add("All Kills", 0); + miFragModeScoringField->Add("Push Kills Only", 1, false, false); miFragModeScoringField->SetData(&game_values.gamemodemenusettings.frag.scoring, NULL, NULL); miFragModeScoringField->SetKey(game_values.gamemodemenusettings.frag.scoring); @@ -92,39 +92,39 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miTimeLimitModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "On Kill", 400, 150); - miTimeLimitModeStyleField->Add("Respawn", 0, "", false, false); - miTimeLimitModeStyleField->Add("Shield", 1, "", false, false); + miTimeLimitModeStyleField->Add("Respawn", 0); + miTimeLimitModeStyleField->Add("Shield", 1); miTimeLimitModeStyleField->SetData(&game_values.gamemodemenusettings.time.style, NULL, NULL); miTimeLimitModeStyleField->SetKey(game_values.gamemodemenusettings.time.style); miTimeLimitModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Scoring", 400, 150); - miTimeLimitModeScoringField->Add("All Kills", 0, "", false, false); - miTimeLimitModeScoringField->Add("Push Kills Only", 1, "", false, false, false); + miTimeLimitModeScoringField->Add("All Kills", 0); + miTimeLimitModeScoringField->Add("Push Kills Only", 1, false, false); miTimeLimitModeScoringField->SetData(&game_values.gamemodemenusettings.time.scoring, NULL, NULL); miTimeLimitModeScoringField->SetKey(game_values.gamemodemenusettings.time.scoring); miTimeLimitModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); - miTimeLimitModePercentExtraTime->Add("0", 0, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("5", 5, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("10", 10, "", false, false); - miTimeLimitModePercentExtraTime->Add("15", 15, "", false, false); - miTimeLimitModePercentExtraTime->Add("20", 20, "", false, false); - miTimeLimitModePercentExtraTime->Add("25", 25, "", false, false); - miTimeLimitModePercentExtraTime->Add("30", 30, "", false, false); - miTimeLimitModePercentExtraTime->Add("35", 35, "", false, false); - miTimeLimitModePercentExtraTime->Add("40", 40, "", false, false); - miTimeLimitModePercentExtraTime->Add("45", 45, "", false, false); - miTimeLimitModePercentExtraTime->Add("50", 50, "", false, false); - miTimeLimitModePercentExtraTime->Add("55", 55, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("60", 60, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("65", 65, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("70", 70, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("75", 75, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("80", 80, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("85", 85, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("90", 90, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("95", 95, "", false, false, false); - miTimeLimitModePercentExtraTime->Add("100", 100, "", false, false, false); + miTimeLimitModePercentExtraTime->Add("0", 0, false, false); + miTimeLimitModePercentExtraTime->Add("5", 5, false, false); + miTimeLimitModePercentExtraTime->Add("10", 10); + miTimeLimitModePercentExtraTime->Add("15", 15); + miTimeLimitModePercentExtraTime->Add("20", 20); + miTimeLimitModePercentExtraTime->Add("25", 25); + miTimeLimitModePercentExtraTime->Add("30", 30); + miTimeLimitModePercentExtraTime->Add("35", 35); + miTimeLimitModePercentExtraTime->Add("40", 40); + miTimeLimitModePercentExtraTime->Add("45", 45); + miTimeLimitModePercentExtraTime->Add("50", 50); + miTimeLimitModePercentExtraTime->Add("55", 55, false, false); + miTimeLimitModePercentExtraTime->Add("60", 60, false, false); + miTimeLimitModePercentExtraTime->Add("65", 65, false, false); + miTimeLimitModePercentExtraTime->Add("70", 70, false, false); + miTimeLimitModePercentExtraTime->Add("75", 75, false, false); + miTimeLimitModePercentExtraTime->Add("80", 80, false, false); + miTimeLimitModePercentExtraTime->Add("85", 85, false, false); + miTimeLimitModePercentExtraTime->Add("90", 90, false, false); + miTimeLimitModePercentExtraTime->Add("95", 95, false, false); + miTimeLimitModePercentExtraTime->Add("100", 100, false, false); miTimeLimitModePercentExtraTime->SetData(&game_values.gamemodemenusettings.time.percentextratime, NULL, NULL); miTimeLimitModePercentExtraTime->SetKey(game_values.gamemodemenusettings.time.percentextratime); miTimeLimitModePercentExtraTime->SetNoWrap(true); @@ -154,26 +154,26 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miJailModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Style", 400, 150); - miJailModeStyleField->Add("Classic", 0, "", false, false); + miJailModeStyleField->Add("Classic", 0); miJailModeStyleField->Add("Owned", 1, "", true, false); miJailModeStyleField->Add("Free For All", 2, "", true, false); miJailModeStyleField->SetData(&game_values.gamemodemenusettings.jail.style, NULL, NULL); miJailModeStyleField->SetKey(game_values.gamemodemenusettings.jail.style); miJailModeTimeFreeField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Free Timer", 400, 150); - miJailModeTimeFreeField->Add("None", 1, "", false, false); - miJailModeTimeFreeField->Add("5 Seconds", 310, "", false, false, false); - miJailModeTimeFreeField->Add("10 Seconds", 620, "", false, false); - miJailModeTimeFreeField->Add("15 Seconds", 930, "", false, false); - miJailModeTimeFreeField->Add("20 Seconds", 1240, "", false, false); - miJailModeTimeFreeField->Add("25 Seconds", 1550, "", false, false); - miJailModeTimeFreeField->Add("30 Seconds", 1860, "", false, false); - miJailModeTimeFreeField->Add("35 Seconds", 2170, "", false, false); - miJailModeTimeFreeField->Add("40 Seconds", 2480, "", false, false); - miJailModeTimeFreeField->Add("45 Seconds", 2790, "", false, false, false); - miJailModeTimeFreeField->Add("50 Seconds", 3100, "", false, false, false); - miJailModeTimeFreeField->Add("55 Seconds", 3410, "", false, false, false); - miJailModeTimeFreeField->Add("60 Seconds", 3720, "", false, false, false); + miJailModeTimeFreeField->Add("None", 1); + miJailModeTimeFreeField->Add("5 Seconds", 310, false, false); + miJailModeTimeFreeField->Add("10 Seconds", 620); + miJailModeTimeFreeField->Add("15 Seconds", 930); + miJailModeTimeFreeField->Add("20 Seconds", 1240); + miJailModeTimeFreeField->Add("25 Seconds", 1550); + miJailModeTimeFreeField->Add("30 Seconds", 1860); + miJailModeTimeFreeField->Add("35 Seconds", 2170); + miJailModeTimeFreeField->Add("40 Seconds", 2480); + miJailModeTimeFreeField->Add("45 Seconds", 2790, false, false); + miJailModeTimeFreeField->Add("50 Seconds", 3100, false, false); + miJailModeTimeFreeField->Add("55 Seconds", 3410, false, false); + miJailModeTimeFreeField->Add("60 Seconds", 3720, false, false); miJailModeTimeFreeField->SetData(&game_values.gamemodemenusettings.jail.timetofree, NULL, NULL); miJailModeTimeFreeField->SetKey(game_values.gamemodemenusettings.jail.timetofree); @@ -185,27 +185,27 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miJailModeTagFreeField->setAutoAdvance(true); miJailModeJailKeyField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Jail Key", 400, 150, 384); - miJailModeJailKeyField->Add("0", 0, "", false, false, false); - miJailModeJailKeyField->Add("5", 5, "", false, false, false); - miJailModeJailKeyField->Add("10", 10, "", false, false); - miJailModeJailKeyField->Add("15", 15, "", false, false); - miJailModeJailKeyField->Add("20", 20, "", false, false); - miJailModeJailKeyField->Add("25", 25, "", false, false); - miJailModeJailKeyField->Add("30", 30, "", false, false); - miJailModeJailKeyField->Add("35", 35, "", false, false); - miJailModeJailKeyField->Add("40", 40, "", false, false); - miJailModeJailKeyField->Add("45", 45, "", false, false); - miJailModeJailKeyField->Add("50", 50, "", false, false); - miJailModeJailKeyField->Add("55", 55, "", false, false, false); - miJailModeJailKeyField->Add("60", 60, "", false, false, false); - miJailModeJailKeyField->Add("65", 65, "", false, false, false); - miJailModeJailKeyField->Add("70", 70, "", false, false, false); - miJailModeJailKeyField->Add("75", 75, "", false, false, false); - miJailModeJailKeyField->Add("80", 80, "", false, false, false); - miJailModeJailKeyField->Add("85", 85, "", false, false, false); - miJailModeJailKeyField->Add("90", 90, "", false, false, false); - miJailModeJailKeyField->Add("95", 95, "", false, false, false); - miJailModeJailKeyField->Add("100", 100, "", false, false, false); + miJailModeJailKeyField->Add("0", 0, false, false); + miJailModeJailKeyField->Add("5", 5, false, false); + miJailModeJailKeyField->Add("10", 10); + miJailModeJailKeyField->Add("15", 15); + miJailModeJailKeyField->Add("20", 20); + miJailModeJailKeyField->Add("25", 25); + miJailModeJailKeyField->Add("30", 30); + miJailModeJailKeyField->Add("35", 35); + miJailModeJailKeyField->Add("40", 40); + miJailModeJailKeyField->Add("45", 45); + miJailModeJailKeyField->Add("50", 50); + miJailModeJailKeyField->Add("55", 55, false, false); + miJailModeJailKeyField->Add("60", 60, false, false); + miJailModeJailKeyField->Add("65", 65, false, false); + miJailModeJailKeyField->Add("70", 70, false, false); + miJailModeJailKeyField->Add("75", 75, false, false); + miJailModeJailKeyField->Add("80", 80, false, false); + miJailModeJailKeyField->Add("85", 85, false, false); + miJailModeJailKeyField->Add("90", 90, false, false); + miJailModeJailKeyField->Add("95", 95, false, false); + miJailModeJailKeyField->Add("100", 100, false, false); miJailModeJailKeyField->SetData(&game_values.gamemodemenusettings.jail.percentkey, NULL, NULL); miJailModeJailKeyField->SetKey(game_values.gamemodemenusettings.jail.percentkey); miJailModeJailKeyField->SetNoWrap(true); @@ -243,41 +243,41 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCoinModePenaltyField->setAutoAdvance(true); miCoinModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Quantity", 400, 150); - miCoinModeQuantityField->Add("1", 1, "", false, false); - miCoinModeQuantityField->Add("2", 2, "", false, false); - miCoinModeQuantityField->Add("3", 3, "", false, false); - miCoinModeQuantityField->Add("4", 4, "", false, false); - miCoinModeQuantityField->Add("5", 5, "", false, false); - miCoinModeQuantityField->Add("6", 6, "", false, false); - miCoinModeQuantityField->Add("7", 7, "", false, false); - miCoinModeQuantityField->Add("8", 8, "", false, false); - miCoinModeQuantityField->Add("9", 9, "", false, false); - miCoinModeQuantityField->Add("10", 10, "", false, false); + miCoinModeQuantityField->Add("1", 1); + miCoinModeQuantityField->Add("2", 2); + miCoinModeQuantityField->Add("3", 3); + miCoinModeQuantityField->Add("4", 4); + miCoinModeQuantityField->Add("5", 5); + miCoinModeQuantityField->Add("6", 6); + miCoinModeQuantityField->Add("7", 7); + miCoinModeQuantityField->Add("8", 8); + miCoinModeQuantityField->Add("9", 9); + miCoinModeQuantityField->Add("10", 10); miCoinModeQuantityField->SetData(&game_values.gamemodemenusettings.coins.quantity, NULL, NULL); miCoinModeQuantityField->SetKey(game_values.gamemodemenusettings.coins.quantity); miCoinModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Coins", 400, 150, 384); - miCoinModePercentExtraCoin->Add("0", 0, "", false, false, false); - miCoinModePercentExtraCoin->Add("5", 5, "", false, false, false); - miCoinModePercentExtraCoin->Add("10", 10, "", false, false); - miCoinModePercentExtraCoin->Add("15", 15, "", false, false); - miCoinModePercentExtraCoin->Add("20", 20, "", false, false); - miCoinModePercentExtraCoin->Add("25", 25, "", false, false); - miCoinModePercentExtraCoin->Add("30", 30, "", false, false); - miCoinModePercentExtraCoin->Add("35", 35, "", false, false); - miCoinModePercentExtraCoin->Add("40", 40, "", false, false); - miCoinModePercentExtraCoin->Add("45", 45, "", false, false); - miCoinModePercentExtraCoin->Add("50", 50, "", false, false); - miCoinModePercentExtraCoin->Add("55", 55, "", false, false, false); - miCoinModePercentExtraCoin->Add("60", 60, "", false, false, false); - miCoinModePercentExtraCoin->Add("65", 65, "", false, false, false); - miCoinModePercentExtraCoin->Add("70", 70, "", false, false, false); - miCoinModePercentExtraCoin->Add("75", 75, "", false, false, false); - miCoinModePercentExtraCoin->Add("80", 80, "", false, false, false); - miCoinModePercentExtraCoin->Add("85", 85, "", false, false, false); - miCoinModePercentExtraCoin->Add("90", 90, "", false, false, false); - miCoinModePercentExtraCoin->Add("95", 95, "", false, false, false); - miCoinModePercentExtraCoin->Add("100", 100, "", false, false, false); + miCoinModePercentExtraCoin->Add("0", 0, false, false); + miCoinModePercentExtraCoin->Add("5", 5, false, false); + miCoinModePercentExtraCoin->Add("10", 10); + miCoinModePercentExtraCoin->Add("15", 15); + miCoinModePercentExtraCoin->Add("20", 20); + miCoinModePercentExtraCoin->Add("25", 25); + miCoinModePercentExtraCoin->Add("30", 30); + miCoinModePercentExtraCoin->Add("35", 35); + miCoinModePercentExtraCoin->Add("40", 40); + miCoinModePercentExtraCoin->Add("45", 45); + miCoinModePercentExtraCoin->Add("50", 50); + miCoinModePercentExtraCoin->Add("55", 55, false, false); + miCoinModePercentExtraCoin->Add("60", 60, false, false); + miCoinModePercentExtraCoin->Add("65", 65, false, false); + miCoinModePercentExtraCoin->Add("70", 70, false, false); + miCoinModePercentExtraCoin->Add("75", 75, false, false); + miCoinModePercentExtraCoin->Add("80", 80, false, false); + miCoinModePercentExtraCoin->Add("85", 85, false, false); + miCoinModePercentExtraCoin->Add("90", 90, false, false); + miCoinModePercentExtraCoin->Add("95", 95, false, false); + miCoinModePercentExtraCoin->Add("100", 100, false, false); miCoinModePercentExtraCoin->SetData(&game_values.gamemodemenusettings.coins.percentextracoin, NULL, NULL); miCoinModePercentExtraCoin->SetKey(game_values.gamemodemenusettings.coins.percentextracoin); miCoinModePercentExtraCoin->SetNoWrap(true); @@ -307,13 +307,13 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miStompModeRateField = new MI_SelectField(&rm->spr_selectfield, 120, 40, "Rate", 400, 180); - miStompModeRateField->Add("Very Slow", 150, "", false, false, false); - miStompModeRateField->Add("Slow", 120, "", false, false); - miStompModeRateField->Add("Moderate", 90, "", false, false); - miStompModeRateField->Add("Fast", 60, "", false, false); - miStompModeRateField->Add("Very Fast", 30, "", false, false, false); - miStompModeRateField->Add("Extremely Fast", 15, "", false, false, false); - miStompModeRateField->Add("Insanely Fast", 5, "", false, false, false); + miStompModeRateField->Add("Very Slow", 150, false, false); + miStompModeRateField->Add("Slow", 120); + miStompModeRateField->Add("Moderate", 90); + miStompModeRateField->Add("Fast", 60); + miStompModeRateField->Add("Very Fast", 30, false, false); + miStompModeRateField->Add("Extremely Fast", 15, false, false); + miStompModeRateField->Add("Insanely Fast", 5, false, false); miStompModeRateField->SetData(&game_values.gamemodemenusettings.stomp.rate, NULL, NULL); miStompModeRateField->SetKey(game_values.gamemodemenusettings.stomp.rate); @@ -371,11 +371,11 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iEggField = 0; iEggField < 4; iEggField++) { miEggModeEggQuantityField[iEggField] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_egg, 170, 60 + 40 * iEggField, 300, iEggField); - miEggModeEggQuantityField[iEggField]->Add("0", 0, "", false, false, iEggField == 0 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("1", 1, "", false, false, iEggField >= 2 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("2", 2, "", false, false, iEggField >= 2 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("3", 3, "", false, false, iEggField >= 1 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("4", 4, "", false, false, false); + miEggModeEggQuantityField[iEggField]->Add("0", 0, false, iEggField == 0 ? false : true); + miEggModeEggQuantityField[iEggField]->Add("1", 1, false, iEggField >= 2 ? false : true); + miEggModeEggQuantityField[iEggField]->Add("2", 2, false, iEggField >= 2 ? false : true); + miEggModeEggQuantityField[iEggField]->Add("3", 3, false, iEggField >= 1 ? false : true); + miEggModeEggQuantityField[iEggField]->Add("4", 4, false, false); miEggModeEggQuantityField[iEggField]->SetData(&game_values.gamemodemenusettings.egg.eggs[iEggField], NULL, NULL); miEggModeEggQuantityField[iEggField]->SetKey(game_values.gamemodemenusettings.egg.eggs[iEggField]); miEggModeEggQuantityField[iEggField]->SetNoWrap(true); @@ -383,24 +383,24 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iYoshiField = 0; iYoshiField < 4; iYoshiField++) { miEggModeYoshiQuantityField[iYoshiField] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_egg, 170, 220 + 40 * iYoshiField, 300, iYoshiField + 4); - miEggModeYoshiQuantityField[iYoshiField]->Add("0", 0, "", false, false, iYoshiField == 0 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->Add("1", 1, "", false, false, iYoshiField >= 2 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->Add("2", 2, "", false, false, iYoshiField >= 1 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->Add("3", 3, "", false, false, false); - miEggModeYoshiQuantityField[iYoshiField]->Add("4", 4, "", false, false, false); + miEggModeYoshiQuantityField[iYoshiField]->Add("0", 0, false, iYoshiField == 0 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->Add("1", 1, false, iYoshiField >= 2 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->Add("2", 2, false, iYoshiField >= 1 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->Add("3", 3, false, false); + miEggModeYoshiQuantityField[iYoshiField]->Add("4", 4, false, false); miEggModeYoshiQuantityField[iYoshiField]->SetData(&game_values.gamemodemenusettings.egg.yoshis[iYoshiField], NULL, NULL); miEggModeYoshiQuantityField[iYoshiField]->SetKey(game_values.gamemodemenusettings.egg.yoshis[iYoshiField]); miEggModeYoshiQuantityField[iYoshiField]->SetNoWrap(true); } miEggModeExplosionTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 380, "Explosion Timer", 400, 180); - miEggModeExplosionTimeField->Add("Off", 0, "", false, false); - miEggModeExplosionTimeField->Add("3 Seconds", 3, "", false, false, false); - miEggModeExplosionTimeField->Add("5 Seconds", 5, "", false, false); - miEggModeExplosionTimeField->Add("8 Seconds", 8, "", false, false); - miEggModeExplosionTimeField->Add("10 Seconds", 10, "", false, false); - miEggModeExplosionTimeField->Add("15 Seconds", 15, "", false, false); - miEggModeExplosionTimeField->Add("20 Seconds", 20, "", false, false); + miEggModeExplosionTimeField->Add("Off", 0); + miEggModeExplosionTimeField->Add("3 Seconds", 3, false, false); + miEggModeExplosionTimeField->Add("5 Seconds", 5); + miEggModeExplosionTimeField->Add("8 Seconds", 8); + miEggModeExplosionTimeField->Add("10 Seconds", 10); + miEggModeExplosionTimeField->Add("15 Seconds", 15); + miEggModeExplosionTimeField->Add("20 Seconds", 20); miEggModeExplosionTimeField->SetData(&game_values.gamemodemenusettings.egg.explode, NULL, NULL); miEggModeExplosionTimeField->SetKey(game_values.gamemodemenusettings.egg.explode); @@ -437,16 +437,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miFlagModeSpeedField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 120, "Speed", 400, 180, 380); - miFlagModeSpeedField->Add("-", -1, "", false, false); - miFlagModeSpeedField->Add("0", 0, "", false, false); - miFlagModeSpeedField->Add("1", 1, "", false, false); - miFlagModeSpeedField->Add("2", 2, "", false, false); - miFlagModeSpeedField->Add("3", 3, "", false, false); - miFlagModeSpeedField->Add("4", 4, "", false, false); - miFlagModeSpeedField->Add("5", 5, "", false, false); - miFlagModeSpeedField->Add("6", 6, "", false, false, false); - miFlagModeSpeedField->Add("7", 7, "", false, false, false); - miFlagModeSpeedField->Add("8", 8, "", false, false, false); + miFlagModeSpeedField->Add("-", -1); + miFlagModeSpeedField->Add("0", 0); + miFlagModeSpeedField->Add("1", 1); + miFlagModeSpeedField->Add("2", 2); + miFlagModeSpeedField->Add("3", 3); + miFlagModeSpeedField->Add("4", 4); + miFlagModeSpeedField->Add("5", 5); + miFlagModeSpeedField->Add("6", 6, false, false); + miFlagModeSpeedField->Add("7", 7, false, false); + miFlagModeSpeedField->Add("8", 8, false, false); miFlagModeSpeedField->SetData(&game_values.gamemodemenusettings.flag.speed, NULL, NULL); miFlagModeSpeedField->SetKey(game_values.gamemodemenusettings.flag.speed); miFlagModeSpeedField->SetNoWrap(true); @@ -466,19 +466,19 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModePointMoveField->setAutoAdvance(true); miFlagModeAutoReturnField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Auto Return", 400, 180); - miFlagModeAutoReturnField->Add("None", 0, "", false, false); - miFlagModeAutoReturnField->Add("5 Seconds", 310, "", false, false, false); - miFlagModeAutoReturnField->Add("10 Seconds", 620, "", false, false); - miFlagModeAutoReturnField->Add("15 Seconds", 930, "", false, false, false); - miFlagModeAutoReturnField->Add("20 Seconds", 1240, "", false, false); - miFlagModeAutoReturnField->Add("25 Seconds", 1550, "", false, false, false); - miFlagModeAutoReturnField->Add("30 Seconds", 1860, "", false, false, false); - miFlagModeAutoReturnField->Add("35 Seconds", 2170, "", false, false, false); - miFlagModeAutoReturnField->Add("40 Seconds", 2480, "", false, false, false); - miFlagModeAutoReturnField->Add("45 Seconds", 2790, "", false, false, false); - miFlagModeAutoReturnField->Add("50 Seconds", 3100, "", false, false, false); - miFlagModeAutoReturnField->Add("55 Seconds", 3410, "", false, false, false); - miFlagModeAutoReturnField->Add("60 Seconds", 3720, "", false, false, false); + miFlagModeAutoReturnField->Add("None", 0); + miFlagModeAutoReturnField->Add("5 Seconds", 310, false, false); + miFlagModeAutoReturnField->Add("10 Seconds", 620); + miFlagModeAutoReturnField->Add("15 Seconds", 930, false, false); + miFlagModeAutoReturnField->Add("20 Seconds", 1240); + miFlagModeAutoReturnField->Add("25 Seconds", 1550, false, false); + miFlagModeAutoReturnField->Add("30 Seconds", 1860, false, false); + miFlagModeAutoReturnField->Add("35 Seconds", 2170, false, false); + miFlagModeAutoReturnField->Add("40 Seconds", 2480, false, false); + miFlagModeAutoReturnField->Add("45 Seconds", 2790, false, false); + miFlagModeAutoReturnField->Add("50 Seconds", 3100, false, false); + miFlagModeAutoReturnField->Add("55 Seconds", 3410, false, false); + miFlagModeAutoReturnField->Add("60 Seconds", 3720, false, false); miFlagModeAutoReturnField->SetData(&game_values.gamemodemenusettings.flag.autoreturn, NULL, NULL); miFlagModeAutoReturnField->SetKey(game_values.gamemodemenusettings.flag.autoreturn); @@ -593,51 +593,51 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miStarModeTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Time", 400, 150); - miStarModeTimeField->Add("5 Seconds", 5, "", false, false, false); - miStarModeTimeField->Add("10 Seconds", 10, "", false, false, false); - miStarModeTimeField->Add("15 Seconds", 15, "", false, false); - miStarModeTimeField->Add("20 Seconds", 20, "", false, false); - miStarModeTimeField->Add("25 Seconds", 25, "", false, false); - miStarModeTimeField->Add("30 Seconds", 30, "", false, false); - miStarModeTimeField->Add("35 Seconds", 35, "", false, false); - miStarModeTimeField->Add("40 Seconds", 40, "", false, false); - miStarModeTimeField->Add("45 Seconds", 45, "", false, false, false); - miStarModeTimeField->Add("50 Seconds", 50, "", false, false, false); - miStarModeTimeField->Add("55 Seconds", 55, "", false, false, false); - miStarModeTimeField->Add("60 Seconds", 60, "", false, false, false); + miStarModeTimeField->Add("5 Seconds", 5, false, false); + miStarModeTimeField->Add("10 Seconds", 10, false, false); + miStarModeTimeField->Add("15 Seconds", 15); + miStarModeTimeField->Add("20 Seconds", 20); + miStarModeTimeField->Add("25 Seconds", 25); + miStarModeTimeField->Add("30 Seconds", 30); + miStarModeTimeField->Add("35 Seconds", 35); + miStarModeTimeField->Add("40 Seconds", 40); + miStarModeTimeField->Add("45 Seconds", 45, false, false); + miStarModeTimeField->Add("50 Seconds", 50, false, false); + miStarModeTimeField->Add("55 Seconds", 55, false, false); + miStarModeTimeField->Add("60 Seconds", 60, false, false); miStarModeTimeField->SetData(&game_values.gamemodemenusettings.star.time, NULL, NULL); miStarModeTimeField->SetKey(game_values.gamemodemenusettings.star.time); miStarModeShineField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Star Type", 400, 150); - miStarModeShineField->Add("Ztar", 0, "", false, false); - miStarModeShineField->Add("Shine", 1, "", false, false); - miStarModeShineField->Add("Multi Star", 2, "", false, false); - miStarModeShineField->Add("Random", 3, "", false, false); + miStarModeShineField->Add("Ztar", 0); + miStarModeShineField->Add("Shine", 1); + miStarModeShineField->Add("Multi Star", 2); + miStarModeShineField->Add("Random", 3); miStarModeShineField->SetData(&game_values.gamemodemenusettings.star.shine, NULL, NULL); miStarModeShineField->SetKey(game_values.gamemodemenusettings.star.shine); miStarModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); - miStarModePercentExtraTime->Add("0", 0, "", false, false, false); - miStarModePercentExtraTime->Add("5", 5, "", false, false, false); - miStarModePercentExtraTime->Add("10", 10, "", false, false); - miStarModePercentExtraTime->Add("15", 15, "", false, false); - miStarModePercentExtraTime->Add("20", 20, "", false, false); - miStarModePercentExtraTime->Add("25", 25, "", false, false); - miStarModePercentExtraTime->Add("30", 30, "", false, false); - miStarModePercentExtraTime->Add("35", 35, "", false, false); - miStarModePercentExtraTime->Add("40", 40, "", false, false); - miStarModePercentExtraTime->Add("45", 45, "", false, false); - miStarModePercentExtraTime->Add("50", 50, "", false, false); - miStarModePercentExtraTime->Add("55", 55, "", false, false, false); - miStarModePercentExtraTime->Add("60", 60, "", false, false, false); - miStarModePercentExtraTime->Add("65", 65, "", false, false, false); - miStarModePercentExtraTime->Add("70", 70, "", false, false, false); - miStarModePercentExtraTime->Add("75", 75, "", false, false, false); - miStarModePercentExtraTime->Add("80", 80, "", false, false, false); - miStarModePercentExtraTime->Add("85", 85, "", false, false, false); - miStarModePercentExtraTime->Add("90", 90, "", false, false, false); - miStarModePercentExtraTime->Add("95", 95, "", false, false, false); - miStarModePercentExtraTime->Add("100", 100, "", false, false, false); + miStarModePercentExtraTime->Add("0", 0, false, false); + miStarModePercentExtraTime->Add("5", 5, false, false); + miStarModePercentExtraTime->Add("10", 10); + miStarModePercentExtraTime->Add("15", 15); + miStarModePercentExtraTime->Add("20", 20); + miStarModePercentExtraTime->Add("25", 25); + miStarModePercentExtraTime->Add("30", 30); + miStarModePercentExtraTime->Add("35", 35); + miStarModePercentExtraTime->Add("40", 40); + miStarModePercentExtraTime->Add("45", 45); + miStarModePercentExtraTime->Add("50", 50); + miStarModePercentExtraTime->Add("55", 55, false, false); + miStarModePercentExtraTime->Add("60", 60, false, false); + miStarModePercentExtraTime->Add("65", 65, false, false); + miStarModePercentExtraTime->Add("70", 70, false, false); + miStarModePercentExtraTime->Add("75", 75, false, false); + miStarModePercentExtraTime->Add("80", 80, false, false); + miStarModePercentExtraTime->Add("85", 85, false, false); + miStarModePercentExtraTime->Add("90", 90, false, false); + miStarModePercentExtraTime->Add("95", 95, false, false); + miStarModePercentExtraTime->Add("100", 100, false, false); miStarModePercentExtraTime->SetData(&game_values.gamemodemenusettings.star.percentextratime, NULL, NULL); miStarModePercentExtraTime->SetKey(game_values.gamemodemenusettings.star.percentextratime); miStarModePercentExtraTime->SetNoWrap(true); @@ -667,46 +667,46 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miDominationModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 120, "Quantity", 400, 180); - miDominationModeQuantityField->Add("1 Base", 1, "", false, false, false); - miDominationModeQuantityField->Add("2 Bases", 2, "", false, false, false); - miDominationModeQuantityField->Add("3 Bases", 3, "", false, false); - miDominationModeQuantityField->Add("4 Bases", 4, "", false, false); - miDominationModeQuantityField->Add("5 Bases", 5, "", false, false); - miDominationModeQuantityField->Add("6 Bases", 6, "", false, false, false); - miDominationModeQuantityField->Add("7 Bases", 7, "", false, false, false); - miDominationModeQuantityField->Add("8 Bases", 8, "", false, false, false); - miDominationModeQuantityField->Add("9 Bases", 9, "", false, false, false); - miDominationModeQuantityField->Add("10 Bases", 10, "", false, false, false); - miDominationModeQuantityField->Add("# Players - 1", 11, "", false, false, false); - miDominationModeQuantityField->Add("# Players", 12, "", false, false, false); - miDominationModeQuantityField->Add("# Players + 1", 13, "", false, false); - miDominationModeQuantityField->Add("# Players + 2", 14, "", false, false); - miDominationModeQuantityField->Add("# Players + 3", 15, "", false, false); - miDominationModeQuantityField->Add("# Players + 4", 16, "", false, false); - miDominationModeQuantityField->Add("# Players + 5", 17, "", false, false); - miDominationModeQuantityField->Add("# Players + 6", 18, "", false, false, false); - miDominationModeQuantityField->Add("2x Players - 3", 19, "", false, false, false); - miDominationModeQuantityField->Add("2x Players - 2", 20, "", false, false, false); - miDominationModeQuantityField->Add("2x Players - 1", 21, "", false, false); - miDominationModeQuantityField->Add("2x Players", 22, "", false, false); - miDominationModeQuantityField->Add("2x Players + 1", 23, "", false, false, false); - miDominationModeQuantityField->Add("2x Players + 2", 24, "", false, false, false); + miDominationModeQuantityField->Add("1 Base", 1, false, false); + miDominationModeQuantityField->Add("2 Bases", 2, false, false); + miDominationModeQuantityField->Add("3 Bases", 3); + miDominationModeQuantityField->Add("4 Bases", 4); + miDominationModeQuantityField->Add("5 Bases", 5); + miDominationModeQuantityField->Add("6 Bases", 6, false, false); + miDominationModeQuantityField->Add("7 Bases", 7, false, false); + miDominationModeQuantityField->Add("8 Bases", 8, false, false); + miDominationModeQuantityField->Add("9 Bases", 9, false, false); + miDominationModeQuantityField->Add("10 Bases", 10, false, false); + miDominationModeQuantityField->Add("# Players - 1", 11, false, false); + miDominationModeQuantityField->Add("# Players", 12, false, false); + miDominationModeQuantityField->Add("# Players + 1", 13); + miDominationModeQuantityField->Add("# Players + 2", 14); + miDominationModeQuantityField->Add("# Players + 3", 15); + miDominationModeQuantityField->Add("# Players + 4", 16); + miDominationModeQuantityField->Add("# Players + 5", 17); + miDominationModeQuantityField->Add("# Players + 6", 18, false, false); + miDominationModeQuantityField->Add("2x Players - 3", 19, false, false); + miDominationModeQuantityField->Add("2x Players - 2", 20, false, false); + miDominationModeQuantityField->Add("2x Players - 1", 21); + miDominationModeQuantityField->Add("2x Players", 22); + miDominationModeQuantityField->Add("2x Players + 1", 23, false, false); + miDominationModeQuantityField->Add("2x Players + 2", 24, false, false); miDominationModeQuantityField->SetData(&game_values.gamemodemenusettings.domination.quantity, NULL, NULL); miDominationModeQuantityField->SetKey(game_values.gamemodemenusettings.domination.quantity); miDominationModeRelocateFrequencyField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Relocate", 400, 180); - miDominationModeRelocateFrequencyField->Add("Never", 0, "", false, false); - miDominationModeRelocateFrequencyField->Add("5 Seconds", 310, "", false, false, false); - miDominationModeRelocateFrequencyField->Add("10 Seconds", 620, "", false, false); - miDominationModeRelocateFrequencyField->Add("15 Seconds", 930, "", false, false); - miDominationModeRelocateFrequencyField->Add("20 Seconds", 1240, "", false, false); - miDominationModeRelocateFrequencyField->Add("30 Seconds", 1860, "", false, false); - miDominationModeRelocateFrequencyField->Add("45 Seconds", 2790, "", false, false); - miDominationModeRelocateFrequencyField->Add("1 Minute", 3720, "", false, false); - miDominationModeRelocateFrequencyField->Add("1.5 Minutes", 5580, "", false, false); - miDominationModeRelocateFrequencyField->Add("2 Minutes", 7440, "", false, false); - miDominationModeRelocateFrequencyField->Add("2.5 Minutes", 9300, "", false, false); - miDominationModeRelocateFrequencyField->Add("3 Minutes", 11160, "", false, false); + miDominationModeRelocateFrequencyField->Add("Never", 0); + miDominationModeRelocateFrequencyField->Add("5 Seconds", 310, false, false); + miDominationModeRelocateFrequencyField->Add("10 Seconds", 620); + miDominationModeRelocateFrequencyField->Add("15 Seconds", 930); + miDominationModeRelocateFrequencyField->Add("20 Seconds", 1240); + miDominationModeRelocateFrequencyField->Add("30 Seconds", 1860); + miDominationModeRelocateFrequencyField->Add("45 Seconds", 2790); + miDominationModeRelocateFrequencyField->Add("1 Minute", 3720); + miDominationModeRelocateFrequencyField->Add("1.5 Minutes", 5580); + miDominationModeRelocateFrequencyField->Add("2 Minutes", 7440); + miDominationModeRelocateFrequencyField->Add("2.5 Minutes", 9300); + miDominationModeRelocateFrequencyField->Add("3 Minutes", 11160); miDominationModeRelocateFrequencyField->SetData(&game_values.gamemodemenusettings.domination.relocationfrequency, NULL, NULL); miDominationModeRelocateFrequencyField->SetKey(game_values.gamemodemenusettings.domination.relocationfrequency); @@ -763,37 +763,37 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miKingOfTheHillModeSizeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Size", 400, 180); - miKingOfTheHillModeSizeField->Add("2 x 2", 2, "", false, false); - miKingOfTheHillModeSizeField->Add("3 x 3", 3, "", false, false); - miKingOfTheHillModeSizeField->Add("4 x 4", 4, "", false, false); - miKingOfTheHillModeSizeField->Add("5 x 5", 5, "", false, false); - miKingOfTheHillModeSizeField->Add("6 x 6", 6, "", false, false); - miKingOfTheHillModeSizeField->Add("7 x 7", 7, "", false, false); + miKingOfTheHillModeSizeField->Add("2 x 2", 2); + miKingOfTheHillModeSizeField->Add("3 x 3", 3); + miKingOfTheHillModeSizeField->Add("4 x 4", 4); + miKingOfTheHillModeSizeField->Add("5 x 5", 5); + miKingOfTheHillModeSizeField->Add("6 x 6", 6); + miKingOfTheHillModeSizeField->Add("7 x 7", 7); miKingOfTheHillModeSizeField->SetData(&game_values.gamemodemenusettings.kingofthehill.areasize, NULL, NULL); miKingOfTheHillModeSizeField->SetKey(game_values.gamemodemenusettings.kingofthehill.areasize); miKingOfTheHillModeRelocateFrequencyField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Relocate", 400, 180); - miKingOfTheHillModeRelocateFrequencyField->Add("Never", 0, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("5 Seconds", 310, "", false, false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("10 Seconds", 620, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("15 Seconds", 930, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("20 Seconds", 1240, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("30 Seconds", 1860, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("45 Seconds", 2790, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("1 Minute", 3720, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("1.5 Minutes", 5580, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("2 Minutes", 7440, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("2.5 Minutes", 9300, "", false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("3 Minutes", 11160, "", false, false); + miKingOfTheHillModeRelocateFrequencyField->Add("Never", 0); + miKingOfTheHillModeRelocateFrequencyField->Add("5 Seconds", 310, false, false); + miKingOfTheHillModeRelocateFrequencyField->Add("10 Seconds", 620); + miKingOfTheHillModeRelocateFrequencyField->Add("15 Seconds", 930); + miKingOfTheHillModeRelocateFrequencyField->Add("20 Seconds", 1240); + miKingOfTheHillModeRelocateFrequencyField->Add("30 Seconds", 1860); + miKingOfTheHillModeRelocateFrequencyField->Add("45 Seconds", 2790); + miKingOfTheHillModeRelocateFrequencyField->Add("1 Minute", 3720); + miKingOfTheHillModeRelocateFrequencyField->Add("1.5 Minutes", 5580); + miKingOfTheHillModeRelocateFrequencyField->Add("2 Minutes", 7440); + miKingOfTheHillModeRelocateFrequencyField->Add("2.5 Minutes", 9300); + miKingOfTheHillModeRelocateFrequencyField->Add("3 Minutes", 11160); miKingOfTheHillModeRelocateFrequencyField->SetData(&game_values.gamemodemenusettings.kingofthehill.relocationfrequency, NULL, NULL); miKingOfTheHillModeRelocateFrequencyField->SetKey(game_values.gamemodemenusettings.kingofthehill.relocationfrequency); miKingOfTheHillModeMultiplierField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Max Multiplier", 400, 180); - miKingOfTheHillModeMultiplierField->Add("None", 1, "", false, false); - miKingOfTheHillModeMultiplierField->Add("2", 2, "", false, false); - miKingOfTheHillModeMultiplierField->Add("3", 3, "", false, false); - miKingOfTheHillModeMultiplierField->Add("4", 4, "", false, false); - miKingOfTheHillModeMultiplierField->Add("5", 5, "", false, false); + miKingOfTheHillModeMultiplierField->Add("None", 1); + miKingOfTheHillModeMultiplierField->Add("2", 2); + miKingOfTheHillModeMultiplierField->Add("3", 3); + miKingOfTheHillModeMultiplierField->Add("4", 4); + miKingOfTheHillModeMultiplierField->Add("5", 5); miKingOfTheHillModeMultiplierField->SetData(&game_values.gamemodemenusettings.kingofthehill.maxmultiplier, NULL, NULL); miKingOfTheHillModeMultiplierField->SetKey(game_values.gamemodemenusettings.kingofthehill.maxmultiplier); @@ -823,32 +823,32 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miRaceModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Quantity", 400, 180); - miRaceModeQuantityField->Add("2", 2, "", false, false, false); - miRaceModeQuantityField->Add("3", 3, "", false, false); - miRaceModeQuantityField->Add("4", 4, "", false, false); - miRaceModeQuantityField->Add("5", 5, "", false, false); - miRaceModeQuantityField->Add("6", 6, "", false, false); - miRaceModeQuantityField->Add("7", 7, "", false, false); - miRaceModeQuantityField->Add("8", MAXRACEGOALS, "", false, false); + miRaceModeQuantityField->Add("2", 2, false, false); + miRaceModeQuantityField->Add("3", 3); + miRaceModeQuantityField->Add("4", 4); + miRaceModeQuantityField->Add("5", 5); + miRaceModeQuantityField->Add("6", 6); + miRaceModeQuantityField->Add("7", 7); + miRaceModeQuantityField->Add("8", MAXRACEGOALS); miRaceModeQuantityField->SetData(&game_values.gamemodemenusettings.race.quantity, NULL, NULL); miRaceModeQuantityField->SetKey(game_values.gamemodemenusettings.race.quantity); miRaceModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Speed", 400, 180); - miRaceModeSpeedField->Add("Stationary", 0, "", false, false); - miRaceModeSpeedField->Add("Very Slow", 2, "", false, false); - miRaceModeSpeedField->Add("Slow", 3, "", false, false); - miRaceModeSpeedField->Add("Moderate", 4, "", false, false); - miRaceModeSpeedField->Add("Fast", 6, "", false, false); - miRaceModeSpeedField->Add("Very Fast", 8, "", false, false, false); - miRaceModeSpeedField->Add("Extremely Fast", 15, "", false, false, false); - miRaceModeSpeedField->Add("Insanely Fast", 30, "", false, false, false); + miRaceModeSpeedField->Add("Stationary", 0); + miRaceModeSpeedField->Add("Very Slow", 2); + miRaceModeSpeedField->Add("Slow", 3); + miRaceModeSpeedField->Add("Moderate", 4); + miRaceModeSpeedField->Add("Fast", 6); + miRaceModeSpeedField->Add("Very Fast", 8, false, false); + miRaceModeSpeedField->Add("Extremely Fast", 15, false, false); + miRaceModeSpeedField->Add("Insanely Fast", 30, false, false); miRaceModeSpeedField->SetData(&game_values.gamemodemenusettings.race.speed, NULL, NULL); miRaceModeSpeedField->SetKey(game_values.gamemodemenusettings.race.speed); miRaceModePenaltyField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Penalty", 400, 180); - miRaceModePenaltyField->Add("None", 0, "", false, false); - miRaceModePenaltyField->Add("One Goal", 1, "", false, false); - miRaceModePenaltyField->Add("All Goals", 2, "", false, false); + miRaceModePenaltyField->Add("None", 0); + miRaceModePenaltyField->Add("One Goal", 1); + miRaceModePenaltyField->Add("All Goals", 2); miRaceModePenaltyField->SetData(&game_values.gamemodemenusettings.race.penalty, NULL, NULL); miRaceModePenaltyField->SetKey(game_values.gamemodemenusettings.race.penalty); @@ -917,24 +917,24 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() } miSurvivalModeDensityField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Density", 400, 180); - miSurvivalModeDensityField->Add("Very Low", 40, "", false, false, false); - miSurvivalModeDensityField->Add("Low", 30, "", false, false); - miSurvivalModeDensityField->Add("Medium", 20, "", false, false); - miSurvivalModeDensityField->Add("High", 15, "", false, false); - miSurvivalModeDensityField->Add("Very High", 10, "", false, false, false); - miSurvivalModeDensityField->Add("Extremely High", 6, "", false, false); - miSurvivalModeDensityField->Add("Insanely High", 2, "", false, false, false); + miSurvivalModeDensityField->Add("Very Low", 40, false, false); + miSurvivalModeDensityField->Add("Low", 30); + miSurvivalModeDensityField->Add("Medium", 20); + miSurvivalModeDensityField->Add("High", 15); + miSurvivalModeDensityField->Add("Very High", 10, false, false); + miSurvivalModeDensityField->Add("Extremely High", 6); + miSurvivalModeDensityField->Add("Insanely High", 2, false, false); miSurvivalModeDensityField->SetData(&game_values.gamemodemenusettings.survival.density, NULL, NULL); miSurvivalModeDensityField->SetKey(game_values.gamemodemenusettings.survival.density); miSurvivalModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Speed", 400, 180); - miSurvivalModeSpeedField->Add("Very Slow", 2, "", false, false, false); - miSurvivalModeSpeedField->Add("Slow", 3, "", false, false); - miSurvivalModeSpeedField->Add("Moderate", 4, "", false, false); - miSurvivalModeSpeedField->Add("Fast", 6, "", false, false); - miSurvivalModeSpeedField->Add("Very Fast", 8, "", false, false, false); - miSurvivalModeSpeedField->Add("Extremely Fast", 15, "", false, false, false); - miSurvivalModeSpeedField->Add("Insanely Fast", 30, "", false, false, false); + miSurvivalModeSpeedField->Add("Very Slow", 2, false, false); + miSurvivalModeSpeedField->Add("Slow", 3); + miSurvivalModeSpeedField->Add("Moderate", 4); + miSurvivalModeSpeedField->Add("Fast", 6); + miSurvivalModeSpeedField->Add("Very Fast", 8, false, false); + miSurvivalModeSpeedField->Add("Extremely Fast", 15, false, false); + miSurvivalModeSpeedField->Add("Insanely Fast", 30, false, false); miSurvivalModeSpeedField->SetData(&game_values.gamemodemenusettings.survival.speed, NULL, NULL); miSurvivalModeSpeedField->SetKey(game_values.gamemodemenusettings.survival.speed); @@ -972,22 +972,22 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Greed Mode Settings //*********************** miGreedModeCoinLife = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Coin Life", 400, 150); - miGreedModeCoinLife->Add("1 Second", 62, "", false, false, false); - miGreedModeCoinLife->Add("2 Seconds", 124, "", false, false, false); - miGreedModeCoinLife->Add("3 Seconds", 186, "", false, false); - miGreedModeCoinLife->Add("4 Seconds", 248, "", false, false); - miGreedModeCoinLife->Add("5 Seconds", 310, "", false, false); - miGreedModeCoinLife->Add("6 Seconds", 372, "", false, false); - miGreedModeCoinLife->Add("7 Seconds", 434, "", false, false); - miGreedModeCoinLife->Add("8 Seconds", 496, "", false, false); - miGreedModeCoinLife->Add("9 Seconds", 558, "", false, false); - miGreedModeCoinLife->Add("10 Seconds", 620, "", false, false); - miGreedModeCoinLife->Add("12 Seconds", 744, "", false, false); - miGreedModeCoinLife->Add("15 Seconds", 930, "", false, false); - miGreedModeCoinLife->Add("18 Seconds", 1116, "", false, false); - miGreedModeCoinLife->Add("20 Seconds", 1240, "", false, false); - miGreedModeCoinLife->Add("25 Seconds", 1550, "", false, false); - miGreedModeCoinLife->Add("30 Seconds", 1860, "", false, false); + miGreedModeCoinLife->Add("1 Second", 62, false, false); + miGreedModeCoinLife->Add("2 Seconds", 124, false, false); + miGreedModeCoinLife->Add("3 Seconds", 186); + miGreedModeCoinLife->Add("4 Seconds", 248); + miGreedModeCoinLife->Add("5 Seconds", 310); + miGreedModeCoinLife->Add("6 Seconds", 372); + miGreedModeCoinLife->Add("7 Seconds", 434); + miGreedModeCoinLife->Add("8 Seconds", 496); + miGreedModeCoinLife->Add("9 Seconds", 558); + miGreedModeCoinLife->Add("10 Seconds", 620); + miGreedModeCoinLife->Add("12 Seconds", 744); + miGreedModeCoinLife->Add("15 Seconds", 930); + miGreedModeCoinLife->Add("18 Seconds", 1116); + miGreedModeCoinLife->Add("20 Seconds", 1240); + miGreedModeCoinLife->Add("25 Seconds", 1550); + miGreedModeCoinLife->Add("30 Seconds", 1860); miGreedModeCoinLife->SetData(&game_values.gamemodemenusettings.greed.coinlife, NULL, NULL); miGreedModeCoinLife->SetKey(game_values.gamemodemenusettings.greed.coinlife); @@ -999,37 +999,37 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModeOwnCoins->setAutoAdvance(true); miGreedModeMultiplier = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Multipler", 400, 150); - miGreedModeMultiplier->Add("0.5", 1, "", false, false, false); - miGreedModeMultiplier->Add("1", 2, "", false, false); - miGreedModeMultiplier->Add("1.5", 3, "", false, false); - miGreedModeMultiplier->Add("2", 4, "", false, false); - miGreedModeMultiplier->Add("2.5", 5, "", false, false, false); - miGreedModeMultiplier->Add("3", 6, "", false, false, false); + miGreedModeMultiplier->Add("0.5", 1, false, false); + miGreedModeMultiplier->Add("1", 2); + miGreedModeMultiplier->Add("1.5", 3); + miGreedModeMultiplier->Add("2", 4); + miGreedModeMultiplier->Add("2.5", 5, false, false); + miGreedModeMultiplier->Add("3", 6, false, false); miGreedModeMultiplier->SetData(&game_values.gamemodemenusettings.greed.multiplier, NULL, NULL); miGreedModeMultiplier->SetKey(game_values.gamemodemenusettings.greed.multiplier); miGreedModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Extra Coins", 400, 150, 384); - miGreedModePercentExtraCoin->Add("0", 0, "", false, false, false); - miGreedModePercentExtraCoin->Add("5", 5, "", false, false, false); - miGreedModePercentExtraCoin->Add("10", 10, "", false, false); - miGreedModePercentExtraCoin->Add("15", 15, "", false, false); - miGreedModePercentExtraCoin->Add("20", 20, "", false, false); - miGreedModePercentExtraCoin->Add("25", 25, "", false, false); - miGreedModePercentExtraCoin->Add("30", 30, "", false, false); - miGreedModePercentExtraCoin->Add("35", 35, "", false, false); - miGreedModePercentExtraCoin->Add("40", 40, "", false, false); - miGreedModePercentExtraCoin->Add("45", 45, "", false, false); - miGreedModePercentExtraCoin->Add("50", 50, "", false, false); - miGreedModePercentExtraCoin->Add("55", 55, "", false, false, false); - miGreedModePercentExtraCoin->Add("60", 60, "", false, false, false); - miGreedModePercentExtraCoin->Add("65", 65, "", false, false, false); - miGreedModePercentExtraCoin->Add("70", 70, "", false, false, false); - miGreedModePercentExtraCoin->Add("75", 75, "", false, false, false); - miGreedModePercentExtraCoin->Add("80", 80, "", false, false, false); - miGreedModePercentExtraCoin->Add("85", 85, "", false, false, false); - miGreedModePercentExtraCoin->Add("90", 90, "", false, false, false); - miGreedModePercentExtraCoin->Add("95", 95, "", false, false, false); - miGreedModePercentExtraCoin->Add("100", 100, "", false, false, false); + miGreedModePercentExtraCoin->Add("0", 0, false, false); + miGreedModePercentExtraCoin->Add("5", 5, false, false); + miGreedModePercentExtraCoin->Add("10", 10); + miGreedModePercentExtraCoin->Add("15", 15); + miGreedModePercentExtraCoin->Add("20", 20); + miGreedModePercentExtraCoin->Add("25", 25); + miGreedModePercentExtraCoin->Add("30", 30); + miGreedModePercentExtraCoin->Add("35", 35); + miGreedModePercentExtraCoin->Add("40", 40); + miGreedModePercentExtraCoin->Add("45", 45); + miGreedModePercentExtraCoin->Add("50", 50); + miGreedModePercentExtraCoin->Add("55", 55, false, false); + miGreedModePercentExtraCoin->Add("60", 60, false, false); + miGreedModePercentExtraCoin->Add("65", 65, false, false); + miGreedModePercentExtraCoin->Add("70", 70, false, false); + miGreedModePercentExtraCoin->Add("75", 75, false, false); + miGreedModePercentExtraCoin->Add("80", 80, false, false); + miGreedModePercentExtraCoin->Add("85", 85, false, false); + miGreedModePercentExtraCoin->Add("90", 90, false, false); + miGreedModePercentExtraCoin->Add("95", 95, false, false); + miGreedModePercentExtraCoin->Add("100", 100, false, false); miGreedModePercentExtraCoin->SetData(&game_values.gamemodemenusettings.greed.percentextracoin, NULL, NULL); miGreedModePercentExtraCoin->SetKey(game_values.gamemodemenusettings.greed.percentextracoin); miGreedModePercentExtraCoin->SetNoWrap(true); @@ -1060,57 +1060,57 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Health Mode Settings //*********************** miHealthModeStartLife = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Start Life", 400, 150); - miHealthModeStartLife->Add("2", 2, "", false, false, false); - miHealthModeStartLife->Add("3", 3, "", false, false, false); - miHealthModeStartLife->Add("4", 4, "", false, false); - miHealthModeStartLife->Add("5", 5, "", false, false); - miHealthModeStartLife->Add("6", 6, "", false, false); - miHealthModeStartLife->Add("7", 7, "", false, false, false); - miHealthModeStartLife->Add("8", 8, "", false, false, false); - miHealthModeStartLife->Add("9", 9, "", false, false, false); - miHealthModeStartLife->Add("10", 10, "", false, false, false); + miHealthModeStartLife->Add("2", 2, false, false); + miHealthModeStartLife->Add("3", 3, false, false); + miHealthModeStartLife->Add("4", 4); + miHealthModeStartLife->Add("5", 5); + miHealthModeStartLife->Add("6", 6); + miHealthModeStartLife->Add("7", 7, false, false); + miHealthModeStartLife->Add("8", 8, false, false); + miHealthModeStartLife->Add("9", 9, false, false); + miHealthModeStartLife->Add("10", 10, false, false); miHealthModeStartLife->SetData(&game_values.gamemodemenusettings.health.startlife, NULL, NULL); miHealthModeStartLife->SetKey(game_values.gamemodemenusettings.health.startlife); miHealthModeStartLife->SetNoWrap(true); miHealthModeStartLife->SetItemChangedCode(MENU_CODE_HEALTH_MODE_START_LIFE_CHANGED); miHealthModeMaxLife = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Max Life", 400, 150); - miHealthModeMaxLife->Add("2", 2, "", false, false, false); - miHealthModeMaxLife->Add("3", 3, "", false, false, false); - miHealthModeMaxLife->Add("4", 4, "", false, false, false); - miHealthModeMaxLife->Add("5", 5, "", false, false, false); - miHealthModeMaxLife->Add("6", 6, "", false, false); - miHealthModeMaxLife->Add("7", 7, "", false, false); - miHealthModeMaxLife->Add("8", 8, "", false, false); - miHealthModeMaxLife->Add("9", 9, "", false, false); - miHealthModeMaxLife->Add("10", 10, "", false, false); + miHealthModeMaxLife->Add("2", 2, false, false); + miHealthModeMaxLife->Add("3", 3, false, false); + miHealthModeMaxLife->Add("4", 4, false, false); + miHealthModeMaxLife->Add("5", 5, false, false); + miHealthModeMaxLife->Add("6", 6); + miHealthModeMaxLife->Add("7", 7); + miHealthModeMaxLife->Add("8", 8); + miHealthModeMaxLife->Add("9", 9); + miHealthModeMaxLife->Add("10", 10); miHealthModeMaxLife->SetData(&game_values.gamemodemenusettings.health.maxlife, NULL, NULL); miHealthModeMaxLife->SetKey(game_values.gamemodemenusettings.health.maxlife); miHealthModeMaxLife->SetNoWrap(true); miHealthModeMaxLife->SetItemChangedCode(MENU_CODE_HEALTH_MODE_MAX_LIFE_CHANGED); miHealthModePercentExtraLife = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Life", 400, 150, 384); - miHealthModePercentExtraLife->Add("0", 0, "", false, false, false); - miHealthModePercentExtraLife->Add("5", 5, "", false, false, false); - miHealthModePercentExtraLife->Add("10", 10, "", false, false); - miHealthModePercentExtraLife->Add("15", 15, "", false, false); - miHealthModePercentExtraLife->Add("20", 20, "", false, false); - miHealthModePercentExtraLife->Add("25", 25, "", false, false); - miHealthModePercentExtraLife->Add("30", 30, "", false, false); - miHealthModePercentExtraLife->Add("35", 35, "", false, false); - miHealthModePercentExtraLife->Add("40", 40, "", false, false); - miHealthModePercentExtraLife->Add("45", 45, "", false, false); - miHealthModePercentExtraLife->Add("50", 50, "", false, false); - miHealthModePercentExtraLife->Add("55", 55, "", false, false, false); - miHealthModePercentExtraLife->Add("60", 60, "", false, false, false); - miHealthModePercentExtraLife->Add("65", 65, "", false, false, false); - miHealthModePercentExtraLife->Add("70", 70, "", false, false, false); - miHealthModePercentExtraLife->Add("75", 75, "", false, false, false); - miHealthModePercentExtraLife->Add("80", 80, "", false, false, false); - miHealthModePercentExtraLife->Add("85", 85, "", false, false, false); - miHealthModePercentExtraLife->Add("90", 90, "", false, false, false); - miHealthModePercentExtraLife->Add("95", 95, "", false, false, false); - miHealthModePercentExtraLife->Add("100", 100, "", false, false, false); + miHealthModePercentExtraLife->Add("0", 0, false, false); + miHealthModePercentExtraLife->Add("5", 5, false, false); + miHealthModePercentExtraLife->Add("10", 10); + miHealthModePercentExtraLife->Add("15", 15); + miHealthModePercentExtraLife->Add("20", 20); + miHealthModePercentExtraLife->Add("25", 25); + miHealthModePercentExtraLife->Add("30", 30); + miHealthModePercentExtraLife->Add("35", 35); + miHealthModePercentExtraLife->Add("40", 40); + miHealthModePercentExtraLife->Add("45", 45); + miHealthModePercentExtraLife->Add("50", 50); + miHealthModePercentExtraLife->Add("55", 55, false, false); + miHealthModePercentExtraLife->Add("60", 60, false, false); + miHealthModePercentExtraLife->Add("65", 65, false, false); + miHealthModePercentExtraLife->Add("70", 70, false, false); + miHealthModePercentExtraLife->Add("75", 75, false, false); + miHealthModePercentExtraLife->Add("80", 80, false, false); + miHealthModePercentExtraLife->Add("85", 85, false, false); + miHealthModePercentExtraLife->Add("90", 90, false, false); + miHealthModePercentExtraLife->Add("95", 95, false, false); + miHealthModePercentExtraLife->Add("100", 100, false, false); miHealthModePercentExtraLife->SetData(&game_values.gamemodemenusettings.health.percentextralife, NULL, NULL); miHealthModePercentExtraLife->SetKey(game_values.gamemodemenusettings.health.percentextralife); miHealthModePercentExtraLife->SetNoWrap(true); @@ -1140,65 +1140,65 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miCollectionModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Limit", 400, 180); - miCollectionModeQuantityField->Add("1 Card", 1, "", false, false); - miCollectionModeQuantityField->Add("2 Cards", 2, "", false, false); - miCollectionModeQuantityField->Add("3 Cards", 3, "", false, false); - miCollectionModeQuantityField->Add("4 Cards", 4, "", false, false, false); - miCollectionModeQuantityField->Add("5 Cards", 5, "", false, false, false); - miCollectionModeQuantityField->Add("# Players - 1", 6, "", false, false); - miCollectionModeQuantityField->Add("# Players", 7, "", false, false); - miCollectionModeQuantityField->Add("# Players + 1", 8, "", false, false, false); - miCollectionModeQuantityField->Add("# Players + 2", 9, "", false, false, false); - miCollectionModeQuantityField->Add("# Players + 3", 10, "", false, false, false); + miCollectionModeQuantityField->Add("1 Card", 1); + miCollectionModeQuantityField->Add("2 Cards", 2); + miCollectionModeQuantityField->Add("3 Cards", 3); + miCollectionModeQuantityField->Add("4 Cards", 4, false, false); + miCollectionModeQuantityField->Add("5 Cards", 5, false, false); + miCollectionModeQuantityField->Add("# Players - 1", 6); + miCollectionModeQuantityField->Add("# Players", 7); + miCollectionModeQuantityField->Add("# Players + 1", 8, false, false); + miCollectionModeQuantityField->Add("# Players + 2", 9, false, false); + miCollectionModeQuantityField->Add("# Players + 3", 10, false, false); miCollectionModeQuantityField->SetData(&game_values.gamemodemenusettings.collection.quantity, NULL, NULL); miCollectionModeQuantityField->SetKey(game_values.gamemodemenusettings.collection.quantity); miCollectionModeRateField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Rate", 400, 180); - miCollectionModeRateField->Add("Instant", 0, "", false, false); - miCollectionModeRateField->Add("1 Second", 62, "", false, false); - miCollectionModeRateField->Add("2 Seconds", 124, "", false, false); - miCollectionModeRateField->Add("3 Seconds", 186, "", false, false); - miCollectionModeRateField->Add("5 Seconds", 310, "", false, false); - miCollectionModeRateField->Add("10 Seconds", 620, "", false, false, false); - miCollectionModeRateField->Add("15 Seconds", 930, "", false, false, false); - miCollectionModeRateField->Add("20 Seconds", 1240, "", false, false, false); - miCollectionModeRateField->Add("25 Seconds", 1550, "", false, false, false); - miCollectionModeRateField->Add("30 Seconds", 1860, "", false, false, false); + miCollectionModeRateField->Add("Instant", 0); + miCollectionModeRateField->Add("1 Second", 62); + miCollectionModeRateField->Add("2 Seconds", 124); + miCollectionModeRateField->Add("3 Seconds", 186); + miCollectionModeRateField->Add("5 Seconds", 310); + miCollectionModeRateField->Add("10 Seconds", 620, false, false); + miCollectionModeRateField->Add("15 Seconds", 930, false, false); + miCollectionModeRateField->Add("20 Seconds", 1240, false, false); + miCollectionModeRateField->Add("25 Seconds", 1550, false, false); + miCollectionModeRateField->Add("30 Seconds", 1860, false, false); miCollectionModeRateField->SetData(&game_values.gamemodemenusettings.collection.rate, NULL, NULL); miCollectionModeRateField->SetKey(game_values.gamemodemenusettings.collection.rate); miCollectionModeBankTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Bank Time", 400, 180); - miCollectionModeBankTimeField->Add("Instant", 0, "", false, false, false); - miCollectionModeBankTimeField->Add("1 Second", 62, "", false, false, false); - miCollectionModeBankTimeField->Add("2 Seconds", 124, "", false, false); - miCollectionModeBankTimeField->Add("3 Seconds", 186, "", false, false); - miCollectionModeBankTimeField->Add("4 Seconds", 248, "", false, false); - miCollectionModeBankTimeField->Add("5 Seconds", 310, "", false, false); - miCollectionModeBankTimeField->Add("6 Seconds", 372, "", false, false, false); - miCollectionModeBankTimeField->Add("7 Seconds", 434, "", false, false, false); - miCollectionModeBankTimeField->Add("8 Seconds", 496, "", false, false, false); - miCollectionModeBankTimeField->Add("9 Seconds", 558, "", false, false, false); - miCollectionModeBankTimeField->Add("10 Seconds", 620, "", false, false, false); + miCollectionModeBankTimeField->Add("Instant", 0, false, false); + miCollectionModeBankTimeField->Add("1 Second", 62, false, false); + miCollectionModeBankTimeField->Add("2 Seconds", 124); + miCollectionModeBankTimeField->Add("3 Seconds", 186); + miCollectionModeBankTimeField->Add("4 Seconds", 248); + miCollectionModeBankTimeField->Add("5 Seconds", 310); + miCollectionModeBankTimeField->Add("6 Seconds", 372, false, false); + miCollectionModeBankTimeField->Add("7 Seconds", 434, false, false); + miCollectionModeBankTimeField->Add("8 Seconds", 496, false, false); + miCollectionModeBankTimeField->Add("9 Seconds", 558, false, false); + miCollectionModeBankTimeField->Add("10 Seconds", 620, false, false); miCollectionModeBankTimeField->SetData(&game_values.gamemodemenusettings.collection.banktime, NULL, NULL); miCollectionModeBankTimeField->SetKey(game_values.gamemodemenusettings.collection.banktime); miCollectionModeCardLifeField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Card Life", 400, 180); - miCollectionModeCardLifeField->Add("1 Second", 62, "", false, false, false); - miCollectionModeCardLifeField->Add("2 Seconds", 124, "", false, false, false); - miCollectionModeCardLifeField->Add("3 Seconds", 186, "", false, false); - miCollectionModeCardLifeField->Add("4 Seconds", 248, "", false, false); - miCollectionModeCardLifeField->Add("5 Seconds", 310, "", false, false); - miCollectionModeCardLifeField->Add("6 Seconds", 372, "", false, false); - miCollectionModeCardLifeField->Add("7 Seconds", 434, "", false, false); - miCollectionModeCardLifeField->Add("8 Seconds", 496, "", false, false); - miCollectionModeCardLifeField->Add("9 Seconds", 558, "", false, false); - miCollectionModeCardLifeField->Add("10 Seconds", 620, "", false, false); - miCollectionModeCardLifeField->Add("12 Seconds", 744, "", false, false); - miCollectionModeCardLifeField->Add("15 Seconds", 930, "", false, false); - miCollectionModeCardLifeField->Add("18 Seconds", 1116, "", false, false); - miCollectionModeCardLifeField->Add("20 Seconds", 1240, "", false, false); - miCollectionModeCardLifeField->Add("25 Seconds", 1550, "", false, false); - miCollectionModeCardLifeField->Add("30 Seconds", 1860, "", false, false); + miCollectionModeCardLifeField->Add("1 Second", 62, false, false); + miCollectionModeCardLifeField->Add("2 Seconds", 124, false, false); + miCollectionModeCardLifeField->Add("3 Seconds", 186); + miCollectionModeCardLifeField->Add("4 Seconds", 248); + miCollectionModeCardLifeField->Add("5 Seconds", 310); + miCollectionModeCardLifeField->Add("6 Seconds", 372); + miCollectionModeCardLifeField->Add("7 Seconds", 434); + miCollectionModeCardLifeField->Add("8 Seconds", 496); + miCollectionModeCardLifeField->Add("9 Seconds", 558); + miCollectionModeCardLifeField->Add("10 Seconds", 620); + miCollectionModeCardLifeField->Add("12 Seconds", 744); + miCollectionModeCardLifeField->Add("15 Seconds", 930); + miCollectionModeCardLifeField->Add("18 Seconds", 1116); + miCollectionModeCardLifeField->Add("20 Seconds", 1240); + miCollectionModeCardLifeField->Add("25 Seconds", 1550); + miCollectionModeCardLifeField->Add("30 Seconds", 1860); miCollectionModeCardLifeField->SetData(&game_values.gamemodemenusettings.collection.cardlife, NULL, NULL); miCollectionModeCardLifeField->SetKey(game_values.gamemodemenusettings.collection.cardlife); @@ -1227,24 +1227,24 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miChaseModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Speed", 400, 180); - miChaseModeSpeedField->Add("Very Slow", 3, "", false, false, false); - miChaseModeSpeedField->Add("Slow", 4, "", false, false); - miChaseModeSpeedField->Add("Moderate", 5, "", false, false); - miChaseModeSpeedField->Add("Fast", 6, "", false, false); - miChaseModeSpeedField->Add("Very Fast", 7, "", false, false); - miChaseModeSpeedField->Add("Extremely Fast", 8, "", false, false, false); - miChaseModeSpeedField->Add("Insanely Fast", 10, "", false, false, false); + miChaseModeSpeedField->Add("Very Slow", 3, false, false); + miChaseModeSpeedField->Add("Slow", 4); + miChaseModeSpeedField->Add("Moderate", 5); + miChaseModeSpeedField->Add("Fast", 6); + miChaseModeSpeedField->Add("Very Fast", 7); + miChaseModeSpeedField->Add("Extremely Fast", 8, false, false); + miChaseModeSpeedField->Add("Insanely Fast", 10, false, false); miChaseModeSpeedField->SetData(&game_values.gamemodemenusettings.chase.phantospeed, NULL, NULL); miChaseModeSpeedField->SetKey(game_values.gamemodemenusettings.chase.phantospeed); for (short iPhanto = 0; iPhanto < 3; iPhanto++) { miChaseModeQuantitySlider[iPhanto] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_phanto, 120, 200 + 40 * iPhanto, 400, iPhanto); - miChaseModeQuantitySlider[iPhanto]->Add("", 0, "", false, false, iPhanto == 0 ? false : true); - miChaseModeQuantitySlider[iPhanto]->Add("", 1, "", false, false); - miChaseModeQuantitySlider[iPhanto]->Add("", 2, "", false, false); - miChaseModeQuantitySlider[iPhanto]->Add("", 3, "", false, false, false); - miChaseModeQuantitySlider[iPhanto]->Add("", 4, "", false, false, false); - miChaseModeQuantitySlider[iPhanto]->Add("", 5, "", false, false, false); + miChaseModeQuantitySlider[iPhanto]->Add("", 0, false, iPhanto == 0 ? false : true); + miChaseModeQuantitySlider[iPhanto]->Add("", 1); + miChaseModeQuantitySlider[iPhanto]->Add("", 2); + miChaseModeQuantitySlider[iPhanto]->Add("", 3, false, false); + miChaseModeQuantitySlider[iPhanto]->Add("", 4, false, false); + miChaseModeQuantitySlider[iPhanto]->Add("", 5, false, false); miChaseModeQuantitySlider[iPhanto]->SetNoWrap(true); miChaseModeQuantitySlider[iPhanto]->SetData(&game_values.gamemodemenusettings.chase.phantoquantity[iPhanto], NULL, NULL); miChaseModeQuantitySlider[iPhanto]->SetKey(game_values.gamemodemenusettings.chase.phantoquantity[iPhanto]); @@ -1285,24 +1285,24 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miShyGuyTagModeTagOnSuicideField->setAutoAdvance(true); miShyGuyTagModeTagOnStompField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Tag Transfer", 400, 180); - miShyGuyTagModeTagOnStompField->Add("Touch Only", 0, "", false, false); - miShyGuyTagModeTagOnStompField->Add("Kills Only", 1, "", false, false); - miShyGuyTagModeTagOnStompField->Add("Touch and Kills", 2, "", false, false); + miShyGuyTagModeTagOnStompField->Add("Touch Only", 0); + miShyGuyTagModeTagOnStompField->Add("Kills Only", 1); + miShyGuyTagModeTagOnStompField->Add("Touch and Kills", 2); miShyGuyTagModeTagOnStompField->SetData(&game_values.gamemodemenusettings.shyguytag.tagtransfer, NULL, NULL); miShyGuyTagModeTagOnStompField->SetKey(game_values.gamemodemenusettings.shyguytag.tagtransfer); miShyGuyTagModeFreeTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Free Time", 400, 180); - miShyGuyTagModeFreeTimeField->Add("Instant", 0, "", false, false); - miShyGuyTagModeFreeTimeField->Add("1 Second", 1, "", false, false); - miShyGuyTagModeFreeTimeField->Add("2 Seconds", 2, "", false, false); - miShyGuyTagModeFreeTimeField->Add("3 Seconds", 3, "", false, false); - miShyGuyTagModeFreeTimeField->Add("4 Seconds", 4, "", false, false); - miShyGuyTagModeFreeTimeField->Add("5 Seconds", 5, "", false, false); - miShyGuyTagModeFreeTimeField->Add("6 Seconds", 6, "", false, false); - miShyGuyTagModeFreeTimeField->Add("7 Seconds", 7, "", false, false); - miShyGuyTagModeFreeTimeField->Add("8 Seconds", 8, "", false, false); - miShyGuyTagModeFreeTimeField->Add("9 Seconds", 9, "", false, false); - miShyGuyTagModeFreeTimeField->Add("10 Seconds", 10, "", false, false); + miShyGuyTagModeFreeTimeField->Add("Instant", 0); + miShyGuyTagModeFreeTimeField->Add("1 Second", 1); + miShyGuyTagModeFreeTimeField->Add("2 Seconds", 2); + miShyGuyTagModeFreeTimeField->Add("3 Seconds", 3); + miShyGuyTagModeFreeTimeField->Add("4 Seconds", 4); + miShyGuyTagModeFreeTimeField->Add("5 Seconds", 5); + miShyGuyTagModeFreeTimeField->Add("6 Seconds", 6); + miShyGuyTagModeFreeTimeField->Add("7 Seconds", 7); + miShyGuyTagModeFreeTimeField->Add("8 Seconds", 8); + miShyGuyTagModeFreeTimeField->Add("9 Seconds", 9); + miShyGuyTagModeFreeTimeField->Add("10 Seconds", 10); miShyGuyTagModeFreeTimeField->SetData(&game_values.gamemodemenusettings.shyguytag.freetime, NULL, NULL); miShyGuyTagModeFreeTimeField->SetKey(game_values.gamemodemenusettings.shyguytag.freetime); @@ -1331,42 +1331,42 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miBossModeTypeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Type", 400, 180); - miBossModeTypeField->Add("Hammer", 0, "", false, false); - miBossModeTypeField->Add("Bomb", 1, "", false, false); - miBossModeTypeField->Add("Fire", 2, "", false, false); + miBossModeTypeField->Add("Hammer", 0); + miBossModeTypeField->Add("Bomb", 1); + miBossModeTypeField->Add("Fire", 2); miBossModeTypeField->SetData(&game_values.gamemodemenusettings.boss.bosstype, NULL, NULL); miBossModeTypeField->SetKey(game_values.gamemodemenusettings.boss.bosstype); miBossModeDifficultyField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Difficulty", 400, 180); - miBossModeDifficultyField->Add("Very Easy", 0, "", false, false, false); - miBossModeDifficultyField->Add("Easy", 1, "", false, false); - miBossModeDifficultyField->Add("Moderate", 2, "", false, false); - miBossModeDifficultyField->Add("Hard", 3, "", false, false); - miBossModeDifficultyField->Add("Very Hard", 4, "", false, false, false); + miBossModeDifficultyField->Add("Very Easy", 0, false, false); + miBossModeDifficultyField->Add("Easy", 1); + miBossModeDifficultyField->Add("Moderate", 2); + miBossModeDifficultyField->Add("Hard", 3); + miBossModeDifficultyField->Add("Very Hard", 4, false, false); miBossModeDifficultyField->SetData(&game_values.gamemodemenusettings.boss.difficulty, NULL, NULL); miBossModeDifficultyField->SetKey(game_values.gamemodemenusettings.boss.difficulty); miBossModeHitPointsField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Health", 400, 180); - miBossModeHitPointsField->Add("1", 1, "", false, false, false); - miBossModeHitPointsField->Add("2", 2, "", false, false, false); - miBossModeHitPointsField->Add("3", 3, "", false, false); - miBossModeHitPointsField->Add("4", 4, "", false, false); - miBossModeHitPointsField->Add("5", 5, "", false, false); - miBossModeHitPointsField->Add("6", 6, "", false, false); - miBossModeHitPointsField->Add("7", 7, "", false, false); - miBossModeHitPointsField->Add("8", 8, "", false, false); - miBossModeHitPointsField->Add("9", 9, "", false, false, false); - miBossModeHitPointsField->Add("10", 10, "", false, false, false); - miBossModeHitPointsField->Add("11", 11, "", false, false, false); - miBossModeHitPointsField->Add("12", 12, "", false, false, false); - miBossModeHitPointsField->Add("13", 13, "", false, false, false); - miBossModeHitPointsField->Add("14", 14, "", false, false, false); - miBossModeHitPointsField->Add("15", 15, "", false, false, false); - miBossModeHitPointsField->Add("16", 16, "", false, false, false); - miBossModeHitPointsField->Add("17", 17, "", false, false, false); - miBossModeHitPointsField->Add("18", 18, "", false, false, false); - miBossModeHitPointsField->Add("19", 19, "", false, false, false); - miBossModeHitPointsField->Add("20", 20, "", false, false, false); + miBossModeHitPointsField->Add("1", 1, false, false); + miBossModeHitPointsField->Add("2", 2, false, false); + miBossModeHitPointsField->Add("3", 3); + miBossModeHitPointsField->Add("4", 4); + miBossModeHitPointsField->Add("5", 5); + miBossModeHitPointsField->Add("6", 6); + miBossModeHitPointsField->Add("7", 7); + miBossModeHitPointsField->Add("8", 8); + miBossModeHitPointsField->Add("9", 9, false, false); + miBossModeHitPointsField->Add("10", 10, false, false); + miBossModeHitPointsField->Add("11", 11, false, false); + miBossModeHitPointsField->Add("12", 12, false, false); + miBossModeHitPointsField->Add("13", 13, false, false); + miBossModeHitPointsField->Add("14", 14, false, false); + miBossModeHitPointsField->Add("15", 15, false, false); + miBossModeHitPointsField->Add("16", 16, false, false); + miBossModeHitPointsField->Add("17", 17, false, false); + miBossModeHitPointsField->Add("18", 18, false, false); + miBossModeHitPointsField->Add("19", 19, false, false); + miBossModeHitPointsField->Add("20", 20, false, false); miBossModeHitPointsField->SetData(&game_values.gamemodemenusettings.boss.hitpoints, NULL, NULL); miBossModeHitPointsField->SetKey(game_values.gamemodemenusettings.boss.hitpoints); diff --git a/src/smw/menu/options/EyeCandyOptionsMenu.cpp b/src/smw/menu/options/EyeCandyOptionsMenu.cpp index 09044b69..08585f86 100644 --- a/src/smw/menu/options/EyeCandyOptionsMenu.cpp +++ b/src/smw/menu/options/EyeCandyOptionsMenu.cpp @@ -15,59 +15,59 @@ UI_EyeCandyOptionsMenu::UI_EyeCandyOptionsMenu() : UI_Menu() { miSpawnStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 80, "Spawn Style", 500, 220); - miSpawnStyleField->Add("Instant", 0, "", false, false); - miSpawnStyleField->Add("Door", 1, "", false, false); - miSpawnStyleField->Add("Swirl", 2, "", false, false); + miSpawnStyleField->Add("Instant", 0); + miSpawnStyleField->Add("Door", 1); + miSpawnStyleField->Add("Swirl", 2); miSpawnStyleField->SetData(&game_values.spawnstyle, NULL, NULL); miSpawnStyleField->SetKey(game_values.spawnstyle); miAwardStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Award Style", 500, 220); - miAwardStyleField->Add("None", 0, "", false, false); - miAwardStyleField->Add("Fireworks", 1, "", false, false); - miAwardStyleField->Add("Spiral", 2, "", false, false); - miAwardStyleField->Add("Ring", 3, "", false, false); - miAwardStyleField->Add("Souls", 4, "", false, false); - miAwardStyleField->Add("Text", 5, "", false, false); + miAwardStyleField->Add("None", 0); + miAwardStyleField->Add("Fireworks", 1); + miAwardStyleField->Add("Spiral", 2); + miAwardStyleField->Add("Ring", 3); + miAwardStyleField->Add("Souls", 4); + miAwardStyleField->Add("Text", 5); miAwardStyleField->SetData(&game_values.awardstyle, NULL, NULL); miAwardStyleField->SetKey(game_values.awardstyle); miScoreStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Score Location", 500, 220); - miScoreStyleField->Add("Top", 0, "", false, false); - miScoreStyleField->Add("Bottom", 1, "", false, false); - miScoreStyleField->Add("Corners", 2, "", false, false); + miScoreStyleField->Add("Top", 0); + miScoreStyleField->Add("Bottom", 1); + miScoreStyleField->Add("Corners", 2); miScoreStyleField->SetData(&game_values.scoreboardstyle, NULL, NULL); miScoreStyleField->SetKey(game_values.scoreboardstyle); miCrunchField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Crunch", 500, 220); - miCrunchField->Add("Off", 0, "", false, false); + miCrunchField->Add("Off", 0); miCrunchField->Add("On", 1, "", true, false); miCrunchField->SetData(NULL, NULL, &game_values.screencrunch); miCrunchField->SetKey(game_values.screencrunch ? 1 : 0); miCrunchField->SetAutoAdvance(true); miWinningCrownField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Leader Crown", 500, 220); - miWinningCrownField->Add("Off", 0, "", false, false); + miWinningCrownField->Add("Off", 0); miWinningCrownField->Add("On", 1, "", true, false); miWinningCrownField->SetData(NULL, NULL, &game_values.showwinningcrown); miWinningCrownField->SetKey(game_values.showwinningcrown ? 1 : 0); miWinningCrownField->SetAutoAdvance(true); miStartCountDownField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Start Countdown", 500, 220); - miStartCountDownField->Add("Off", 0, "", false, false); + miStartCountDownField->Add("Off", 0); miStartCountDownField->Add("On", 1, "", true, false); miStartCountDownField->SetData(NULL, NULL, &game_values.startgamecountdown); miStartCountDownField->SetKey(game_values.startgamecountdown ? 1 : 0); miStartCountDownField->SetAutoAdvance(true); miStartModeDisplayField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Show Mode", 500, 220); - miStartModeDisplayField->Add("Off", 0, "", false, false); + miStartModeDisplayField->Add("Off", 0); miStartModeDisplayField->Add("On", 1, "", true, false); miStartModeDisplayField->SetData(NULL, NULL, &game_values.startmodedisplay); miStartModeDisplayField->SetKey(game_values.startmodedisplay ? 1 : 0); miStartModeDisplayField->SetAutoAdvance(true); miDeadTeamNoticeField = new MI_SelectField(&rm->spr_selectfield, 70, 360, "Dead Team Notice", 500, 220); - miDeadTeamNoticeField->Add("Off", 0, "", false, false); + miDeadTeamNoticeField->Add("Off", 0); miDeadTeamNoticeField->Add("On", 1, "", true, false); miDeadTeamNoticeField->SetData(NULL, NULL, &game_values.deadteamnotice); miDeadTeamNoticeField->SetKey(game_values.deadteamnotice ? 1 : 0); diff --git a/src/smw/menu/options/GameplayOptionsMenu.cpp b/src/smw/menu/options/GameplayOptionsMenu.cpp index 57b6e999..cb8b18e3 100644 --- a/src/smw/menu/options/GameplayOptionsMenu.cpp +++ b/src/smw/menu/options/GameplayOptionsMenu.cpp @@ -15,122 +15,122 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() : UI_Menu() { miRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 40, "Respawn Time", 500, 220); - miRespawnField->Add("Instant", 0, "", false, false); - miRespawnField->Add("0.5 Seconds", 1, "", false, false); - miRespawnField->Add("1.0 Seconds", 2, "", false, false); - miRespawnField->Add("1.5 Seconds", 3, "", false, false); - miRespawnField->Add("2.0 Seconds", 4, "", false, false); - miRespawnField->Add("2.5 Seconds", 5, "", false, false); - miRespawnField->Add("3.0 Seconds", 6, "", false, false); - miRespawnField->Add("3.5 Seconds", 7, "", false, false); - miRespawnField->Add("4.0 Seconds", 8, "", false, false); - miRespawnField->Add("4.5 Seconds", 9, "", false, false); - miRespawnField->Add("5.0 Seconds", 10, "", false, false); - miRespawnField->Add("5.5 Seconds", 11, "", false, false); - miRespawnField->Add("6.0 Seconds", 12, "", false, false); - miRespawnField->Add("6.5 Seconds", 13, "", false, false); - miRespawnField->Add("7.0 Seconds", 14, "", false, false); - miRespawnField->Add("7.5 Seconds", 15, "", false, false); - miRespawnField->Add("8.0 Seconds", 16, "", false, false); - miRespawnField->Add("8.5 Seconds", 17, "", false, false); - miRespawnField->Add("9.0 Seconds", 18, "", false, false); - miRespawnField->Add("9.5 Seconds", 19, "", false, false); - miRespawnField->Add("10.0 Seconds", 20, "", false, false); + miRespawnField->Add("Instant", 0); + miRespawnField->Add("0.5 Seconds", 1); + miRespawnField->Add("1.0 Seconds", 2); + miRespawnField->Add("1.5 Seconds", 3); + miRespawnField->Add("2.0 Seconds", 4); + miRespawnField->Add("2.5 Seconds", 5); + miRespawnField->Add("3.0 Seconds", 6); + miRespawnField->Add("3.5 Seconds", 7); + miRespawnField->Add("4.0 Seconds", 8); + miRespawnField->Add("4.5 Seconds", 9); + miRespawnField->Add("5.0 Seconds", 10); + miRespawnField->Add("5.5 Seconds", 11); + miRespawnField->Add("6.0 Seconds", 12); + miRespawnField->Add("6.5 Seconds", 13); + miRespawnField->Add("7.0 Seconds", 14); + miRespawnField->Add("7.5 Seconds", 15); + miRespawnField->Add("8.0 Seconds", 16); + miRespawnField->Add("8.5 Seconds", 17); + miRespawnField->Add("9.0 Seconds", 18); + miRespawnField->Add("9.5 Seconds", 19); + miRespawnField->Add("10.0 Seconds", 20); miRespawnField->SetData(&game_values.respawn, NULL, NULL); miRespawnField->SetKey(game_values.respawn); miShieldStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 80, "Shield Style", 500, 220); - miShieldStyleField->Add("No Shield", 0, "", false, false); - miShieldStyleField->Add("Soft", 1, "", false, false); - miShieldStyleField->Add("Soft with Stomp", 2, "", false, false); - miShieldStyleField->Add("Hard", 3, "", false, false); + miShieldStyleField->Add("No Shield", 0); + miShieldStyleField->Add("Soft", 1); + miShieldStyleField->Add("Soft with Stomp", 2); + miShieldStyleField->Add("Hard", 3); miShieldStyleField->SetData(&game_values.shieldstyle, NULL, NULL); miShieldStyleField->SetKey(game_values.shieldstyle); miShieldTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Shield Time", 500, 220); - miShieldTimeField->Add("0.5 Seconds", 31, "", false, false); - miShieldTimeField->Add("1.0 Seconds", 62, "", false, false); - miShieldTimeField->Add("1.5 Seconds", 93, "", false, false); - miShieldTimeField->Add("2.0 Seconds", 124, "", false, false); - miShieldTimeField->Add("2.5 Seconds", 155, "", false, false); - miShieldTimeField->Add("3.0 Seconds", 186, "", false, false); - miShieldTimeField->Add("3.5 Seconds", 217, "", false, false); - miShieldTimeField->Add("4.0 Seconds", 248, "", false, false); - miShieldTimeField->Add("4.5 Seconds", 279, "", false, false); - miShieldTimeField->Add("5.0 Seconds", 310, "", false, false); + miShieldTimeField->Add("0.5 Seconds", 31); + miShieldTimeField->Add("1.0 Seconds", 62); + miShieldTimeField->Add("1.5 Seconds", 93); + miShieldTimeField->Add("2.0 Seconds", 124); + miShieldTimeField->Add("2.5 Seconds", 155); + miShieldTimeField->Add("3.0 Seconds", 186); + miShieldTimeField->Add("3.5 Seconds", 217); + miShieldTimeField->Add("4.0 Seconds", 248); + miShieldTimeField->Add("4.5 Seconds", 279); + miShieldTimeField->Add("5.0 Seconds", 310); miShieldTimeField->SetData(&game_values.shieldtime, NULL, NULL); miShieldTimeField->SetKey(game_values.shieldtime); miBoundsTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Bounds Time", 500, 220); - miBoundsTimeField->Add("Infinite", 0, "", false, false); - miBoundsTimeField->Add("1 Second", 1, "", false, false); - miBoundsTimeField->Add("2 Seconds", 2, "", false, false); - miBoundsTimeField->Add("3 Seconds", 3, "", false, false); - miBoundsTimeField->Add("4 Seconds", 4, "", false, false); - miBoundsTimeField->Add("5 Seconds", 5, "", false, false); - miBoundsTimeField->Add("6 Seconds", 6, "", false, false); - miBoundsTimeField->Add("7 Seconds", 7, "", false, false); - miBoundsTimeField->Add("8 Seconds", 8, "", false, false); - miBoundsTimeField->Add("9 Seconds", 9, "", false, false); - miBoundsTimeField->Add("10 Seconds", 10, "", false, false); + miBoundsTimeField->Add("Infinite", 0); + miBoundsTimeField->Add("1 Second", 1); + miBoundsTimeField->Add("2 Seconds", 2); + miBoundsTimeField->Add("3 Seconds", 3); + miBoundsTimeField->Add("4 Seconds", 4); + miBoundsTimeField->Add("5 Seconds", 5); + miBoundsTimeField->Add("6 Seconds", 6); + miBoundsTimeField->Add("7 Seconds", 7); + miBoundsTimeField->Add("8 Seconds", 8); + miBoundsTimeField->Add("9 Seconds", 9); + miBoundsTimeField->Add("10 Seconds", 10); miBoundsTimeField->SetData(&game_values.outofboundstime, NULL, NULL); miBoundsTimeField->SetKey(game_values.outofboundstime); miSuicideTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Suicide Time", 500, 220); - miSuicideTimeField->Add("Off", 0, "", false, false); - miSuicideTimeField->Add("3 Seconds", 186, "", false, false); - miSuicideTimeField->Add("5 Seconds", 310, "", false, false); - miSuicideTimeField->Add("8 Seconds", 496, "", false, false); - miSuicideTimeField->Add("10 Seconds", 620, "", false, false); - miSuicideTimeField->Add("15 Seconds", 930, "", false, false); - miSuicideTimeField->Add("20 Seconds", 1240, "", false, false); + miSuicideTimeField->Add("Off", 0); + miSuicideTimeField->Add("3 Seconds", 186); + miSuicideTimeField->Add("5 Seconds", 310); + miSuicideTimeField->Add("8 Seconds", 496); + miSuicideTimeField->Add("10 Seconds", 620); + miSuicideTimeField->Add("15 Seconds", 930); + miSuicideTimeField->Add("20 Seconds", 1240); miSuicideTimeField->SetData(&game_values.suicidetime, NULL, NULL); miSuicideTimeField->SetKey(game_values.suicidetime); miWarpLockStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Warp Lock Style", 500, 220); - miWarpLockStyleField->Add("Entrance Only", 0, "", false, false); - miWarpLockStyleField->Add("Exit Only", 1, "", false, false); - miWarpLockStyleField->Add("Entrance and Exit", 2, "", false, false); - miWarpLockStyleField->Add("Entire Connection", 3, "", false, false); - miWarpLockStyleField->Add("All Warps", 4, "", false, false); + miWarpLockStyleField->Add("Entrance Only", 0); + miWarpLockStyleField->Add("Exit Only", 1); + miWarpLockStyleField->Add("Entrance and Exit", 2); + miWarpLockStyleField->Add("Entire Connection", 3); + miWarpLockStyleField->Add("All Warps", 4); miWarpLockStyleField->SetData(&game_values.warplockstyle, NULL, NULL); miWarpLockStyleField->SetKey(game_values.warplockstyle); miWarpLockTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Warp Lock Time", 500, 220); - miWarpLockTimeField->Add("Off", 0, "", false, false); - miWarpLockTimeField->Add("1 Second", 62, "", false, false); - miWarpLockTimeField->Add("2 Seconds", 124, "", false, false); - miWarpLockTimeField->Add("3 Seconds", 186, "", false, false); - miWarpLockTimeField->Add("4 Seconds", 248, "", false, false); - miWarpLockTimeField->Add("5 Seconds", 310, "", false, false); - miWarpLockTimeField->Add("6 Seconds", 372, "", false, false); - miWarpLockTimeField->Add("7 Seconds", 434, "", false, false); - miWarpLockTimeField->Add("8 Seconds", 496, "", false, false); - miWarpLockTimeField->Add("9 Seconds", 558, "", false, false); - miWarpLockTimeField->Add("10 Seconds", 620, "", false, false); + miWarpLockTimeField->Add("Off", 0); + miWarpLockTimeField->Add("1 Second", 62); + miWarpLockTimeField->Add("2 Seconds", 124); + miWarpLockTimeField->Add("3 Seconds", 186); + miWarpLockTimeField->Add("4 Seconds", 248); + miWarpLockTimeField->Add("5 Seconds", 310); + miWarpLockTimeField->Add("6 Seconds", 372); + miWarpLockTimeField->Add("7 Seconds", 434); + miWarpLockTimeField->Add("8 Seconds", 496); + miWarpLockTimeField->Add("9 Seconds", 558); + miWarpLockTimeField->Add("10 Seconds", 620); miWarpLockTimeField->SetData(&game_values.warplocktime, NULL, NULL); miWarpLockTimeField->SetKey(game_values.warplocktime); miBotsField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Bot Difficulty", 500, 220); - miBotsField->Add("Very Easy", 0, "", false, false); - miBotsField->Add("Easy", 1, "", false, false); - miBotsField->Add("Moderate", 2, "", false, false); - miBotsField->Add("Hard", 3, "", false, false); - miBotsField->Add("Very Hard", 4, "", false, false); + miBotsField->Add("Very Easy", 0); + miBotsField->Add("Easy", 1); + miBotsField->Add("Moderate", 2); + miBotsField->Add("Hard", 3); + miBotsField->Add("Very Hard", 4); miBotsField->SetData(&game_values.cpudifficulty, NULL, NULL); miBotsField->SetKey(game_values.cpudifficulty); miPointSpeedField = new MI_SelectField(&rm->spr_selectfield, 70, 360, "Point Speed", 500, 220); - miPointSpeedField->Add("Very Slow", 60, "", false, false); - miPointSpeedField->Add("Slow", 40, "", false, false); - miPointSpeedField->Add("Moderate", 20, "", false, false); - miPointSpeedField->Add("Fast", 10, "", false, false); - miPointSpeedField->Add("Very Fast", 5, "", false, false); + miPointSpeedField->Add("Very Slow", 60); + miPointSpeedField->Add("Slow", 40); + miPointSpeedField->Add("Moderate", 20); + miPointSpeedField->Add("Fast", 10); + miPointSpeedField->Add("Very Fast", 5); miPointSpeedField->SetData(&game_values.pointspeed, NULL, NULL); miPointSpeedField->SetKey(game_values.pointspeed); miSecretsField = new MI_SelectField(&rm->spr_selectfield, 70, 400, "Secrets", 500, 220); - miSecretsField->Add("Off", 0, "", false, false); + miSecretsField->Add("Off", 0); miSecretsField->Add("On", 1, "", true, false); miSecretsField->SetData(NULL, NULL, &game_values.secretsenabled); miSecretsField->SetKey(game_values.secretsenabled ? 1 : 0); diff --git a/src/smw/menu/options/GraphicsOptionsMenu.cpp b/src/smw/menu/options/GraphicsOptionsMenu.cpp index 35553bd3..af350ca5 100644 --- a/src/smw/menu/options/GraphicsOptionsMenu.cpp +++ b/src/smw/menu/options/GraphicsOptionsMenu.cpp @@ -20,39 +20,39 @@ UI_GraphicsOptionsMenu::UI_GraphicsOptionsMenu() : UI_Menu() { miTopLayerField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Draw Top Layer", 500, 220); - miTopLayerField->Add("Background", 0, "", false, false); + miTopLayerField->Add("Background", 0); miTopLayerField->Add("Foreground", 1, "", true, false); miTopLayerField->SetData(NULL, NULL, &game_values.toplayer); miTopLayerField->SetKey(game_values.toplayer ? 1 : 0); miTopLayerField->SetAutoAdvance(true); miFrameLimiterField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Frame Limit", 500, 220); - miFrameLimiterField->Add("10 FPS", 100, "", false, false); - miFrameLimiterField->Add("15 FPS", 67, "", false, false); - miFrameLimiterField->Add("20 FPS", 50, "", false, false); - miFrameLimiterField->Add("25 FPS", 40, "", false, false); - miFrameLimiterField->Add("30 FPS", 33, "", false, false); - miFrameLimiterField->Add("35 FPS", 28, "", false, false); - miFrameLimiterField->Add("40 FPS", 25, "", false, false); - miFrameLimiterField->Add("45 FPS", 22, "", false, false); - miFrameLimiterField->Add("50 FPS", 20, "", false, false); - miFrameLimiterField->Add("55 FPS", 18, "", false, false); - miFrameLimiterField->Add("62 FPS (Normal)", 16, "", false, false); - miFrameLimiterField->Add("66 FPS", 15, "", false, false); - miFrameLimiterField->Add("71 FPS", 14, "", false, false); - miFrameLimiterField->Add("77 FPS", 13, "", false, false); - miFrameLimiterField->Add("83 FPS", 12, "", false, false); - miFrameLimiterField->Add("90 FPS", 11, "", false, false); - miFrameLimiterField->Add("100 FPS", 10, "", false, false); - miFrameLimiterField->Add("111 FPS", 9, "", false, false); - miFrameLimiterField->Add("125 FPS", 8, "", false, false); - miFrameLimiterField->Add("142 FPS", 7, "", false, false); - miFrameLimiterField->Add("166 FPS", 6, "", false, false); - miFrameLimiterField->Add("200 FPS", 5, "", false, false); - miFrameLimiterField->Add("250 FPS", 4, "", false, false); - miFrameLimiterField->Add("333 FPS", 3, "", false, false); - miFrameLimiterField->Add("500 FPS", 2, "", false, false); - miFrameLimiterField->Add("No Limit", 0, "", false, false); + miFrameLimiterField->Add("10 FPS", 100); + miFrameLimiterField->Add("15 FPS", 67); + miFrameLimiterField->Add("20 FPS", 50); + miFrameLimiterField->Add("25 FPS", 40); + miFrameLimiterField->Add("30 FPS", 33); + miFrameLimiterField->Add("35 FPS", 28); + miFrameLimiterField->Add("40 FPS", 25); + miFrameLimiterField->Add("45 FPS", 22); + miFrameLimiterField->Add("50 FPS", 20); + miFrameLimiterField->Add("55 FPS", 18); + miFrameLimiterField->Add("62 FPS (Normal)", 16); + miFrameLimiterField->Add("66 FPS", 15); + miFrameLimiterField->Add("71 FPS", 14); + miFrameLimiterField->Add("77 FPS", 13); + miFrameLimiterField->Add("83 FPS", 12); + miFrameLimiterField->Add("90 FPS", 11); + miFrameLimiterField->Add("100 FPS", 10); + miFrameLimiterField->Add("111 FPS", 9); + miFrameLimiterField->Add("125 FPS", 8); + miFrameLimiterField->Add("142 FPS", 7); + miFrameLimiterField->Add("166 FPS", 6); + miFrameLimiterField->Add("200 FPS", 5); + miFrameLimiterField->Add("250 FPS", 4); + miFrameLimiterField->Add("333 FPS", 3); + miFrameLimiterField->Add("500 FPS", 2); + miFrameLimiterField->Add("No Limit", 0); miFrameLimiterField->SetData(&game_values.framelimiter, NULL, NULL); miFrameLimiterField->SetKey(game_values.framelimiter); @@ -61,7 +61,7 @@ UI_GraphicsOptionsMenu::UI_GraphicsOptionsMenu() miScreenSettingsButton->SetCode(MENU_CODE_TO_SCREEN_SETTINGS); #else miFullscreenField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Size", 500, 220); - miFullscreenField->Add("Windowed", 0, "", false, false); + miFullscreenField->Add("Windowed", 0); miFullscreenField->Add("Fullscreen", 1, "", true, false); miFullscreenField->SetData(NULL, NULL, &game_values.fullscreen); miFullscreenField->SetKey(game_values.fullscreen ? 1 : 0); diff --git a/src/smw/menu/options/PowerupSettingsMenu.cpp b/src/smw/menu/options/PowerupSettingsMenu.cpp index 2ae16e43..ed3b308d 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.cpp +++ b/src/smw/menu/options/PowerupSettingsMenu.cpp @@ -16,64 +16,64 @@ UI_PowerupSettingsMenu::UI_PowerupSettingsMenu() : UI_Menu() { miStoredPowerupDelayField = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Item Use Speed", 500, 220); - miStoredPowerupDelayField->Add("Very Slow", 2, "", false, false); - miStoredPowerupDelayField->Add("Slow", 3, "", false, false); - miStoredPowerupDelayField->Add("Moderate", 4, "", false, false); - miStoredPowerupDelayField->Add("Fast", 5, "", false, false); - miStoredPowerupDelayField->Add("Very Fast", 6, "", false, false); + miStoredPowerupDelayField->Add("Very Slow", 2); + miStoredPowerupDelayField->Add("Slow", 3); + miStoredPowerupDelayField->Add("Moderate", 4); + miStoredPowerupDelayField->Add("Fast", 5); + miStoredPowerupDelayField->Add("Very Fast", 6); miStoredPowerupDelayField->SetData(&game_values.storedpowerupdelay, NULL, NULL); miStoredPowerupDelayField->SetKey(game_values.storedpowerupdelay); miItemRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Item Spawn", 500, 220); - miItemRespawnField->Add("Off", 0, "", false, false); - miItemRespawnField->Add("5 Seconds", 310, "", false, false); - miItemRespawnField->Add("10 Seconds", 620, "", false, false); - miItemRespawnField->Add("15 Seconds", 930, "", false, false); - miItemRespawnField->Add("20 Seconds", 1240, "", false, false); - miItemRespawnField->Add("25 Seconds", 1550, "", false, false); - miItemRespawnField->Add("30 Seconds", 1860, "", false, false); - miItemRespawnField->Add("35 Seconds", 2170, "", false, false); - miItemRespawnField->Add("40 Seconds", 2480, "", false, false); - miItemRespawnField->Add("45 Seconds", 2790, "", false, false); - miItemRespawnField->Add("50 Seconds", 3100, "", false, false); - miItemRespawnField->Add("55 Seconds", 3410, "", false, false); - miItemRespawnField->Add("60 Seconds", 3720, "", false, false); + miItemRespawnField->Add("Off", 0); + miItemRespawnField->Add("5 Seconds", 310); + miItemRespawnField->Add("10 Seconds", 620); + miItemRespawnField->Add("15 Seconds", 930); + miItemRespawnField->Add("20 Seconds", 1240); + miItemRespawnField->Add("25 Seconds", 1550); + miItemRespawnField->Add("30 Seconds", 1860); + miItemRespawnField->Add("35 Seconds", 2170); + miItemRespawnField->Add("40 Seconds", 2480); + miItemRespawnField->Add("45 Seconds", 2790); + miItemRespawnField->Add("50 Seconds", 3100); + miItemRespawnField->Add("55 Seconds", 3410); + miItemRespawnField->Add("60 Seconds", 3720); miItemRespawnField->SetData(&game_values.itemrespawntime, NULL, NULL); miItemRespawnField->SetKey(game_values.itemrespawntime); miHiddenBlockRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Hidden Block Hide", 500, 220); - miHiddenBlockRespawnField->Add("Off", 0, "", false, false); - miHiddenBlockRespawnField->Add("5 Seconds", 310, "", false, false); - miHiddenBlockRespawnField->Add("10 Seconds", 620, "", false, false); - miHiddenBlockRespawnField->Add("15 Seconds", 930, "", false, false); - miHiddenBlockRespawnField->Add("20 Seconds", 1240, "", false, false); - miHiddenBlockRespawnField->Add("25 Seconds", 1550, "", false, false); - miHiddenBlockRespawnField->Add("30 Seconds", 1860, "", false, false); - miHiddenBlockRespawnField->Add("35 Seconds", 2170, "", false, false); - miHiddenBlockRespawnField->Add("40 Seconds", 2480, "", false, false); - miHiddenBlockRespawnField->Add("45 Seconds", 2790, "", false, false); - miHiddenBlockRespawnField->Add("50 Seconds", 3100, "", false, false); - miHiddenBlockRespawnField->Add("55 Seconds", 3410, "", false, false); - miHiddenBlockRespawnField->Add("60 Seconds", 3720, "", false, false); + miHiddenBlockRespawnField->Add("Off", 0); + miHiddenBlockRespawnField->Add("5 Seconds", 310); + miHiddenBlockRespawnField->Add("10 Seconds", 620); + miHiddenBlockRespawnField->Add("15 Seconds", 930); + miHiddenBlockRespawnField->Add("20 Seconds", 1240); + miHiddenBlockRespawnField->Add("25 Seconds", 1550); + miHiddenBlockRespawnField->Add("30 Seconds", 1860); + miHiddenBlockRespawnField->Add("35 Seconds", 2170); + miHiddenBlockRespawnField->Add("40 Seconds", 2480); + miHiddenBlockRespawnField->Add("45 Seconds", 2790); + miHiddenBlockRespawnField->Add("50 Seconds", 3100); + miHiddenBlockRespawnField->Add("55 Seconds", 3410); + miHiddenBlockRespawnField->Add("60 Seconds", 3720); miHiddenBlockRespawnField->SetData(&game_values.hiddenblockrespawn, NULL, NULL); miHiddenBlockRespawnField->SetKey(game_values.hiddenblockrespawn); miSwapStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Swap Style", 500, 220); - miSwapStyleField->Add("Walk", 0, "", false, false); - miSwapStyleField->Add("Blink", 1, "", false, false); - miSwapStyleField->Add("Instant", 2, "", false, false); + miSwapStyleField->Add("Walk", 0); + miSwapStyleField->Add("Blink", 1); + miSwapStyleField->Add("Instant", 2); miSwapStyleField->SetData(&game_values.swapstyle, NULL, NULL); miSwapStyleField->SetKey(game_values.swapstyle); miBonusWheelField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "Bonus Wheel", 500, 220); - miBonusWheelField->Add("Off", 0, "", false, false); - miBonusWheelField->Add("Tournament Win", 1, "", false, false); - miBonusWheelField->Add("Every Game", 2, "", false, false); + miBonusWheelField->Add("Off", 0); + miBonusWheelField->Add("Tournament Win", 1); + miBonusWheelField->Add("Every Game", 2); miBonusWheelField->SetData(&game_values.bonuswheel, NULL, NULL); miBonusWheelField->SetKey(game_values.bonuswheel); miKeepPowerupField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "Bonus Item", 500, 220); - miKeepPowerupField->Add("Until Next Spin", 0, "", false, false); + miKeepPowerupField->Add("Until Next Spin", 0); miKeepPowerupField->Add("Keep Always", 1, "", true, false); miKeepPowerupField->SetData(NULL, NULL, &game_values.keeppowerup); miKeepPowerupField->SetKey(game_values.keeppowerup ? 1 : 0); diff --git a/src/smw/menu/options/ProjectileLimitsMenu.cpp b/src/smw/menu/options/ProjectileLimitsMenu.cpp index 6488c1ac..f1ecfe13 100644 --- a/src/smw/menu/options/ProjectileLimitsMenu.cpp +++ b/src/smw/menu/options/ProjectileLimitsMenu.cpp @@ -15,146 +15,146 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() : UI_Menu() { miFireballLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 60, "Fireball Limit", 500, 220); - miFireballLimitField->Add("Unlimited", 0, "", false, false); - miFireballLimitField->Add("2", 2, "", false, false); - miFireballLimitField->Add("5", 5, "", false, false); - miFireballLimitField->Add("8", 8, "", false, false); - miFireballLimitField->Add("10", 10, "", false, false); - miFireballLimitField->Add("12", 12, "", false, false); - miFireballLimitField->Add("15", 15, "", false, false); - miFireballLimitField->Add("20", 20, "", false, false); - miFireballLimitField->Add("25", 25, "", false, false); - miFireballLimitField->Add("30", 30, "", false, false); - miFireballLimitField->Add("40", 40, "", false, false); - miFireballLimitField->Add("50", 50, "", false, false); + miFireballLimitField->Add("Unlimited", 0); + miFireballLimitField->Add("2", 2); + miFireballLimitField->Add("5", 5); + miFireballLimitField->Add("8", 8); + miFireballLimitField->Add("10", 10); + miFireballLimitField->Add("12", 12); + miFireballLimitField->Add("15", 15); + miFireballLimitField->Add("20", 20); + miFireballLimitField->Add("25", 25); + miFireballLimitField->Add("30", 30); + miFireballLimitField->Add("40", 40); + miFireballLimitField->Add("50", 50); miFireballLimitField->SetData(&game_values.fireballlimit, NULL, NULL); miFireballLimitField->SetKey(game_values.fireballlimit); miHammerLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Hammer Limit", 500, 220); - miHammerLimitField->Add("Unlimited", 0, "", false, false); - miHammerLimitField->Add("2", 2, "", false, false); - miHammerLimitField->Add("5", 5, "", false, false); - miHammerLimitField->Add("8", 8, "", false, false); - miHammerLimitField->Add("10", 10, "", false, false); - miHammerLimitField->Add("12", 12, "", false, false); - miHammerLimitField->Add("15", 15, "", false, false); - miHammerLimitField->Add("20", 20, "", false, false); - miHammerLimitField->Add("25", 25, "", false, false); - miHammerLimitField->Add("30", 30, "", false, false); - miHammerLimitField->Add("40", 40, "", false, false); - miHammerLimitField->Add("50", 50, "", false, false); + miHammerLimitField->Add("Unlimited", 0); + miHammerLimitField->Add("2", 2); + miHammerLimitField->Add("5", 5); + miHammerLimitField->Add("8", 8); + miHammerLimitField->Add("10", 10); + miHammerLimitField->Add("12", 12); + miHammerLimitField->Add("15", 15); + miHammerLimitField->Add("20", 20); + miHammerLimitField->Add("25", 25); + miHammerLimitField->Add("30", 30); + miHammerLimitField->Add("40", 40); + miHammerLimitField->Add("50", 50); miHammerLimitField->SetData(&game_values.hammerlimit, NULL, NULL); miHammerLimitField->SetKey(game_values.hammerlimit); miBoomerangLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Boomerang Limit", 500, 220); - miBoomerangLimitField->Add("Unlimited", 0, "", false, false); - miBoomerangLimitField->Add("2", 2, "", false, false); - miBoomerangLimitField->Add("5", 5, "", false, false); - miBoomerangLimitField->Add("8", 8, "", false, false); - miBoomerangLimitField->Add("10", 10, "", false, false); - miBoomerangLimitField->Add("12", 12, "", false, false); - miBoomerangLimitField->Add("15", 15, "", false, false); - miBoomerangLimitField->Add("20", 20, "", false, false); - miBoomerangLimitField->Add("25", 25, "", false, false); - miBoomerangLimitField->Add("30", 30, "", false, false); - miBoomerangLimitField->Add("40", 40, "", false, false); - miBoomerangLimitField->Add("50", 50, "", false, false); + miBoomerangLimitField->Add("Unlimited", 0); + miBoomerangLimitField->Add("2", 2); + miBoomerangLimitField->Add("5", 5); + miBoomerangLimitField->Add("8", 8); + miBoomerangLimitField->Add("10", 10); + miBoomerangLimitField->Add("12", 12); + miBoomerangLimitField->Add("15", 15); + miBoomerangLimitField->Add("20", 20); + miBoomerangLimitField->Add("25", 25); + miBoomerangLimitField->Add("30", 30); + miBoomerangLimitField->Add("40", 40); + miBoomerangLimitField->Add("50", 50); miBoomerangLimitField->SetData(&game_values.boomeranglimit, NULL, NULL); miBoomerangLimitField->SetKey(game_values.boomeranglimit); miFeatherLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Feather Limit", 500, 220); - miFeatherLimitField->Add("Unlimited", 0, "", false, false); - miFeatherLimitField->Add("2", 2, "", false, false); - miFeatherLimitField->Add("5", 5, "", false, false); - miFeatherLimitField->Add("8", 8, "", false, false); - miFeatherLimitField->Add("10", 10, "", false, false); - miFeatherLimitField->Add("12", 12, "", false, false); - miFeatherLimitField->Add("15", 15, "", false, false); - miFeatherLimitField->Add("20", 20, "", false, false); - miFeatherLimitField->Add("25", 25, "", false, false); - miFeatherLimitField->Add("30", 30, "", false, false); - miFeatherLimitField->Add("40", 40, "", false, false); - miFeatherLimitField->Add("50", 50, "", false, false); + miFeatherLimitField->Add("Unlimited", 0); + miFeatherLimitField->Add("2", 2); + miFeatherLimitField->Add("5", 5); + miFeatherLimitField->Add("8", 8); + miFeatherLimitField->Add("10", 10); + miFeatherLimitField->Add("12", 12); + miFeatherLimitField->Add("15", 15); + miFeatherLimitField->Add("20", 20); + miFeatherLimitField->Add("25", 25); + miFeatherLimitField->Add("30", 30); + miFeatherLimitField->Add("40", 40); + miFeatherLimitField->Add("50", 50); miFeatherLimitField->SetData(&game_values.featherlimit, NULL, NULL); miFeatherLimitField->SetKey(game_values.featherlimit); miLeafLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Leaf Limit", 500, 220); - miLeafLimitField->Add("Unlimited", 0, "", false, false); - miLeafLimitField->Add("2", 2, "", false, false); - miLeafLimitField->Add("5", 5, "", false, false); - miLeafLimitField->Add("8", 8, "", false, false); - miLeafLimitField->Add("10", 10, "", false, false); - miLeafLimitField->Add("12", 12, "", false, false); - miLeafLimitField->Add("15", 15, "", false, false); - miLeafLimitField->Add("20", 20, "", false, false); - miLeafLimitField->Add("25", 25, "", false, false); - miLeafLimitField->Add("30", 30, "", false, false); - miLeafLimitField->Add("40", 40, "", false, false); - miLeafLimitField->Add("50", 50, "", false, false); + miLeafLimitField->Add("Unlimited", 0); + miLeafLimitField->Add("2", 2); + miLeafLimitField->Add("5", 5); + miLeafLimitField->Add("8", 8); + miLeafLimitField->Add("10", 10); + miLeafLimitField->Add("12", 12); + miLeafLimitField->Add("15", 15); + miLeafLimitField->Add("20", 20); + miLeafLimitField->Add("25", 25); + miLeafLimitField->Add("30", 30); + miLeafLimitField->Add("40", 40); + miLeafLimitField->Add("50", 50); miLeafLimitField->SetData(&game_values.leaflimit, NULL, NULL); miLeafLimitField->SetKey(game_values.leaflimit); miPwingsLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "P-Wings Limit", 500, 220); - miPwingsLimitField->Add("Unlimited", 0, "", false, false); - miPwingsLimitField->Add("2", 2, "", false, false); - miPwingsLimitField->Add("5", 5, "", false, false); - miPwingsLimitField->Add("8", 8, "", false, false); - miPwingsLimitField->Add("10", 10, "", false, false); - miPwingsLimitField->Add("12", 12, "", false, false); - miPwingsLimitField->Add("15", 15, "", false, false); - miPwingsLimitField->Add("20", 20, "", false, false); - miPwingsLimitField->Add("25", 25, "", false, false); - miPwingsLimitField->Add("30", 30, "", false, false); - miPwingsLimitField->Add("40", 40, "", false, false); - miPwingsLimitField->Add("50", 50, "", false, false); + miPwingsLimitField->Add("Unlimited", 0); + miPwingsLimitField->Add("2", 2); + miPwingsLimitField->Add("5", 5); + miPwingsLimitField->Add("8", 8); + miPwingsLimitField->Add("10", 10); + miPwingsLimitField->Add("12", 12); + miPwingsLimitField->Add("15", 15); + miPwingsLimitField->Add("20", 20); + miPwingsLimitField->Add("25", 25); + miPwingsLimitField->Add("30", 30); + miPwingsLimitField->Add("40", 40); + miPwingsLimitField->Add("50", 50); miPwingsLimitField->SetData(&game_values.pwingslimit, NULL, NULL); miPwingsLimitField->SetKey(game_values.pwingslimit); miTanookiLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "Tanooki Limit", 500, 220); - miTanookiLimitField->Add("Unlimited", 0, "", false, false); - miTanookiLimitField->Add("2", 2, "", false, false); - miTanookiLimitField->Add("5", 5, "", false, false); - miTanookiLimitField->Add("8", 8, "", false, false); - miTanookiLimitField->Add("10", 10, "", false, false); - miTanookiLimitField->Add("12", 12, "", false, false); - miTanookiLimitField->Add("15", 15, "", false, false); - miTanookiLimitField->Add("20", 20, "", false, false); - miTanookiLimitField->Add("25", 25, "", false, false); - miTanookiLimitField->Add("30", 30, "", false, false); - miTanookiLimitField->Add("40", 40, "", false, false); - miTanookiLimitField->Add("50", 50, "", false, false); + miTanookiLimitField->Add("Unlimited", 0); + miTanookiLimitField->Add("2", 2); + miTanookiLimitField->Add("5", 5); + miTanookiLimitField->Add("8", 8); + miTanookiLimitField->Add("10", 10); + miTanookiLimitField->Add("12", 12); + miTanookiLimitField->Add("15", 15); + miTanookiLimitField->Add("20", 20); + miTanookiLimitField->Add("25", 25); + miTanookiLimitField->Add("30", 30); + miTanookiLimitField->Add("40", 40); + miTanookiLimitField->Add("50", 50); miTanookiLimitField->SetData(&game_values.tanookilimit, NULL, NULL); miTanookiLimitField->SetKey(game_values.tanookilimit); miBombLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 340, "Bomb Limit", 500, 220); - miBombLimitField->Add("Unlimited", 0, "", false, false); - miBombLimitField->Add("2", 2, "", false, false); - miBombLimitField->Add("5", 5, "", false, false); - miBombLimitField->Add("8", 8, "", false, false); - miBombLimitField->Add("10", 10, "", false, false); - miBombLimitField->Add("12", 12, "", false, false); - miBombLimitField->Add("15", 15, "", false, false); - miBombLimitField->Add("20", 20, "", false, false); - miBombLimitField->Add("25", 25, "", false, false); - miBombLimitField->Add("30", 30, "", false, false); - miBombLimitField->Add("40", 40, "", false, false); - miBombLimitField->Add("50", 50, "", false, false); + miBombLimitField->Add("Unlimited", 0); + miBombLimitField->Add("2", 2); + miBombLimitField->Add("5", 5); + miBombLimitField->Add("8", 8); + miBombLimitField->Add("10", 10); + miBombLimitField->Add("12", 12); + miBombLimitField->Add("15", 15); + miBombLimitField->Add("20", 20); + miBombLimitField->Add("25", 25); + miBombLimitField->Add("30", 30); + miBombLimitField->Add("40", 40); + miBombLimitField->Add("50", 50); miBombLimitField->SetData(&game_values.bombslimit, NULL, NULL); miBombLimitField->SetKey(game_values.bombslimit); miWandLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 380, "Wand Limit", 500, 220); - miWandLimitField->Add("Unlimited", 0, "", false, false); - miWandLimitField->Add("2", 2, "", false, false); - miWandLimitField->Add("5", 5, "", false, false); - miWandLimitField->Add("8", 8, "", false, false); - miWandLimitField->Add("10", 10, "", false, false); - miWandLimitField->Add("12", 12, "", false, false); - miWandLimitField->Add("15", 15, "", false, false); - miWandLimitField->Add("20", 20, "", false, false); - miWandLimitField->Add("25", 25, "", false, false); - miWandLimitField->Add("30", 30, "", false, false); - miWandLimitField->Add("40", 40, "", false, false); - miWandLimitField->Add("50", 50, "", false, false); + miWandLimitField->Add("Unlimited", 0); + miWandLimitField->Add("2", 2); + miWandLimitField->Add("5", 5); + miWandLimitField->Add("8", 8); + miWandLimitField->Add("10", 10); + miWandLimitField->Add("12", 12); + miWandLimitField->Add("15", 15); + miWandLimitField->Add("20", 20); + miWandLimitField->Add("25", 25); + miWandLimitField->Add("30", 30); + miWandLimitField->Add("40", 40); + miWandLimitField->Add("50", 50); miWandLimitField->SetData(&game_values.wandlimit, NULL, NULL); miWandLimitField->SetKey(game_values.wandlimit); diff --git a/src/smw/menu/options/ProjectileOptionsMenu.cpp b/src/smw/menu/options/ProjectileOptionsMenu.cpp index 555a02fe..c25a5086 100644 --- a/src/smw/menu/options/ProjectileOptionsMenu.cpp +++ b/src/smw/menu/options/ProjectileOptionsMenu.cpp @@ -15,176 +15,176 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() : UI_Menu() { miFireballLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 80, "Life", 305, 120); - miFireballLifeField->Add("1 Second", 62, "", false, false); - miFireballLifeField->Add("2 Seconds", 124, "", false, false); - miFireballLifeField->Add("3 Seconds", 186, "", false, false); - miFireballLifeField->Add("4 Seconds", 248, "", false, false); - miFireballLifeField->Add("5 Seconds", 310, "", false, false); - miFireballLifeField->Add("6 Seconds", 372, "", false, false); - miFireballLifeField->Add("7 Seconds", 434, "", false, false); - miFireballLifeField->Add("8 Seconds", 496, "", false, false); - miFireballLifeField->Add("9 Seconds", 558, "", false, false); - miFireballLifeField->Add("10 Seconds", 620, "", false, false); + miFireballLifeField->Add("1 Second", 62); + miFireballLifeField->Add("2 Seconds", 124); + miFireballLifeField->Add("3 Seconds", 186); + miFireballLifeField->Add("4 Seconds", 248); + miFireballLifeField->Add("5 Seconds", 310); + miFireballLifeField->Add("6 Seconds", 372); + miFireballLifeField->Add("7 Seconds", 434); + miFireballLifeField->Add("8 Seconds", 496); + miFireballLifeField->Add("9 Seconds", 558); + miFireballLifeField->Add("10 Seconds", 620); miFireballLifeField->SetData(&game_values.fireballttl, NULL, NULL); miFireballLifeField->SetKey(game_values.fireballttl); miFeatherJumpsField = new MI_SelectField(&rm->spr_selectfield, 10, 150, "Jumps", 305, 120); - miFeatherJumpsField->Add("1", 1, "", false, false); - miFeatherJumpsField->Add("2", 2, "", false, false); - miFeatherJumpsField->Add("3", 3, "", false, false); - miFeatherJumpsField->Add("4", 4, "", false, false); - miFeatherJumpsField->Add("5", 5, "", false, false); + miFeatherJumpsField->Add("1", 1); + miFeatherJumpsField->Add("2", 2); + miFeatherJumpsField->Add("3", 3); + miFeatherJumpsField->Add("4", 4); + miFeatherJumpsField->Add("5", 5); miFeatherJumpsField->SetData(&game_values.featherjumps, NULL, NULL); miFeatherJumpsField->SetKey(game_values.featherjumps); miBoomerangStyleField = new MI_SelectField(&rm->spr_selectfield, 10, 220, "Style", 305, 120); - miBoomerangStyleField->Add("Flat", 0, "", false, false); - miBoomerangStyleField->Add("SMB3", 1, "", false, false); - miBoomerangStyleField->Add("Zelda", 2, "", false, false); - miBoomerangStyleField->Add("Random", 3, "", false, false); + miBoomerangStyleField->Add("Flat", 0); + miBoomerangStyleField->Add("SMB3", 1); + miBoomerangStyleField->Add("Zelda", 2); + miBoomerangStyleField->Add("Random", 3); miBoomerangStyleField->SetData(&game_values.boomerangstyle, NULL, NULL); miBoomerangStyleField->SetKey(game_values.boomerangstyle); miBoomerangLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 260, "Life", 305, 120); - miBoomerangLifeField->Add("1 Second", 62, "", false, false); - miBoomerangLifeField->Add("2 Seconds", 124, "", false, false); - miBoomerangLifeField->Add("3 Seconds", 186, "", false, false); - miBoomerangLifeField->Add("4 Seconds", 248, "", false, false); - miBoomerangLifeField->Add("5 Seconds", 310, "", false, false); - miBoomerangLifeField->Add("6 Seconds", 372, "", false, false); - miBoomerangLifeField->Add("7 Seconds", 434, "", false, false); - miBoomerangLifeField->Add("8 Seconds", 496, "", false, false); - miBoomerangLifeField->Add("9 Seconds", 558, "", false, false); - miBoomerangLifeField->Add("10 Seconds", 620, "", false, false); + miBoomerangLifeField->Add("1 Second", 62); + miBoomerangLifeField->Add("2 Seconds", 124); + miBoomerangLifeField->Add("3 Seconds", 186); + miBoomerangLifeField->Add("4 Seconds", 248); + miBoomerangLifeField->Add("5 Seconds", 310); + miBoomerangLifeField->Add("6 Seconds", 372); + miBoomerangLifeField->Add("7 Seconds", 434); + miBoomerangLifeField->Add("8 Seconds", 496); + miBoomerangLifeField->Add("9 Seconds", 558); + miBoomerangLifeField->Add("10 Seconds", 620); miBoomerangLifeField->SetData(&game_values.boomeranglife, NULL, NULL); miBoomerangLifeField->SetKey(game_values.boomeranglife); miHammerLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 80, "Life", 305, 120); - miHammerLifeField->Add("No Limit", 310, "", false, false); - miHammerLifeField->Add("0.5 Seconds", 31, "", false, false); - miHammerLifeField->Add("0.6 Seconds", 37, "", false, false); - miHammerLifeField->Add("0.7 Seconds", 43, "", false, false); - miHammerLifeField->Add("0.8 Seconds", 49, "", false, false); - miHammerLifeField->Add("0.9 Seconds", 55, "", false, false); - miHammerLifeField->Add("1.0 Seconds", 62, "", false, false); - miHammerLifeField->Add("1.1 Seconds", 68, "", false, false); - miHammerLifeField->Add("1.2 Seconds", 74, "", false, false); + miHammerLifeField->Add("No Limit", 310); + miHammerLifeField->Add("0.5 Seconds", 31); + miHammerLifeField->Add("0.6 Seconds", 37); + miHammerLifeField->Add("0.7 Seconds", 43); + miHammerLifeField->Add("0.8 Seconds", 49); + miHammerLifeField->Add("0.9 Seconds", 55); + miHammerLifeField->Add("1.0 Seconds", 62); + miHammerLifeField->Add("1.1 Seconds", 68); + miHammerLifeField->Add("1.2 Seconds", 74); miHammerLifeField->SetData(&game_values.hammerttl, NULL, NULL); miHammerLifeField->SetKey(game_values.hammerttl); miHammerDelayField = new MI_SelectField(&rm->spr_selectfield, 325, 120, "Delay", 305, 120); - miHammerDelayField->Add("None", 0, "", false, false); - miHammerDelayField->Add("0.1 Seconds", 6, "", false, false); - miHammerDelayField->Add("0.2 Seconds", 12, "", false, false); - miHammerDelayField->Add("0.3 Seconds", 19, "", false, false); - miHammerDelayField->Add("0.4 Seconds", 25, "", false, false); - miHammerDelayField->Add("0.5 Seconds", 31, "", false, false); - miHammerDelayField->Add("0.6 Seconds", 37, "", false, false); - miHammerDelayField->Add("0.7 Seconds", 43, "", false, false); - miHammerDelayField->Add("0.8 Seconds", 49, "", false, false); - miHammerDelayField->Add("0.9 Seconds", 55, "", false, false); - miHammerDelayField->Add("1.0 Seconds", 62, "", false, false); + miHammerDelayField->Add("None", 0); + miHammerDelayField->Add("0.1 Seconds", 6); + miHammerDelayField->Add("0.2 Seconds", 12); + miHammerDelayField->Add("0.3 Seconds", 19); + miHammerDelayField->Add("0.4 Seconds", 25); + miHammerDelayField->Add("0.5 Seconds", 31); + miHammerDelayField->Add("0.6 Seconds", 37); + miHammerDelayField->Add("0.7 Seconds", 43); + miHammerDelayField->Add("0.8 Seconds", 49); + miHammerDelayField->Add("0.9 Seconds", 55); + miHammerDelayField->Add("1.0 Seconds", 62); miHammerDelayField->SetData(&game_values.hammerdelay, NULL, NULL); miHammerDelayField->SetKey(game_values.hammerdelay); miHammerOneKillField = new MI_SelectField(&rm->spr_selectfield, 325, 160, "Power", 305, 120); miHammerOneKillField->Add("One Kill", 0, "", true, false); - miHammerOneKillField->Add("Multiple Kills", 1, "", false, false); + miHammerOneKillField->Add("Multiple Kills", 1); miHammerOneKillField->SetData(NULL, NULL, &game_values.hammerpower); miHammerOneKillField->SetKey(game_values.hammerpower ? 0 : 1); miHammerOneKillField->SetAutoAdvance(true); miShellLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 330, "Life", 305, 120); - miShellLifeField->Add("Unlimited", 0, "", false, false); - miShellLifeField->Add("1 Second", 62, "", false, false); - miShellLifeField->Add("2 Seconds", 124, "", false, false); - miShellLifeField->Add("3 Seconds", 186, "", false, false); - miShellLifeField->Add("4 Seconds", 248, "", false, false); - miShellLifeField->Add("5 Seconds", 310, "", false, false); - miShellLifeField->Add("6 Seconds", 372, "", false, false); - miShellLifeField->Add("7 Seconds", 434, "", false, false); - miShellLifeField->Add("8 Seconds", 496, "", false, false); - miShellLifeField->Add("9 Seconds", 558, "", false, false); - miShellLifeField->Add("10 Seconds", 620, "", false, false); - miShellLifeField->Add("15 Seconds", 930, "", false, false); - miShellLifeField->Add("20 Seconds", 1240, "", false, false); - miShellLifeField->Add("25 Seconds", 1550, "", false, false); - miShellLifeField->Add("30 Seconds", 1860, "", false, false); + miShellLifeField->Add("Unlimited", 0); + miShellLifeField->Add("1 Second", 62); + miShellLifeField->Add("2 Seconds", 124); + miShellLifeField->Add("3 Seconds", 186); + miShellLifeField->Add("4 Seconds", 248); + miShellLifeField->Add("5 Seconds", 310); + miShellLifeField->Add("6 Seconds", 372); + miShellLifeField->Add("7 Seconds", 434); + miShellLifeField->Add("8 Seconds", 496); + miShellLifeField->Add("9 Seconds", 558); + miShellLifeField->Add("10 Seconds", 620); + miShellLifeField->Add("15 Seconds", 930); + miShellLifeField->Add("20 Seconds", 1240); + miShellLifeField->Add("25 Seconds", 1550); + miShellLifeField->Add("30 Seconds", 1860); miShellLifeField->SetData(&game_values.shellttl, NULL, NULL); miShellLifeField->SetKey(game_values.shellttl); miWandFreezeTimeField = new MI_SelectField(&rm->spr_selectfield, 10, 400, "Freeze", 305, 120); - miWandFreezeTimeField->Add("1 Second", 62, "", false, false); - miWandFreezeTimeField->Add("2 Seconds", 124, "", false, false); - miWandFreezeTimeField->Add("3 Seconds", 186, "", false, false); - miWandFreezeTimeField->Add("4 Seconds", 248, "", false, false); - miWandFreezeTimeField->Add("5 Seconds", 310, "", false, false); - miWandFreezeTimeField->Add("6 Seconds", 372, "", false, false); - miWandFreezeTimeField->Add("7 Seconds", 434, "", false, false); - miWandFreezeTimeField->Add("8 Seconds", 496, "", false, false); - miWandFreezeTimeField->Add("9 Seconds", 558, "", false, false); - miWandFreezeTimeField->Add("10 Seconds", 620, "", false, false); - miWandFreezeTimeField->Add("12 Seconds", 744, "", false, false); - miWandFreezeTimeField->Add("15 Seconds", 930, "", false, false); - miWandFreezeTimeField->Add("18 Seconds", 1116, "", false, false); - miWandFreezeTimeField->Add("20 Seconds", 1240, "", false, false); + miWandFreezeTimeField->Add("1 Second", 62); + miWandFreezeTimeField->Add("2 Seconds", 124); + miWandFreezeTimeField->Add("3 Seconds", 186); + miWandFreezeTimeField->Add("4 Seconds", 248); + miWandFreezeTimeField->Add("5 Seconds", 310); + miWandFreezeTimeField->Add("6 Seconds", 372); + miWandFreezeTimeField->Add("7 Seconds", 434); + miWandFreezeTimeField->Add("8 Seconds", 496); + miWandFreezeTimeField->Add("9 Seconds", 558); + miWandFreezeTimeField->Add("10 Seconds", 620); + miWandFreezeTimeField->Add("12 Seconds", 744); + miWandFreezeTimeField->Add("15 Seconds", 930); + miWandFreezeTimeField->Add("18 Seconds", 1116); + miWandFreezeTimeField->Add("20 Seconds", 1240); miWandFreezeTimeField->SetData(&game_values.wandfreezetime, NULL, NULL); miWandFreezeTimeField->SetKey(game_values.wandfreezetime); miBlueBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 230, "Blue Life", 305, 120); - miBlueBlockLifeField->Add("Unlimited", 0, "", false, false); - miBlueBlockLifeField->Add("1 Second", 62, "", false, false); - miBlueBlockLifeField->Add("2 Seconds", 124, "", false, false); - miBlueBlockLifeField->Add("3 Seconds", 186, "", false, false); - miBlueBlockLifeField->Add("4 Seconds", 248, "", false, false); - miBlueBlockLifeField->Add("5 Seconds", 310, "", false, false); - miBlueBlockLifeField->Add("6 Seconds", 372, "", false, false); - miBlueBlockLifeField->Add("7 Seconds", 434, "", false, false); - miBlueBlockLifeField->Add("8 Seconds", 496, "", false, false); - miBlueBlockLifeField->Add("9 Seconds", 558, "", false, false); - miBlueBlockLifeField->Add("10 Seconds", 620, "", false, false); - miBlueBlockLifeField->Add("15 Seconds", 930, "", false, false); - miBlueBlockLifeField->Add("20 Seconds", 1240, "", false, false); - miBlueBlockLifeField->Add("25 Seconds", 1550, "", false, false); - miBlueBlockLifeField->Add("30 Seconds", 1860, "", false, false); + miBlueBlockLifeField->Add("Unlimited", 0); + miBlueBlockLifeField->Add("1 Second", 62); + miBlueBlockLifeField->Add("2 Seconds", 124); + miBlueBlockLifeField->Add("3 Seconds", 186); + miBlueBlockLifeField->Add("4 Seconds", 248); + miBlueBlockLifeField->Add("5 Seconds", 310); + miBlueBlockLifeField->Add("6 Seconds", 372); + miBlueBlockLifeField->Add("7 Seconds", 434); + miBlueBlockLifeField->Add("8 Seconds", 496); + miBlueBlockLifeField->Add("9 Seconds", 558); + miBlueBlockLifeField->Add("10 Seconds", 620); + miBlueBlockLifeField->Add("15 Seconds", 930); + miBlueBlockLifeField->Add("20 Seconds", 1240); + miBlueBlockLifeField->Add("25 Seconds", 1550); + miBlueBlockLifeField->Add("30 Seconds", 1860); miBlueBlockLifeField->SetData(&game_values.blueblockttl, NULL, NULL); miBlueBlockLifeField->SetKey(game_values.blueblockttl); miGrayBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 270, "Gray Life", 305, 120); - miGrayBlockLifeField->Add("Unlimited", 0, "", false, false); - miGrayBlockLifeField->Add("1 Second", 62, "", false, false); - miGrayBlockLifeField->Add("2 Seconds", 124, "", false, false); - miGrayBlockLifeField->Add("3 Seconds", 186, "", false, false); - miGrayBlockLifeField->Add("4 Seconds", 248, "", false, false); - miGrayBlockLifeField->Add("5 Seconds", 310, "", false, false); - miGrayBlockLifeField->Add("6 Seconds", 372, "", false, false); - miGrayBlockLifeField->Add("7 Seconds", 434, "", false, false); - miGrayBlockLifeField->Add("8 Seconds", 496, "", false, false); - miGrayBlockLifeField->Add("9 Seconds", 558, "", false, false); - miGrayBlockLifeField->Add("10 Seconds", 620, "", false, false); - miGrayBlockLifeField->Add("15 Seconds", 930, "", false, false); - miGrayBlockLifeField->Add("20 Seconds", 1240, "", false, false); - miGrayBlockLifeField->Add("25 Seconds", 1550, "", false, false); - miGrayBlockLifeField->Add("30 Seconds", 1860, "", false, false); + miGrayBlockLifeField->Add("Unlimited", 0); + miGrayBlockLifeField->Add("1 Second", 62); + miGrayBlockLifeField->Add("2 Seconds", 124); + miGrayBlockLifeField->Add("3 Seconds", 186); + miGrayBlockLifeField->Add("4 Seconds", 248); + miGrayBlockLifeField->Add("5 Seconds", 310); + miGrayBlockLifeField->Add("6 Seconds", 372); + miGrayBlockLifeField->Add("7 Seconds", 434); + miGrayBlockLifeField->Add("8 Seconds", 496); + miGrayBlockLifeField->Add("9 Seconds", 558); + miGrayBlockLifeField->Add("10 Seconds", 620); + miGrayBlockLifeField->Add("15 Seconds", 930); + miGrayBlockLifeField->Add("20 Seconds", 1240); + miGrayBlockLifeField->Add("25 Seconds", 1550); + miGrayBlockLifeField->Add("30 Seconds", 1860); miGrayBlockLifeField->SetData(&game_values.grayblockttl, NULL, NULL); miGrayBlockLifeField->SetKey(game_values.grayblockttl); miRedBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 310, "Red Life", 305, 120); - miRedBlockLifeField->Add("Unlimited", 0, "", false, false); - miRedBlockLifeField->Add("1 Second", 62, "", false, false); - miRedBlockLifeField->Add("2 Seconds", 124, "", false, false); - miRedBlockLifeField->Add("3 Seconds", 186, "", false, false); - miRedBlockLifeField->Add("4 Seconds", 248, "", false, false); - miRedBlockLifeField->Add("5 Seconds", 310, "", false, false); - miRedBlockLifeField->Add("6 Seconds", 372, "", false, false); - miRedBlockLifeField->Add("7 Seconds", 434, "", false, false); - miRedBlockLifeField->Add("8 Seconds", 496, "", false, false); - miRedBlockLifeField->Add("9 Seconds", 558, "", false, false); - miRedBlockLifeField->Add("10 Seconds", 620, "", false, false); - miRedBlockLifeField->Add("15 Seconds", 930, "", false, false); - miRedBlockLifeField->Add("20 Seconds", 1240, "", false, false); - miRedBlockLifeField->Add("25 Seconds", 1550, "", false, false); - miRedBlockLifeField->Add("30 Seconds", 1860, "", false, false); + miRedBlockLifeField->Add("Unlimited", 0); + miRedBlockLifeField->Add("1 Second", 62); + miRedBlockLifeField->Add("2 Seconds", 124); + miRedBlockLifeField->Add("3 Seconds", 186); + miRedBlockLifeField->Add("4 Seconds", 248); + miRedBlockLifeField->Add("5 Seconds", 310); + miRedBlockLifeField->Add("6 Seconds", 372); + miRedBlockLifeField->Add("7 Seconds", 434); + miRedBlockLifeField->Add("8 Seconds", 496); + miRedBlockLifeField->Add("9 Seconds", 558); + miRedBlockLifeField->Add("10 Seconds", 620); + miRedBlockLifeField->Add("15 Seconds", 930); + miRedBlockLifeField->Add("20 Seconds", 1240); + miRedBlockLifeField->Add("25 Seconds", 1550); + miRedBlockLifeField->Add("30 Seconds", 1860); miRedBlockLifeField->SetData(&game_values.redblockttl, NULL, NULL); miRedBlockLifeField->SetKey(game_values.redblockttl); diff --git a/src/smw/menu/options/SoundOptionsMenu.cpp b/src/smw/menu/options/SoundOptionsMenu.cpp index 2c316698..23b03125 100644 --- a/src/smw/menu/options/SoundOptionsMenu.cpp +++ b/src/smw/menu/options/SoundOptionsMenu.cpp @@ -24,37 +24,37 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() : UI_Menu() { miSoundVolumeField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 100, "Sound Volume", 500, 220, 484); - miSoundVolumeField->Add("Off", 0, "", false, false); - miSoundVolumeField->Add("1", 16, "", false, false); - miSoundVolumeField->Add("2", 32, "", false, false); - miSoundVolumeField->Add("3", 48, "", false, false); - miSoundVolumeField->Add("4", 64, "", false, false); - miSoundVolumeField->Add("5", 80, "", false, false); - miSoundVolumeField->Add("6", 96, "", false, false); - miSoundVolumeField->Add("7", 112, "", false, false); - miSoundVolumeField->Add("Max", 128, "", false, false); + miSoundVolumeField->Add("Off", 0); + miSoundVolumeField->Add("1", 16); + miSoundVolumeField->Add("2", 32); + miSoundVolumeField->Add("3", 48); + miSoundVolumeField->Add("4", 64); + miSoundVolumeField->Add("5", 80); + miSoundVolumeField->Add("6", 96); + miSoundVolumeField->Add("7", 112); + miSoundVolumeField->Add("Max", 128); miSoundVolumeField->SetData(&game_values.soundvolume, NULL, NULL); miSoundVolumeField->SetKey(game_values.soundvolume); miSoundVolumeField->SetNoWrap(true); miSoundVolumeField->SetItemChangedCode(MENU_CODE_SOUND_VOLUME_CHANGED); miMusicVolumeField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 140, "Music Volume", 500, 220, 484); - miMusicVolumeField->Add("Off", 0, "", false, false); - miMusicVolumeField->Add("1", 16, "", false, false); - miMusicVolumeField->Add("2", 32, "", false, false); - miMusicVolumeField->Add("3", 48, "", false, false); - miMusicVolumeField->Add("4", 64, "", false, false); - miMusicVolumeField->Add("5", 80, "", false, false); - miMusicVolumeField->Add("6", 96, "", false, false); - miMusicVolumeField->Add("7", 112, "", false, false); - miMusicVolumeField->Add("Max", 128, "", false, false); + miMusicVolumeField->Add("Off", 0); + miMusicVolumeField->Add("1", 16); + miMusicVolumeField->Add("2", 32); + miMusicVolumeField->Add("3", 48); + miMusicVolumeField->Add("4", 64); + miMusicVolumeField->Add("5", 80); + miMusicVolumeField->Add("6", 96); + miMusicVolumeField->Add("7", 112); + miMusicVolumeField->Add("Max", 128); miMusicVolumeField->SetData(&game_values.musicvolume, NULL, NULL); miMusicVolumeField->SetKey(game_values.musicvolume); miMusicVolumeField->SetNoWrap(true); miMusicVolumeField->SetItemChangedCode(MENU_CODE_MUSIC_VOLUME_CHANGED); miPlayNextMusicField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Next Music", 500, 220); - miPlayNextMusicField->Add("Off", 0, "", false, false); + miPlayNextMusicField->Add("Off", 0); miPlayNextMusicField->Add("On", 1, "", true, false); miPlayNextMusicField->SetData(NULL, NULL, &game_values.playnextmusic); miPlayNextMusicField->SetKey(game_values.playnextmusic ? 1 : 0); diff --git a/src/smw/menu/options/TeamOptionsMenu.cpp b/src/smw/menu/options/TeamOptionsMenu.cpp index c1823c1e..fa8cb253 100644 --- a/src/smw/menu/options/TeamOptionsMenu.cpp +++ b/src/smw/menu/options/TeamOptionsMenu.cpp @@ -15,28 +15,28 @@ UI_TeamOptionsMenu::UI_TeamOptionsMenu() : UI_Menu() { miTeamKillsField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Player Collision", 500, 220); - miTeamKillsField->Add("Off", 0, "", false, false); - miTeamKillsField->Add("Assist", 1, "", false, false); - miTeamKillsField->Add("On", 2, "", false, false); + miTeamKillsField->Add("Off", 0); + miTeamKillsField->Add("Assist", 1); + miTeamKillsField->Add("On", 2); miTeamKillsField->SetData(&game_values.teamcollision, NULL, NULL); miTeamKillsField->SetKey(game_values.teamcollision); miTeamColorsField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Colors", 500, 220); - miTeamColorsField->Add("Individual", 0, "", false, false); + miTeamColorsField->Add("Individual", 0); miTeamColorsField->Add("Team", 1, "", true, false); miTeamColorsField->SetData(NULL, NULL, &game_values.teamcolors); miTeamColorsField->SetKey(game_values.teamcolors ? 1 : 0); miTeamColorsField->SetAutoAdvance(true); miTournamentControlField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "Tournament Control", 500, 220); - miTournamentControlField->Add("All", 0, "", false, false); - miTournamentControlField->Add("Game Winner", 1, "", false, false); - miTournamentControlField->Add("Game Loser", 2, "", false, false); - miTournamentControlField->Add("Leading Teams", 3, "", false, false); - miTournamentControlField->Add("Trailing Teams", 4, "", false, false); - miTournamentControlField->Add("Random", 5, "", false, false); - miTournamentControlField->Add("Random Loser", 6, "", false, false); - miTournamentControlField->Add("Round Robin", 7, "", false, false); + miTournamentControlField->Add("All", 0); + miTournamentControlField->Add("Game Winner", 1); + miTournamentControlField->Add("Game Loser", 2); + miTournamentControlField->Add("Leading Teams", 3); + miTournamentControlField->Add("Trailing Teams", 4); + miTournamentControlField->Add("Random", 5); + miTournamentControlField->Add("Random Loser", 6); + miTournamentControlField->Add("Round Robin", 7); miTournamentControlField->SetData(&game_values.tournamentcontrolstyle, NULL, NULL); miTournamentControlField->SetKey(game_values.tournamentcontrolstyle); diff --git a/src/smw/menu/xbox/ScreenSettingsMenu.cpp b/src/smw/menu/xbox/ScreenSettingsMenu.cpp index ed4629bb..527cc6d1 100644 --- a/src/smw/menu/xbox/ScreenSettingsMenu.cpp +++ b/src/smw/menu/xbox/ScreenSettingsMenu.cpp @@ -11,31 +11,31 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() miScreenResizeButton->SetCode(MENU_CODE_TO_SCREEN_RESIZE); miScreenHardwareFilterField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Filter", 500, 220); - //miScreenHardwareFilterField->Add("None", 0, "", false, false); - miScreenHardwareFilterField->Add("Point", 1, "", false, false); - miScreenHardwareFilterField->Add("Bilinear", 2, "", false, false); - miScreenHardwareFilterField->Add("Trilinear", 3, "", false, false); - miScreenHardwareFilterField->Add("Anisotrpoic", 4, "", false, false); - miScreenHardwareFilterField->Add("Quincunx", 5, "", false, false); - miScreenHardwareFilterField->Add("Gaussian Cubic", 6, "", false, false); + //miScreenHardwareFilterField->Add("None", 0); + miScreenHardwareFilterField->Add("Point", 1); + miScreenHardwareFilterField->Add("Bilinear", 2); + miScreenHardwareFilterField->Add("Trilinear", 3); + miScreenHardwareFilterField->Add("Anisotrpoic", 4); + miScreenHardwareFilterField->Add("Quincunx", 5); + miScreenHardwareFilterField->Add("Gaussian Cubic", 6); miScreenHardwareFilterField->SetData(&game_values.hardwarefilter, NULL, NULL); miScreenHardwareFilterField->SetKey(game_values.hardwarefilter); miScreenHardwareFilterField->SetItemChangedCode(MENU_CODE_SCREEN_FILTER_CHANGED); miScreenFlickerFilterField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 240, "Flicker Filter", 500, 220, 380); - miScreenFlickerFilterField->Add("0", 0, "", false, false); - miScreenFlickerFilterField->Add("1", 1, "", false, false); - miScreenFlickerFilterField->Add("2", 2, "", false, false); - miScreenFlickerFilterField->Add("3", 3, "", false, false); - miScreenFlickerFilterField->Add("4", 4, "", false, false); - miScreenFlickerFilterField->Add("5", 5, "", false, false); + miScreenFlickerFilterField->Add("0", 0); + miScreenFlickerFilterField->Add("1", 1); + miScreenFlickerFilterField->Add("2", 2); + miScreenFlickerFilterField->Add("3", 3); + miScreenFlickerFilterField->Add("4", 4); + miScreenFlickerFilterField->Add("5", 5); miScreenFlickerFilterField->SetData(&game_values.flickerfilter, NULL, NULL); miScreenFlickerFilterField->SetKey(game_values.flickerfilter); miScreenFlickerFilterField->SetNoWrap(true); miScreenFlickerFilterField->SetItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); miScreenSoftFilterField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Soften Filter", 500, 220); - miScreenSoftFilterField->Add("Off", 0, "", false, false); + miScreenSoftFilterField->Add("Off", 0); miScreenSoftFilterField->Add("On", 1, "", true, false); miScreenSoftFilterField->SetData(&game_values.softfilter, NULL, NULL); miScreenSoftFilterField->SetKey(game_values.softfilter); @@ -44,7 +44,7 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() /* miScreenAspectRatioField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "10x11 Aspect", 500, 220); - miScreenAspectRatioField->Add("Off", 0, "", false, false); + miScreenAspectRatioField->Add("Off", 0); miScreenAspectRatioField->Add("On", 1, "", true, false); miScreenAspectRatioField->SetData(NULL, NULL, &game_values.aspectratio10x11); miScreenAspectRatioField->SetKey(game_values.aspectratio10x11 ? 1 : 0); diff --git a/src/smw/ui/MI_FrenzyModeOptions.cpp b/src/smw/ui/MI_FrenzyModeOptions.cpp index 4f8e3aa9..20205eb5 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.cpp +++ b/src/smw/ui/MI_FrenzyModeOptions.cpp @@ -30,31 +30,31 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short mMenu = new UI_Menu(); miQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 40, "Limit", 400, 180); - miQuantityField->Add("Single Powerup", 0, "", false, false); - miQuantityField->Add("1 Powerup", 1, "", false, false); - miQuantityField->Add("2 Powerups", 2, "", false, false); - miQuantityField->Add("3 Powerups", 3, "", false, false); - miQuantityField->Add("4 Powerups", 4, "", false, false); - miQuantityField->Add("5 Powerups", 5, "", false, false); - miQuantityField->Add("# Players - 1", 6, "", false, false); - miQuantityField->Add("# Players", 7, "", false, false); - miQuantityField->Add("# Players + 1", 8, "", false, false, false); - miQuantityField->Add("# Players + 2", 9, "", false, false, false); - miQuantityField->Add("# Players + 3", 10, "", false, false, false); + miQuantityField->Add("Single Powerup", 0); + miQuantityField->Add("1 Powerup", 1); + miQuantityField->Add("2 Powerups", 2); + miQuantityField->Add("3 Powerups", 3); + miQuantityField->Add("4 Powerups", 4); + miQuantityField->Add("5 Powerups", 5); + miQuantityField->Add("# Players - 1", 6); + miQuantityField->Add("# Players", 7); + miQuantityField->Add("# Players + 1", 8, false, false); + miQuantityField->Add("# Players + 2", 9, false, false); + miQuantityField->Add("# Players + 3", 10, false, false); miQuantityField->SetData(&game_values.gamemodemenusettings.frenzy.quantity, NULL, NULL); miQuantityField->SetKey(game_values.gamemodemenusettings.frenzy.quantity); miRateField = new MI_SelectField(&rm->spr_selectfield, 120, 80, "Rate", 400, 180); - miRateField->Add("Instant", 0, "", false, false); - miRateField->Add("1 Second", 62, "", false, false); - miRateField->Add("2 Seconds", 124, "", false, false); - miRateField->Add("3 Seconds", 186, "", false, false); - miRateField->Add("5 Seconds", 310, "", false, false); - miRateField->Add("10 Seconds", 620, "", false, false, false); - miRateField->Add("15 Seconds", 930, "", false, false, false); - miRateField->Add("20 Seconds", 1240, "", false, false, false); - miRateField->Add("25 Seconds", 1550, "", false, false, false); - miRateField->Add("30 Seconds", 1860, "", false, false, false); + miRateField->Add("Instant", 0); + miRateField->Add("1 Second", 62); + miRateField->Add("2 Seconds", 124); + miRateField->Add("3 Seconds", 186); + miRateField->Add("5 Seconds", 310); + miRateField->Add("10 Seconds", 620, false, false); + miRateField->Add("15 Seconds", 930, false, false); + miRateField->Add("20 Seconds", 1240, false, false); + miRateField->Add("25 Seconds", 1550, false, false); + miRateField->Add("30 Seconds", 1860, false, false); miRateField->SetData(&game_values.gamemodemenusettings.frenzy.rate, NULL, NULL); miRateField->SetKey(game_values.gamemodemenusettings.frenzy.rate); diff --git a/src/smw/ui/MI_InputControlContainer.cpp b/src/smw/ui/MI_InputControlContainer.cpp index 1e76511b..b74296ee 100644 --- a/src/smw/ui/MI_InputControlContainer.cpp +++ b/src/smw/ui/MI_InputControlContainer.cpp @@ -394,7 +394,7 @@ MI_InputControlContainer::MI_InputControlContainer(gfxSprite * spr_button, short miDeviceSelectField = new MI_SelectField(spr_button, x + 16, y + 38, "Device", 420, 150); miDeviceSelectField->SetItemChangedCode(MENU_CODE_INPUT_DEVICE_CHANGED); - miDeviceSelectField->Add("Keyboard", -1, "", false, false); + miDeviceSelectField->Add("Keyboard", -1); #ifdef _XBOX miDeviceSelectField->Disable(true); diff --git a/src/smw/ui/MI_PowerupSelection.cpp b/src/smw/ui/MI_PowerupSelection.cpp index cba01190..6efa21b4 100644 --- a/src/smw/ui/MI_PowerupSelection.cpp +++ b/src/smw/ui/MI_PowerupSelection.cpp @@ -76,32 +76,32 @@ MI_PowerupSelection::MI_PowerupSelection(short x, short y, short width, short nu mMenu = std::make_unique(); miOverride = new MI_SelectField(&rm->spr_selectfield, 70, iy, "Use Settings From", 500, 250); - miOverride->Add("Map Only", 0, "", false, false); - miOverride->Add("Game Only", 1, "", false, false); - miOverride->Add("Basic Average", 2, "", false, false); - miOverride->Add("Weighted Average", 3, "", false, false); + miOverride->Add("Map Only", 0); + miOverride->Add("Game Only", 1); + miOverride->Add("Basic Average", 2); + miOverride->Add("Weighted Average", 3); miOverride->SetData(&game_values.overridepowerupsettings, NULL, NULL); miOverride->SetKey(game_values.overridepowerupsettings); //miOverride->SetItemChangedCode(MENU_CODE_POWERUP_OVERRIDE_CHANGED); miPreset = new MI_SelectField(&rm->spr_selectfield, 70, iy + 40, "Item Set", 500, 250); - miPreset->Add("Custom Set 1", 0, "", false, false); - miPreset->Add("Custom Set 2", 1, "", false, false); - miPreset->Add("Custom Set 3", 2, "", false, false); - miPreset->Add("Custom Set 4", 3, "", false, false); - miPreset->Add("Custom Set 5", 4, "", false, false); - miPreset->Add("Balanced Set", 5, "", false, false); - miPreset->Add("Weapons Only", 6, "", false, false); - miPreset->Add("Koopa Bros Weapons", 7, "", false, false); - miPreset->Add("Support Items", 8, "", false, false); - miPreset->Add("Booms and Shakes", 9, "", false, false); - miPreset->Add("Fly and Glide", 10, "", false, false); - miPreset->Add("Shells Only", 11, "", false, false); - miPreset->Add("Mushrooms Only", 12, "", false, false); - miPreset->Add("Super Mario Bros 1", 13, "", false, false); - miPreset->Add("Super Mario Bros 2", 14, "", false, false); - miPreset->Add("Super Mario Bros 3", 15, "", false, false); - miPreset->Add("Super Mario World", 16, "", false, false); + miPreset->Add("Custom Set 1", 0); + miPreset->Add("Custom Set 2", 1); + miPreset->Add("Custom Set 3", 2); + miPreset->Add("Custom Set 4", 3); + miPreset->Add("Custom Set 5", 4); + miPreset->Add("Balanced Set", 5); + miPreset->Add("Weapons Only", 6); + miPreset->Add("Koopa Bros Weapons", 7); + miPreset->Add("Support Items", 8); + miPreset->Add("Booms and Shakes", 9); + miPreset->Add("Fly and Glide", 10); + miPreset->Add("Shells Only", 11); + miPreset->Add("Mushrooms Only", 12); + miPreset->Add("Super Mario Bros 1", 13); + miPreset->Add("Super Mario Bros 2", 14); + miPreset->Add("Super Mario Bros 3", 15); + miPreset->Add("Super Mario World", 16); miPreset->SetData(&game_values.poweruppreset, NULL, NULL); miPreset->SetKey(game_values.poweruppreset); miPreset->SetItemChangedCode(MENU_CODE_POWERUP_PRESET_CHANGED); diff --git a/src/worldeditor/worldeditor.cpp b/src/worldeditor/worldeditor.cpp index 263cbae3..9c2859c1 100644 --- a/src/worldeditor/worldeditor.cpp +++ b/src/worldeditor/worldeditor.cpp @@ -667,10 +667,10 @@ int main(int argc, char *argv[]) //miGoalField[iGameMode]->SetKey(gamemodes[iGameMode]->goal); } - miModeField->Add("Bonus House", 24, "", false, false); - miModeField->Add("Pipe Minigame", 25, "", false, false); - miModeField->Add("Boss Minigame", 26, "", false, false); - miModeField->Add("Boxes Minigame", 27, "", false, false); + miModeField->Add("Bonus House", 24); + miModeField->Add("Pipe Minigame", 25); + miModeField->Add("Boss Minigame", 26); + miModeField->Add("Boxes Minigame", 27); //Create goal field for pipe game miSpecialGoalField[0] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Points", 352, 120); @@ -717,7 +717,7 @@ int main(int argc, char *argv[]) //Final Stage Field miFinalStageField = new MI_SelectField(&rm->spr_selectfield, 325, 140, "End Stage", 245, 120); - miFinalStageField->Add("No", 0, "", false, false); + miFinalStageField->Add("No", 0); miFinalStageField->Add("Yes", 1, "", true, false); miFinalStageField->SetAutoAdvance(true); @@ -730,7 +730,7 @@ int main(int argc, char *argv[]) //Bonus Type miBonusType = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Type", 500, 120); - miBonusType->Add("Fixed", 0, "", false, false); + miBonusType->Add("Fixed", 0); miBonusType->Add("Random", 1, "", true, false); miBonusType->SetAutoAdvance(true); @@ -838,15 +838,15 @@ int main(int argc, char *argv[]) //Create Vehicle Menu miVehicleSpriteField = new MI_ImageSelectField(&rm->spr_selectfield, &spr_vehicleicons, 70, 80, "Sprite", 500, 150, 16, 16); - miVehicleSpriteField->Add("Hammer Brother", 0, "", false, false); - miVehicleSpriteField->Add("Boomerang Brother", 1, "", false, false); - miVehicleSpriteField->Add("Fire Brother", 2, "", false, false); - miVehicleSpriteField->Add("Tank 1", 3, "", false, false); - miVehicleSpriteField->Add("Boat 1", 4, "", false, false); - miVehicleSpriteField->Add("Boat 2", 5, "", false, false); - miVehicleSpriteField->Add("Airship 1", 6, "", false, false); - miVehicleSpriteField->Add("Airship 2", 7, "", false, false); - miVehicleSpriteField->Add("Tank 2", 8, "", false, false); + miVehicleSpriteField->Add("Hammer Brother", 0); + miVehicleSpriteField->Add("Boomerang Brother", 1); + miVehicleSpriteField->Add("Fire Brother", 2); + miVehicleSpriteField->Add("Tank 1", 3); + miVehicleSpriteField->Add("Boat 1", 4); + miVehicleSpriteField->Add("Boat 2", 5); + miVehicleSpriteField->Add("Airship 1", 6); + miVehicleSpriteField->Add("Airship 2", 7); + miVehicleSpriteField->Add("Tank 2", 8); miVehicleSpriteField->SetData(&g_wvVehicleStamp.iDrawSprite, NULL, NULL); miVehicleSpriteField->SetKey(g_wvVehicleStamp.iDrawSprite); @@ -882,21 +882,21 @@ int main(int argc, char *argv[]) miVehicleMaxMovesField->AllowFastScroll(true); miVehiclePacesField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Paces", 500, 150); - miVehiclePacesField->Add("No", 0, "", false, false); + miVehiclePacesField->Add("No", 0); miVehiclePacesField->Add("Yes", 1, "", true, false); miVehiclePacesField->SetData(NULL, NULL, &g_wvVehicleStamp.fSpritePaces); miVehiclePacesField->SetKey(g_wvVehicleStamp.fSpritePaces ? 1 : 0); miVehiclePacesField->SetAutoAdvance(true); miVehicleDirectionField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Direction", 500, 150); - miVehicleDirectionField->Add("Left", 0, "", false, false); + miVehicleDirectionField->Add("Left", 0); miVehicleDirectionField->Add("Right", 1, "", true, false); miVehiclePacesField->SetData(&g_wvVehicleStamp.iDrawDirection, NULL, NULL); miVehiclePacesField->SetKey(g_wvVehicleStamp.iDrawDirection); miVehicleDirectionField->SetAutoAdvance(true); miVehicleBoundaryField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Boundary", 500, 150); - miVehicleBoundaryField->Add("No Boundary", 0, "", false, false); + miVehicleBoundaryField->Add("No Boundary", 0); for (short iBoundary = 1; iBoundary <= 100; iBoundary++) { char szBoundary[8]; @@ -3303,7 +3303,7 @@ int editor_vehicles() TourStop * ts = game_values.tourstops[iStage]; char szStageName[256]; sprintf(szStageName, "(%d) %s", iStage + 1, ts->szName); - miVehicleStageField->Add(szStageName, iStage, "", false, false, true, ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode)); + miVehicleStageField->Add(szStageName, iStage, false, true, ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode)); } miVehicleStageField->SetKey(g_wvVehicleStamp.iActionId); From 05092b8b3acfb70c7f5bfdfe8cfa1cb71aeecad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sat, 30 Mar 2024 23:06:18 +0100 Subject: [PATCH 04/14] Converted the slider fields to use the new select field --- src/common/ui/MI_SelectField.cpp | 5 +- src/common/ui/MI_SelectField.h | 2 +- src/common/ui/MI_SliderField.cpp | 52 +-- src/common/ui/MI_SliderField.h | 20 +- src/smw/menu/ModeOptionsMenu.cpp | 444 +++++++++++----------- src/smw/menu/ModeOptionsMenu.h | 4 +- src/smw/menu/options/SoundOptionsMenu.cpp | 52 +-- src/smw/ui/MI_FrenzyModeOptions.cpp | 30 +- src/smw/ui/MI_PowerupSelection.cpp | 36 +- src/smw/ui/MI_PowerupSlider.cpp | 36 +- src/smw/ui/MI_PowerupSlider.h | 6 +- 11 files changed, 342 insertions(+), 345 deletions(-) diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index b7046253..eb5651cd 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -690,10 +690,10 @@ void MI_SelectFieldDyn::updateOutput() const template -void MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool goodRandom, short iconOverride) +void MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool goodRandom) { size_t new_idx = m_items.size(); - m_items.emplace_back(std::move(name), std::move(value), hidden, iconOverride); + m_items.emplace_back(std::move(name), std::move(value), hidden, -1); m_index = 0; if (goodRandom) @@ -797,3 +797,4 @@ bool MI_SelectFieldDyn::moveRandom() // Actual typed classes template class MI_SelectFieldDyn; +template class MI_SelectFieldDyn; diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 2f59e71a..2e87a493 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -243,7 +243,7 @@ class MI_SelectFieldDyn : public UI_Control { //! Sets the currently selected item bool setCurrentIndex(size_t index); //! Adds an item to the list - void add(std::string name, T value, bool hidden = false, bool goodRandom = true, short iconOverride = -1); + void add(std::string name, T value, bool hidden = false, bool goodRandom = true); //! Removes all items void clear(); //! Hides the items containing the specified value diff --git a/src/common/ui/MI_SliderField.cpp b/src/common/ui/MI_SliderField.cpp index 5bd68701..856a7393 100644 --- a/src/common/ui/MI_SliderField.cpp +++ b/src/common/ui/MI_SliderField.cpp @@ -10,11 +10,11 @@ extern CResourceManager* rm; * MI_SliderField Class **************************************/ -MI_SliderField::MI_SliderField(gfxSprite * nspr, gfxSprite * nsprSlider, short x, short y, const char * name, short width, short indent1, short indent2) : - MI_SelectField(nspr, x, y, name, width, indent1) +MI_SliderField::MI_SliderField(gfxSprite * nspr, gfxSprite * nsprSlider, short x, short y, const char * name, short width, short indent1, short indent2) + : MI_SelectFieldDyn(nspr, x, y, name, width, indent1) { - iIndent2 = indent2; - sprSlider = nsprSlider; + m_indent2 = indent2; + m_sprSlider = nsprSlider; SetPosition(x, y); } @@ -24,9 +24,9 @@ MI_SliderField::~MI_SliderField() void MI_SliderField::SetPosition(short x, short y) { - MI_SelectField::SetPosition(x, y); - miModifyImageLeft->SetPosition(ix + iIndent - 26, iy + 4); - miModifyImageRight->SetPosition(ix + iWidth - 16, iy + 4); + MI_SelectFieldDyn::SetPosition(x, y); + miModifyImageLeft->SetPosition(ix + m_indent - 26, iy + 4); + miModifyImageRight->SetPosition(ix + m_width - 16, iy + 4); } void MI_SliderField::Draw() @@ -34,34 +34,36 @@ void MI_SliderField::Draw() if (!fShow) return; - spr->draw(ix, iy, 0, (fSelected ? 32 : 0) + iAdjustmentY, iIndent - 16, 32); - spr->draw(ix + iIndent - 16, iy, 0, (fSelected ? 96 : 64), 32, 32); - spr->draw(ix + iIndent + 16, iy, 528 - iWidth + iIndent, (fSelected ? 32 : 0) + iAdjustmentY, iWidth - iIndent - 16, 32); + m_spr->draw(ix, iy, 0, (fSelected ? 32 : 0) + m_adjustmentY, m_indent - 16, 32); + m_spr->draw(ix + m_indent - 16, iy, 0, (fSelected ? 96 : 64), 32, 32); + m_spr->draw(ix + m_indent + 16, iy, 528 - m_width + m_indent, (fSelected ? 32 : 0) + m_adjustmentY, m_width - m_indent - 16, 32); - rm->menu_font_large.drawChopRight(ix + 16, iy + 5, iIndent - 8, szName.c_str()); + rm->menu_font_large.drawChopRight(ix + 16, iy + 5, m_indent - 8, m_name.c_str()); - if (!items.empty()) { - rm->menu_font_large.drawChopRight(ix + iIndent2 + 16, iy + 5, iWidth - iIndent2 - 24, (*current)->sName.c_str()); + if (!m_items.empty()) { + rm->menu_font_large.drawChopRight(ix + m_indent2 + 16, iy + 5, m_width - m_indent2 - 24, currentItem().name.c_str()); } - short iSpacing = (iIndent2 - iIndent - 20) / ((short)items.size() - 1); + short iSpacing = (m_indent2 - m_indent - 20) / ((short)m_items.size() - 1); short iSpot = 0; - for (unsigned int index = 0; index < items.size(); index++) { - if (index < items.size() - 1) - sprSlider->draw(ix + iIndent + iSpot + 16, iy + 10, 0, 0, iSpacing, 13); + for (unsigned int index = 0; index < m_items.size(); index++) { + if (index < m_items.size() - 1) + m_sprSlider->draw(ix + m_indent + iSpot + 16, iy + 10, 0, 0, iSpacing, 13); else - sprSlider->draw(ix + iIndent + iSpot + 16, iy + 10, 164, 0, 4, 13); + m_sprSlider->draw(ix + m_indent + iSpot + 16, iy + 10, 164, 0, 4, 13); iSpot += iSpacing; } - sprSlider->draw(ix + iIndent + (iIndex * iSpacing) + 14, iy + 8, 168, 0, 8, 16); + m_sprSlider->draw(ix + m_indent + (m_index * iSpacing) + 14, iy + 8, 168, 0, 8, 16); - if (current != items.begin() || !fNoWrap) + const bool drawLeft = m_index > 0; + if (m_wraps || drawLeft) miModifyImageLeft->Draw(); - if (current != --items.end() || !fNoWrap) + const bool drawRight = (m_index + 1) < m_items.size(); + if (m_wraps || drawRight) miModifyImageRight->Draw(); } @@ -69,14 +71,14 @@ MenuCodeEnum MI_SliderField::SendInput(CPlayerInput * playerInput) { for (int iPlayer = 0; iPlayer < 4; iPlayer++) { if (playerInput->outputControls[iPlayer].menu_scrollfast.fPressed) { - if (iIndex == 0) - while (MoveNext()); + if (m_index == 0) + while (moveNext()); else - while (MovePrev()); + while (movePrev()); return mcItemChangedCode; } } - return MI_SelectField::SendInput(playerInput); + return MI_SelectFieldDyn::SendInput(playerInput); } diff --git a/src/common/ui/MI_SliderField.h b/src/common/ui/MI_SliderField.h index 3bd745ce..652d401b 100644 --- a/src/common/ui/MI_SliderField.h +++ b/src/common/ui/MI_SliderField.h @@ -1,27 +1,21 @@ -#ifndef UI_SLIDER_FIELD_H -#define UI_SLIDER_FIELD_H +#pragma once #include "ui/MI_SelectField.h" -class MI_SliderField : public MI_SelectField -{ -public: +class MI_SliderField : public MI_SelectFieldDyn { +public: MI_SliderField(gfxSprite * nspr, gfxSprite * nsprSlider, short x, short y, const char * name, short width, short indent1, short indent2); virtual ~MI_SliderField(); void SetPosition(short x, short y); //Draws every frame - virtual void Draw(); + void Draw() override; //Sends player input to control on every frame - MenuCodeEnum SendInput(CPlayerInput * playerInput); + MenuCodeEnum SendInput(CPlayerInput * playerInput) override; protected: - - gfxSprite * sprSlider; - short iIndent2; - + gfxSprite* m_sprSlider; + short m_indent2; }; - -#endif // UI_SLIDER_FIELD_H diff --git a/src/smw/menu/ModeOptionsMenu.cpp b/src/smw/menu/ModeOptionsMenu.cpp index 8ba24f85..6df3041a 100644 --- a/src/smw/menu/ModeOptionsMenu.cpp +++ b/src/smw/menu/ModeOptionsMenu.cpp @@ -104,30 +104,30 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miTimeLimitModeScoringField->SetKey(game_values.gamemodemenusettings.time.scoring); miTimeLimitModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); - miTimeLimitModePercentExtraTime->Add("0", 0, false, false); - miTimeLimitModePercentExtraTime->Add("5", 5, false, false); - miTimeLimitModePercentExtraTime->Add("10", 10); - miTimeLimitModePercentExtraTime->Add("15", 15); - miTimeLimitModePercentExtraTime->Add("20", 20); - miTimeLimitModePercentExtraTime->Add("25", 25); - miTimeLimitModePercentExtraTime->Add("30", 30); - miTimeLimitModePercentExtraTime->Add("35", 35); - miTimeLimitModePercentExtraTime->Add("40", 40); - miTimeLimitModePercentExtraTime->Add("45", 45); - miTimeLimitModePercentExtraTime->Add("50", 50); - miTimeLimitModePercentExtraTime->Add("55", 55, false, false); - miTimeLimitModePercentExtraTime->Add("60", 60, false, false); - miTimeLimitModePercentExtraTime->Add("65", 65, false, false); - miTimeLimitModePercentExtraTime->Add("70", 70, false, false); - miTimeLimitModePercentExtraTime->Add("75", 75, false, false); - miTimeLimitModePercentExtraTime->Add("80", 80, false, false); - miTimeLimitModePercentExtraTime->Add("85", 85, false, false); - miTimeLimitModePercentExtraTime->Add("90", 90, false, false); - miTimeLimitModePercentExtraTime->Add("95", 95, false, false); - miTimeLimitModePercentExtraTime->Add("100", 100, false, false); - miTimeLimitModePercentExtraTime->SetData(&game_values.gamemodemenusettings.time.percentextratime, NULL, NULL); - miTimeLimitModePercentExtraTime->SetKey(game_values.gamemodemenusettings.time.percentextratime); - miTimeLimitModePercentExtraTime->SetNoWrap(true); + miTimeLimitModePercentExtraTime->add("0", 0, false, false); + miTimeLimitModePercentExtraTime->add("5", 5, false, false); + miTimeLimitModePercentExtraTime->add("10", 10); + miTimeLimitModePercentExtraTime->add("15", 15); + miTimeLimitModePercentExtraTime->add("20", 20); + miTimeLimitModePercentExtraTime->add("25", 25); + miTimeLimitModePercentExtraTime->add("30", 30); + miTimeLimitModePercentExtraTime->add("35", 35); + miTimeLimitModePercentExtraTime->add("40", 40); + miTimeLimitModePercentExtraTime->add("45", 45); + miTimeLimitModePercentExtraTime->add("50", 50); + miTimeLimitModePercentExtraTime->add("55", 55, false, false); + miTimeLimitModePercentExtraTime->add("60", 60, false, false); + miTimeLimitModePercentExtraTime->add("65", 65, false, false); + miTimeLimitModePercentExtraTime->add("70", 70, false, false); + miTimeLimitModePercentExtraTime->add("75", 75, false, false); + miTimeLimitModePercentExtraTime->add("80", 80, false, false); + miTimeLimitModePercentExtraTime->add("85", 85, false, false); + miTimeLimitModePercentExtraTime->add("90", 90, false, false); + miTimeLimitModePercentExtraTime->add("95", 95, false, false); + miTimeLimitModePercentExtraTime->add("100", 100, false, false); + miTimeLimitModePercentExtraTime->setOutputPtr(&game_values.gamemodemenusettings.time.percentextratime); + miTimeLimitModePercentExtraTime->setCurrentValue(game_values.gamemodemenusettings.time.percentextratime); + miTimeLimitModePercentExtraTime->allowWrap(false); miTimeLimitModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miTimeLimitModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -185,30 +185,30 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miJailModeTagFreeField->setAutoAdvance(true); miJailModeJailKeyField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Jail Key", 400, 150, 384); - miJailModeJailKeyField->Add("0", 0, false, false); - miJailModeJailKeyField->Add("5", 5, false, false); - miJailModeJailKeyField->Add("10", 10); - miJailModeJailKeyField->Add("15", 15); - miJailModeJailKeyField->Add("20", 20); - miJailModeJailKeyField->Add("25", 25); - miJailModeJailKeyField->Add("30", 30); - miJailModeJailKeyField->Add("35", 35); - miJailModeJailKeyField->Add("40", 40); - miJailModeJailKeyField->Add("45", 45); - miJailModeJailKeyField->Add("50", 50); - miJailModeJailKeyField->Add("55", 55, false, false); - miJailModeJailKeyField->Add("60", 60, false, false); - miJailModeJailKeyField->Add("65", 65, false, false); - miJailModeJailKeyField->Add("70", 70, false, false); - miJailModeJailKeyField->Add("75", 75, false, false); - miJailModeJailKeyField->Add("80", 80, false, false); - miJailModeJailKeyField->Add("85", 85, false, false); - miJailModeJailKeyField->Add("90", 90, false, false); - miJailModeJailKeyField->Add("95", 95, false, false); - miJailModeJailKeyField->Add("100", 100, false, false); - miJailModeJailKeyField->SetData(&game_values.gamemodemenusettings.jail.percentkey, NULL, NULL); - miJailModeJailKeyField->SetKey(game_values.gamemodemenusettings.jail.percentkey); - miJailModeJailKeyField->SetNoWrap(true); + miJailModeJailKeyField->add("0", 0, false, false); + miJailModeJailKeyField->add("5", 5, false, false); + miJailModeJailKeyField->add("10", 10); + miJailModeJailKeyField->add("15", 15); + miJailModeJailKeyField->add("20", 20); + miJailModeJailKeyField->add("25", 25); + miJailModeJailKeyField->add("30", 30); + miJailModeJailKeyField->add("35", 35); + miJailModeJailKeyField->add("40", 40); + miJailModeJailKeyField->add("45", 45); + miJailModeJailKeyField->add("50", 50); + miJailModeJailKeyField->add("55", 55, false, false); + miJailModeJailKeyField->add("60", 60, false, false); + miJailModeJailKeyField->add("65", 65, false, false); + miJailModeJailKeyField->add("70", 70, false, false); + miJailModeJailKeyField->add("75", 75, false, false); + miJailModeJailKeyField->add("80", 80, false, false); + miJailModeJailKeyField->add("85", 85, false, false); + miJailModeJailKeyField->add("90", 90, false, false); + miJailModeJailKeyField->add("95", 95, false, false); + miJailModeJailKeyField->add("100", 100, false, false); + miJailModeJailKeyField->setOutputPtr(&game_values.gamemodemenusettings.jail.percentkey); + miJailModeJailKeyField->setCurrentValue(game_values.gamemodemenusettings.jail.percentkey); + miJailModeJailKeyField->allowWrap(false); miJailModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miJailModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -257,30 +257,30 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCoinModeQuantityField->SetKey(game_values.gamemodemenusettings.coins.quantity); miCoinModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Coins", 400, 150, 384); - miCoinModePercentExtraCoin->Add("0", 0, false, false); - miCoinModePercentExtraCoin->Add("5", 5, false, false); - miCoinModePercentExtraCoin->Add("10", 10); - miCoinModePercentExtraCoin->Add("15", 15); - miCoinModePercentExtraCoin->Add("20", 20); - miCoinModePercentExtraCoin->Add("25", 25); - miCoinModePercentExtraCoin->Add("30", 30); - miCoinModePercentExtraCoin->Add("35", 35); - miCoinModePercentExtraCoin->Add("40", 40); - miCoinModePercentExtraCoin->Add("45", 45); - miCoinModePercentExtraCoin->Add("50", 50); - miCoinModePercentExtraCoin->Add("55", 55, false, false); - miCoinModePercentExtraCoin->Add("60", 60, false, false); - miCoinModePercentExtraCoin->Add("65", 65, false, false); - miCoinModePercentExtraCoin->Add("70", 70, false, false); - miCoinModePercentExtraCoin->Add("75", 75, false, false); - miCoinModePercentExtraCoin->Add("80", 80, false, false); - miCoinModePercentExtraCoin->Add("85", 85, false, false); - miCoinModePercentExtraCoin->Add("90", 90, false, false); - miCoinModePercentExtraCoin->Add("95", 95, false, false); - miCoinModePercentExtraCoin->Add("100", 100, false, false); - miCoinModePercentExtraCoin->SetData(&game_values.gamemodemenusettings.coins.percentextracoin, NULL, NULL); - miCoinModePercentExtraCoin->SetKey(game_values.gamemodemenusettings.coins.percentextracoin); - miCoinModePercentExtraCoin->SetNoWrap(true); + miCoinModePercentExtraCoin->add("0", 0, false, false); + miCoinModePercentExtraCoin->add("5", 5, false, false); + miCoinModePercentExtraCoin->add("10", 10); + miCoinModePercentExtraCoin->add("15", 15); + miCoinModePercentExtraCoin->add("20", 20); + miCoinModePercentExtraCoin->add("25", 25); + miCoinModePercentExtraCoin->add("30", 30); + miCoinModePercentExtraCoin->add("35", 35); + miCoinModePercentExtraCoin->add("40", 40); + miCoinModePercentExtraCoin->add("45", 45); + miCoinModePercentExtraCoin->add("50", 50); + miCoinModePercentExtraCoin->add("55", 55, false, false); + miCoinModePercentExtraCoin->add("60", 60, false, false); + miCoinModePercentExtraCoin->add("65", 65, false, false); + miCoinModePercentExtraCoin->add("70", 70, false, false); + miCoinModePercentExtraCoin->add("75", 75, false, false); + miCoinModePercentExtraCoin->add("80", 80, false, false); + miCoinModePercentExtraCoin->add("85", 85, false, false); + miCoinModePercentExtraCoin->add("90", 90, false, false); + miCoinModePercentExtraCoin->add("95", 95, false, false); + miCoinModePercentExtraCoin->add("100", 100, false, false); + miCoinModePercentExtraCoin->setOutputPtr(&game_values.gamemodemenusettings.coins.percentextracoin); + miCoinModePercentExtraCoin->setCurrentValue(game_values.gamemodemenusettings.coins.percentextracoin); + miCoinModePercentExtraCoin->allowWrap(false); miCoinModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miCoinModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -319,20 +319,20 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iEnemy = 0; iEnemy < NUMSTOMPENEMIES; iEnemy++) { miStompModeEnemySlider[iEnemy] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_stomp, 120, 80 + 40 * iEnemy, 400, iEnemy); - miStompModeEnemySlider[iEnemy]->Add("", 0, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 1, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 2, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 3, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 4, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 5, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 6, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 7, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 8, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 9, "", false, false); - miStompModeEnemySlider[iEnemy]->Add("", 10, "", false, false); - miStompModeEnemySlider[iEnemy]->SetNoWrap(true); - miStompModeEnemySlider[iEnemy]->SetData(&game_values.gamemodemenusettings.stomp.enemyweight[iEnemy], NULL, NULL); - miStompModeEnemySlider[iEnemy]->SetKey(game_values.gamemodemenusettings.stomp.enemyweight[iEnemy]); + miStompModeEnemySlider[iEnemy]->add("", 0); + miStompModeEnemySlider[iEnemy]->add("", 1); + miStompModeEnemySlider[iEnemy]->add("", 2); + miStompModeEnemySlider[iEnemy]->add("", 3); + miStompModeEnemySlider[iEnemy]->add("", 4); + miStompModeEnemySlider[iEnemy]->add("", 5); + miStompModeEnemySlider[iEnemy]->add("", 6); + miStompModeEnemySlider[iEnemy]->add("", 7); + miStompModeEnemySlider[iEnemy]->add("", 8); + miStompModeEnemySlider[iEnemy]->add("", 9); + miStompModeEnemySlider[iEnemy]->add("", 10); + miStompModeEnemySlider[iEnemy]->allowWrap(false); + miStompModeEnemySlider[iEnemy]->setOutputPtr(&game_values.gamemodemenusettings.stomp.enemyweight[iEnemy]); + miStompModeEnemySlider[iEnemy]->setCurrentValue(game_values.gamemodemenusettings.stomp.enemyweight[iEnemy]); } miStompModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); @@ -371,26 +371,26 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iEggField = 0; iEggField < 4; iEggField++) { miEggModeEggQuantityField[iEggField] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_egg, 170, 60 + 40 * iEggField, 300, iEggField); - miEggModeEggQuantityField[iEggField]->Add("0", 0, false, iEggField == 0 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("1", 1, false, iEggField >= 2 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("2", 2, false, iEggField >= 2 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("3", 3, false, iEggField >= 1 ? false : true); - miEggModeEggQuantityField[iEggField]->Add("4", 4, false, false); - miEggModeEggQuantityField[iEggField]->SetData(&game_values.gamemodemenusettings.egg.eggs[iEggField], NULL, NULL); - miEggModeEggQuantityField[iEggField]->SetKey(game_values.gamemodemenusettings.egg.eggs[iEggField]); - miEggModeEggQuantityField[iEggField]->SetNoWrap(true); + miEggModeEggQuantityField[iEggField]->add("0", 0, false, iEggField == 0 ? false : true); + miEggModeEggQuantityField[iEggField]->add("1", 1, false, iEggField >= 2 ? false : true); + miEggModeEggQuantityField[iEggField]->add("2", 2, false, iEggField >= 2 ? false : true); + miEggModeEggQuantityField[iEggField]->add("3", 3, false, iEggField >= 1 ? false : true); + miEggModeEggQuantityField[iEggField]->add("4", 4, false, false); + miEggModeEggQuantityField[iEggField]->setOutputPtr(&game_values.gamemodemenusettings.egg.eggs[iEggField]); + miEggModeEggQuantityField[iEggField]->setCurrentValue(game_values.gamemodemenusettings.egg.eggs[iEggField]); + miEggModeEggQuantityField[iEggField]->allowWrap(false); } for (short iYoshiField = 0; iYoshiField < 4; iYoshiField++) { miEggModeYoshiQuantityField[iYoshiField] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_egg, 170, 220 + 40 * iYoshiField, 300, iYoshiField + 4); - miEggModeYoshiQuantityField[iYoshiField]->Add("0", 0, false, iYoshiField == 0 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->Add("1", 1, false, iYoshiField >= 2 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->Add("2", 2, false, iYoshiField >= 1 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->Add("3", 3, false, false); - miEggModeYoshiQuantityField[iYoshiField]->Add("4", 4, false, false); - miEggModeYoshiQuantityField[iYoshiField]->SetData(&game_values.gamemodemenusettings.egg.yoshis[iYoshiField], NULL, NULL); - miEggModeYoshiQuantityField[iYoshiField]->SetKey(game_values.gamemodemenusettings.egg.yoshis[iYoshiField]); - miEggModeYoshiQuantityField[iYoshiField]->SetNoWrap(true); + miEggModeYoshiQuantityField[iYoshiField]->add("0", 0, false, iYoshiField == 0 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->add("1", 1, false, iYoshiField >= 2 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->add("2", 2, false, iYoshiField >= 1 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->add("3", 3, false, false); + miEggModeYoshiQuantityField[iYoshiField]->add("4", 4, false, false); + miEggModeYoshiQuantityField[iYoshiField]->setOutputPtr(&game_values.gamemodemenusettings.egg.yoshis[iYoshiField]); + miEggModeYoshiQuantityField[iYoshiField]->setCurrentValue(game_values.gamemodemenusettings.egg.yoshis[iYoshiField]); + miEggModeYoshiQuantityField[iYoshiField]->allowWrap(false); } miEggModeExplosionTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 380, "Explosion Timer", 400, 180); @@ -437,19 +437,19 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** miFlagModeSpeedField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 120, "Speed", 400, 180, 380); - miFlagModeSpeedField->Add("-", -1); - miFlagModeSpeedField->Add("0", 0); - miFlagModeSpeedField->Add("1", 1); - miFlagModeSpeedField->Add("2", 2); - miFlagModeSpeedField->Add("3", 3); - miFlagModeSpeedField->Add("4", 4); - miFlagModeSpeedField->Add("5", 5); - miFlagModeSpeedField->Add("6", 6, false, false); - miFlagModeSpeedField->Add("7", 7, false, false); - miFlagModeSpeedField->Add("8", 8, false, false); - miFlagModeSpeedField->SetData(&game_values.gamemodemenusettings.flag.speed, NULL, NULL); - miFlagModeSpeedField->SetKey(game_values.gamemodemenusettings.flag.speed); - miFlagModeSpeedField->SetNoWrap(true); + miFlagModeSpeedField->add("-", -1); + miFlagModeSpeedField->add("0", 0); + miFlagModeSpeedField->add("1", 1); + miFlagModeSpeedField->add("2", 2); + miFlagModeSpeedField->add("3", 3); + miFlagModeSpeedField->add("4", 4); + miFlagModeSpeedField->add("5", 5); + miFlagModeSpeedField->add("6", 6, false, false); + miFlagModeSpeedField->add("7", 7, false, false); + miFlagModeSpeedField->add("8", 8, false, false); + miFlagModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.flag.speed); + miFlagModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.flag.speed); + miFlagModeSpeedField->allowWrap(false); miFlagModeTouchReturnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Touch Return", 400, 180); miFlagModeTouchReturnField->add("Off", false); @@ -617,30 +617,30 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miStarModeShineField->SetKey(game_values.gamemodemenusettings.star.shine); miStarModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); - miStarModePercentExtraTime->Add("0", 0, false, false); - miStarModePercentExtraTime->Add("5", 5, false, false); - miStarModePercentExtraTime->Add("10", 10); - miStarModePercentExtraTime->Add("15", 15); - miStarModePercentExtraTime->Add("20", 20); - miStarModePercentExtraTime->Add("25", 25); - miStarModePercentExtraTime->Add("30", 30); - miStarModePercentExtraTime->Add("35", 35); - miStarModePercentExtraTime->Add("40", 40); - miStarModePercentExtraTime->Add("45", 45); - miStarModePercentExtraTime->Add("50", 50); - miStarModePercentExtraTime->Add("55", 55, false, false); - miStarModePercentExtraTime->Add("60", 60, false, false); - miStarModePercentExtraTime->Add("65", 65, false, false); - miStarModePercentExtraTime->Add("70", 70, false, false); - miStarModePercentExtraTime->Add("75", 75, false, false); - miStarModePercentExtraTime->Add("80", 80, false, false); - miStarModePercentExtraTime->Add("85", 85, false, false); - miStarModePercentExtraTime->Add("90", 90, false, false); - miStarModePercentExtraTime->Add("95", 95, false, false); - miStarModePercentExtraTime->Add("100", 100, false, false); - miStarModePercentExtraTime->SetData(&game_values.gamemodemenusettings.star.percentextratime, NULL, NULL); - miStarModePercentExtraTime->SetKey(game_values.gamemodemenusettings.star.percentextratime); - miStarModePercentExtraTime->SetNoWrap(true); + miStarModePercentExtraTime->add("0", 0, false, false); + miStarModePercentExtraTime->add("5", 5, false, false); + miStarModePercentExtraTime->add("10", 10); + miStarModePercentExtraTime->add("15", 15); + miStarModePercentExtraTime->add("20", 20); + miStarModePercentExtraTime->add("25", 25); + miStarModePercentExtraTime->add("30", 30); + miStarModePercentExtraTime->add("35", 35); + miStarModePercentExtraTime->add("40", 40); + miStarModePercentExtraTime->add("45", 45); + miStarModePercentExtraTime->add("50", 50); + miStarModePercentExtraTime->add("55", 55, false, false); + miStarModePercentExtraTime->add("60", 60, false, false); + miStarModePercentExtraTime->add("65", 65, false, false); + miStarModePercentExtraTime->add("70", 70, false, false); + miStarModePercentExtraTime->add("75", 75, false, false); + miStarModePercentExtraTime->add("80", 80, false, false); + miStarModePercentExtraTime->add("85", 85, false, false); + miStarModePercentExtraTime->add("90", 90, false, false); + miStarModePercentExtraTime->add("95", 95, false, false); + miStarModePercentExtraTime->add("100", 100, false, false); + miStarModePercentExtraTime->setOutputPtr(&game_values.gamemodemenusettings.star.percentextratime); + miStarModePercentExtraTime->setCurrentValue(game_values.gamemodemenusettings.star.percentextratime); + miStarModePercentExtraTime->allowWrap(false); miStarModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miStarModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -900,20 +900,20 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iEnemy = 0; iEnemy < NUMSURVIVALENEMIES; iEnemy++) { miSurvivalModeEnemySlider[iEnemy] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_survival, 120, 120 + 40 * iEnemy, 400, iEnemy); - miSurvivalModeEnemySlider[iEnemy]->Add("", 0, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 1, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 2, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 3, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 4, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 5, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 6, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 7, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 8, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 9, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->Add("", 10, "", false, false); - miSurvivalModeEnemySlider[iEnemy]->SetNoWrap(true); - miSurvivalModeEnemySlider[iEnemy]->SetData(&game_values.gamemodemenusettings.survival.enemyweight[iEnemy], NULL, NULL); - miSurvivalModeEnemySlider[iEnemy]->SetKey(game_values.gamemodemenusettings.survival.enemyweight[iEnemy]); + miSurvivalModeEnemySlider[iEnemy]->add("", 0); + miSurvivalModeEnemySlider[iEnemy]->add("", 1); + miSurvivalModeEnemySlider[iEnemy]->add("", 2); + miSurvivalModeEnemySlider[iEnemy]->add("", 3); + miSurvivalModeEnemySlider[iEnemy]->add("", 4); + miSurvivalModeEnemySlider[iEnemy]->add("", 5); + miSurvivalModeEnemySlider[iEnemy]->add("", 6); + miSurvivalModeEnemySlider[iEnemy]->add("", 7); + miSurvivalModeEnemySlider[iEnemy]->add("", 8); + miSurvivalModeEnemySlider[iEnemy]->add("", 9); + miSurvivalModeEnemySlider[iEnemy]->add("", 10); + miSurvivalModeEnemySlider[iEnemy]->allowWrap(false); + miSurvivalModeEnemySlider[iEnemy]->setOutputPtr(&game_values.gamemodemenusettings.survival.enemyweight[iEnemy]); + miSurvivalModeEnemySlider[iEnemy]->setCurrentValue(game_values.gamemodemenusettings.survival.enemyweight[iEnemy]); } miSurvivalModeDensityField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Density", 400, 180); @@ -1009,30 +1009,30 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModeMultiplier->SetKey(game_values.gamemodemenusettings.greed.multiplier); miGreedModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Extra Coins", 400, 150, 384); - miGreedModePercentExtraCoin->Add("0", 0, false, false); - miGreedModePercentExtraCoin->Add("5", 5, false, false); - miGreedModePercentExtraCoin->Add("10", 10); - miGreedModePercentExtraCoin->Add("15", 15); - miGreedModePercentExtraCoin->Add("20", 20); - miGreedModePercentExtraCoin->Add("25", 25); - miGreedModePercentExtraCoin->Add("30", 30); - miGreedModePercentExtraCoin->Add("35", 35); - miGreedModePercentExtraCoin->Add("40", 40); - miGreedModePercentExtraCoin->Add("45", 45); - miGreedModePercentExtraCoin->Add("50", 50); - miGreedModePercentExtraCoin->Add("55", 55, false, false); - miGreedModePercentExtraCoin->Add("60", 60, false, false); - miGreedModePercentExtraCoin->Add("65", 65, false, false); - miGreedModePercentExtraCoin->Add("70", 70, false, false); - miGreedModePercentExtraCoin->Add("75", 75, false, false); - miGreedModePercentExtraCoin->Add("80", 80, false, false); - miGreedModePercentExtraCoin->Add("85", 85, false, false); - miGreedModePercentExtraCoin->Add("90", 90, false, false); - miGreedModePercentExtraCoin->Add("95", 95, false, false); - miGreedModePercentExtraCoin->Add("100", 100, false, false); - miGreedModePercentExtraCoin->SetData(&game_values.gamemodemenusettings.greed.percentextracoin, NULL, NULL); - miGreedModePercentExtraCoin->SetKey(game_values.gamemodemenusettings.greed.percentextracoin); - miGreedModePercentExtraCoin->SetNoWrap(true); + miGreedModePercentExtraCoin->add("0", 0, false, false); + miGreedModePercentExtraCoin->add("5", 5, false, false); + miGreedModePercentExtraCoin->add("10", 10); + miGreedModePercentExtraCoin->add("15", 15); + miGreedModePercentExtraCoin->add("20", 20); + miGreedModePercentExtraCoin->add("25", 25); + miGreedModePercentExtraCoin->add("30", 30); + miGreedModePercentExtraCoin->add("35", 35); + miGreedModePercentExtraCoin->add("40", 40); + miGreedModePercentExtraCoin->add("45", 45); + miGreedModePercentExtraCoin->add("50", 50); + miGreedModePercentExtraCoin->add("55", 55, false, false); + miGreedModePercentExtraCoin->add("60", 60, false, false); + miGreedModePercentExtraCoin->add("65", 65, false, false); + miGreedModePercentExtraCoin->add("70", 70, false, false); + miGreedModePercentExtraCoin->add("75", 75, false, false); + miGreedModePercentExtraCoin->add("80", 80, false, false); + miGreedModePercentExtraCoin->add("85", 85, false, false); + miGreedModePercentExtraCoin->add("90", 90, false, false); + miGreedModePercentExtraCoin->add("95", 95, false, false); + miGreedModePercentExtraCoin->add("100", 100, false, false); + miGreedModePercentExtraCoin->setOutputPtr(&game_values.gamemodemenusettings.greed.percentextracoin); + miGreedModePercentExtraCoin->setCurrentValue(game_values.gamemodemenusettings.greed.percentextracoin); + miGreedModePercentExtraCoin->allowWrap(false); miGreedModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miGreedModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -1090,30 +1090,30 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miHealthModeMaxLife->SetItemChangedCode(MENU_CODE_HEALTH_MODE_MAX_LIFE_CHANGED); miHealthModePercentExtraLife = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Life", 400, 150, 384); - miHealthModePercentExtraLife->Add("0", 0, false, false); - miHealthModePercentExtraLife->Add("5", 5, false, false); - miHealthModePercentExtraLife->Add("10", 10); - miHealthModePercentExtraLife->Add("15", 15); - miHealthModePercentExtraLife->Add("20", 20); - miHealthModePercentExtraLife->Add("25", 25); - miHealthModePercentExtraLife->Add("30", 30); - miHealthModePercentExtraLife->Add("35", 35); - miHealthModePercentExtraLife->Add("40", 40); - miHealthModePercentExtraLife->Add("45", 45); - miHealthModePercentExtraLife->Add("50", 50); - miHealthModePercentExtraLife->Add("55", 55, false, false); - miHealthModePercentExtraLife->Add("60", 60, false, false); - miHealthModePercentExtraLife->Add("65", 65, false, false); - miHealthModePercentExtraLife->Add("70", 70, false, false); - miHealthModePercentExtraLife->Add("75", 75, false, false); - miHealthModePercentExtraLife->Add("80", 80, false, false); - miHealthModePercentExtraLife->Add("85", 85, false, false); - miHealthModePercentExtraLife->Add("90", 90, false, false); - miHealthModePercentExtraLife->Add("95", 95, false, false); - miHealthModePercentExtraLife->Add("100", 100, false, false); - miHealthModePercentExtraLife->SetData(&game_values.gamemodemenusettings.health.percentextralife, NULL, NULL); - miHealthModePercentExtraLife->SetKey(game_values.gamemodemenusettings.health.percentextralife); - miHealthModePercentExtraLife->SetNoWrap(true); + miHealthModePercentExtraLife->add("0", 0, false, false); + miHealthModePercentExtraLife->add("5", 5, false, false); + miHealthModePercentExtraLife->add("10", 10); + miHealthModePercentExtraLife->add("15", 15); + miHealthModePercentExtraLife->add("20", 20); + miHealthModePercentExtraLife->add("25", 25); + miHealthModePercentExtraLife->add("30", 30); + miHealthModePercentExtraLife->add("35", 35); + miHealthModePercentExtraLife->add("40", 40); + miHealthModePercentExtraLife->add("45", 45); + miHealthModePercentExtraLife->add("50", 50); + miHealthModePercentExtraLife->add("55", 55, false, false); + miHealthModePercentExtraLife->add("60", 60, false, false); + miHealthModePercentExtraLife->add("65", 65, false, false); + miHealthModePercentExtraLife->add("70", 70, false, false); + miHealthModePercentExtraLife->add("75", 75, false, false); + miHealthModePercentExtraLife->add("80", 80, false, false); + miHealthModePercentExtraLife->add("85", 85, false, false); + miHealthModePercentExtraLife->add("90", 90, false, false); + miHealthModePercentExtraLife->add("95", 95, false, false); + miHealthModePercentExtraLife->add("100", 100, false, false); + miHealthModePercentExtraLife->setOutputPtr(&game_values.gamemodemenusettings.health.percentextralife); + miHealthModePercentExtraLife->setCurrentValue(game_values.gamemodemenusettings.health.percentextralife); + miHealthModePercentExtraLife->allowWrap(false); miHealthModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miHealthModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -1239,15 +1239,15 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iPhanto = 0; iPhanto < 3; iPhanto++) { miChaseModeQuantitySlider[iPhanto] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_phanto, 120, 200 + 40 * iPhanto, 400, iPhanto); - miChaseModeQuantitySlider[iPhanto]->Add("", 0, false, iPhanto == 0 ? false : true); - miChaseModeQuantitySlider[iPhanto]->Add("", 1); - miChaseModeQuantitySlider[iPhanto]->Add("", 2); - miChaseModeQuantitySlider[iPhanto]->Add("", 3, false, false); - miChaseModeQuantitySlider[iPhanto]->Add("", 4, false, false); - miChaseModeQuantitySlider[iPhanto]->Add("", 5, false, false); - miChaseModeQuantitySlider[iPhanto]->SetNoWrap(true); - miChaseModeQuantitySlider[iPhanto]->SetData(&game_values.gamemodemenusettings.chase.phantoquantity[iPhanto], NULL, NULL); - miChaseModeQuantitySlider[iPhanto]->SetKey(game_values.gamemodemenusettings.chase.phantoquantity[iPhanto]); + miChaseModeQuantitySlider[iPhanto]->add("", 0, false, iPhanto == 0 ? false : true); + miChaseModeQuantitySlider[iPhanto]->add("", 1); + miChaseModeQuantitySlider[iPhanto]->add("", 2); + miChaseModeQuantitySlider[iPhanto]->add("", 3, false, false); + miChaseModeQuantitySlider[iPhanto]->add("", 4, false, false); + miChaseModeQuantitySlider[iPhanto]->add("", 5, false, false); + miChaseModeQuantitySlider[iPhanto]->allowWrap(false); + miChaseModeQuantitySlider[iPhanto]->setOutputPtr(&game_values.gamemodemenusettings.chase.phantoquantity[iPhanto]); + miChaseModeQuantitySlider[iPhanto]->setCurrentValue(game_values.gamemodemenusettings.chase.phantoquantity[iPhanto]); } miChaseModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); @@ -1407,31 +1407,31 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) } else if (iMode == game_mode_timelimit) { // time game_values.gamemodesettings.time.style = miTimeLimitModeStyleField->GetRandomShortValue(); game_values.gamemodesettings.time.scoring = miTimeLimitModeScoringField->GetRandomShortValue(); - game_values.gamemodesettings.time.percentextratime = miTimeLimitModePercentExtraTime->GetRandomShortValue(); + game_values.gamemodesettings.time.percentextratime = miTimeLimitModePercentExtraTime->currentValue(); } else if (iMode == game_mode_jail) { // jail game_values.gamemodesettings.jail.style = miJailModeStyleField->GetRandomShortValue(); game_values.gamemodesettings.jail.timetofree = miJailModeTimeFreeField->GetRandomShortValue(); game_values.gamemodesettings.jail.tagfree = miJailModeTagFreeField->randomValue(); - game_values.gamemodesettings.jail.percentkey = miJailModeJailKeyField->GetRandomShortValue(); + game_values.gamemodesettings.jail.percentkey = miJailModeJailKeyField->currentValue(); } else if (iMode == game_mode_coins) { // coins game_values.gamemodesettings.coins.penalty = miCoinModePenaltyField->randomValue(); game_values.gamemodesettings.coins.quantity = miCoinModeQuantityField->GetRandomShortValue(); - game_values.gamemodesettings.coins.percentextracoin = miCoinModePercentExtraCoin->GetRandomShortValue(); + game_values.gamemodesettings.coins.percentextracoin = miCoinModePercentExtraCoin->currentValue(); } else if (iMode == game_mode_stomp) { // stomp game_values.gamemodesettings.stomp.rate = miStompModeRateField->GetRandomShortValue(); for (short iEnemy = 0; iEnemy < NUMSTOMPENEMIES; iEnemy++) - game_values.gamemodesettings.stomp.enemyweight[iEnemy] = miStompModeEnemySlider[iEnemy]->GetRandomShortValue(); + game_values.gamemodesettings.stomp.enemyweight[iEnemy] = miStompModeEnemySlider[iEnemy]->currentValue(); } else if (iMode == game_mode_eggs) { // egg for (int iEgg = 0; iEgg < 4; iEgg++) - game_values.gamemodesettings.egg.eggs[iEgg] = miEggModeEggQuantityField[iEgg]->GetRandomShortValue(); + game_values.gamemodesettings.egg.eggs[iEgg] = miEggModeEggQuantityField[iEgg]->currentValue(); for (int iYoshi = 0; iYoshi < 4; iYoshi++) - game_values.gamemodesettings.egg.yoshis[iYoshi] = miEggModeYoshiQuantityField[iYoshi]->GetRandomShortValue(); + game_values.gamemodesettings.egg.yoshis[iYoshi] = miEggModeYoshiQuantityField[iYoshi]->currentValue(); game_values.gamemodesettings.egg.explode = miEggModeExplosionTimeField->GetRandomShortValue(); } else if (iMode == game_mode_ctf) { // capture the flag - game_values.gamemodesettings.flag.speed = miFlagModeSpeedField->GetRandomShortValue(); + game_values.gamemodesettings.flag.speed = miFlagModeSpeedField->currentValue(); game_values.gamemodesettings.flag.touchreturn = miFlagModeTouchReturnField->randomValue(); game_values.gamemodesettings.flag.pointmove = miFlagModePointMoveField->randomValue(); game_values.gamemodesettings.flag.autoreturn = miFlagModeAutoReturnField->GetRandomShortValue(); @@ -1445,7 +1445,7 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) } else if (iMode == game_mode_star) { // star game_values.gamemodesettings.star.time = miStarModeTimeField->GetRandomShortValue(); game_values.gamemodesettings.star.shine = miStarModeShineField->GetRandomShortValue(); - game_values.gamemodesettings.star.percentextratime = miStarModePercentExtraTime->GetRandomShortValue(); + game_values.gamemodesettings.star.percentextratime = miStarModePercentExtraTime->currentValue(); } else if (iMode == game_mode_domination) { // domination game_values.gamemodesettings.domination.quantity = miDominationModeQuantityField->GetRandomShortValue(); game_values.gamemodesettings.domination.loseondeath = miDominationModeLoseOnDeathField->randomValue(); @@ -1468,16 +1468,16 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) game_values.gamemodesettings.survival.shield = miSurvivalModeShieldField->randomValue(); for (short iEnemy = 0; iEnemy < NUMSURVIVALENEMIES; iEnemy++) - game_values.gamemodesettings.survival.enemyweight[iEnemy] = miSurvivalModeEnemySlider[iEnemy]->GetRandomShortValue(); + game_values.gamemodesettings.survival.enemyweight[iEnemy] = miSurvivalModeEnemySlider[iEnemy]->currentValue(); } else if (iMode == game_mode_greed) { // greed game_values.gamemodesettings.greed.coinlife = miGreedModeCoinLife->GetRandomShortValue(); game_values.gamemodesettings.greed.owncoins = miGreedModeOwnCoins->randomValue(); game_values.gamemodesettings.greed.multiplier = miGreedModeMultiplier->GetRandomShortValue(); - game_values.gamemodesettings.greed.percentextracoin = miGreedModePercentExtraCoin->GetRandomShortValue(); + game_values.gamemodesettings.greed.percentextracoin = miGreedModePercentExtraCoin->currentValue(); } else if (iMode == game_mode_health) { // health game_values.gamemodesettings.health.startlife = miHealthModeStartLife->GetRandomShortValue(); game_values.gamemodesettings.health.maxlife = miHealthModeMaxLife->GetRandomShortValue(); - game_values.gamemodesettings.health.percentextralife = miHealthModePercentExtraLife->GetRandomShortValue(); + game_values.gamemodesettings.health.percentextralife = miHealthModePercentExtraLife->currentValue(); } else if (iMode == game_mode_collection) { // card collection game_values.gamemodesettings.collection.quantity = miCollectionModeQuantityField->GetRandomShortValue(); game_values.gamemodesettings.collection.rate = miCollectionModeRateField->GetRandomShortValue(); @@ -1487,7 +1487,7 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) game_values.gamemodesettings.chase.phantospeed = miChaseModeSpeedField->GetRandomShortValue(); for (short iPhanto = 0; iPhanto < 3; iPhanto++) - game_values.gamemodesettings.chase.phantoquantity[iPhanto] = miChaseModeQuantitySlider[iPhanto]->GetRandomShortValue(); + game_values.gamemodesettings.chase.phantoquantity[iPhanto] = miChaseModeQuantitySlider[iPhanto]->currentValue(); } else if (iMode == game_mode_shyguytag) { // shyguy tag game_values.gamemodesettings.shyguytag.tagonsuicide = miShyGuyTagModeTagOnSuicideField->randomValue(); game_values.gamemodesettings.shyguytag.tagtransfer = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); diff --git a/src/smw/menu/ModeOptionsMenu.h b/src/smw/menu/ModeOptionsMenu.h index 82583306..13b2c7cd 100644 --- a/src/smw/menu/ModeOptionsMenu.h +++ b/src/smw/menu/ModeOptionsMenu.h @@ -79,7 +79,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Coins MI_SelectFieldDyn* miCoinModePenaltyField; MI_SelectField* miCoinModeQuantityField; - MI_SelectField* miCoinModePercentExtraCoin; + MI_SliderField* miCoinModePercentExtraCoin; MI_Button* miCoinModeBackButton; MI_Image* miCoinModeLeftHeaderBar; @@ -203,7 +203,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_SelectField* miGreedModeCoinLife; MI_SelectFieldDyn* miGreedModeOwnCoins; MI_SelectField* miGreedModeMultiplier; - MI_SelectField* miGreedModePercentExtraCoin; + MI_SliderField* miGreedModePercentExtraCoin; MI_Button* miGreedModeBackButton; MI_Image* miGreedModeLeftHeaderBar; diff --git a/src/smw/menu/options/SoundOptionsMenu.cpp b/src/smw/menu/options/SoundOptionsMenu.cpp index 23b03125..cc198108 100644 --- a/src/smw/menu/options/SoundOptionsMenu.cpp +++ b/src/smw/menu/options/SoundOptionsMenu.cpp @@ -24,34 +24,34 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() : UI_Menu() { miSoundVolumeField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 100, "Sound Volume", 500, 220, 484); - miSoundVolumeField->Add("Off", 0); - miSoundVolumeField->Add("1", 16); - miSoundVolumeField->Add("2", 32); - miSoundVolumeField->Add("3", 48); - miSoundVolumeField->Add("4", 64); - miSoundVolumeField->Add("5", 80); - miSoundVolumeField->Add("6", 96); - miSoundVolumeField->Add("7", 112); - miSoundVolumeField->Add("Max", 128); - miSoundVolumeField->SetData(&game_values.soundvolume, NULL, NULL); - miSoundVolumeField->SetKey(game_values.soundvolume); - miSoundVolumeField->SetNoWrap(true); - miSoundVolumeField->SetItemChangedCode(MENU_CODE_SOUND_VOLUME_CHANGED); + miSoundVolumeField->add("Off", 0); + miSoundVolumeField->add("1", 16); + miSoundVolumeField->add("2", 32); + miSoundVolumeField->add("3", 48); + miSoundVolumeField->add("4", 64); + miSoundVolumeField->add("5", 80); + miSoundVolumeField->add("6", 96); + miSoundVolumeField->add("7", 112); + miSoundVolumeField->add("Max", 128); + miSoundVolumeField->setOutputPtr(&game_values.soundvolume); + miSoundVolumeField->setCurrentValue(game_values.soundvolume); + miSoundVolumeField->allowWrap(false); + miSoundVolumeField->setItemChangedCode(MENU_CODE_SOUND_VOLUME_CHANGED); miMusicVolumeField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 140, "Music Volume", 500, 220, 484); - miMusicVolumeField->Add("Off", 0); - miMusicVolumeField->Add("1", 16); - miMusicVolumeField->Add("2", 32); - miMusicVolumeField->Add("3", 48); - miMusicVolumeField->Add("4", 64); - miMusicVolumeField->Add("5", 80); - miMusicVolumeField->Add("6", 96); - miMusicVolumeField->Add("7", 112); - miMusicVolumeField->Add("Max", 128); - miMusicVolumeField->SetData(&game_values.musicvolume, NULL, NULL); - miMusicVolumeField->SetKey(game_values.musicvolume); - miMusicVolumeField->SetNoWrap(true); - miMusicVolumeField->SetItemChangedCode(MENU_CODE_MUSIC_VOLUME_CHANGED); + miMusicVolumeField->add("Off", 0); + miMusicVolumeField->add("1", 16); + miMusicVolumeField->add("2", 32); + miMusicVolumeField->add("3", 48); + miMusicVolumeField->add("4", 64); + miMusicVolumeField->add("5", 80); + miMusicVolumeField->add("6", 96); + miMusicVolumeField->add("7", 112); + miMusicVolumeField->add("Max", 128); + miMusicVolumeField->setOutputPtr(&game_values.musicvolume); + miMusicVolumeField->setCurrentValue(game_values.musicvolume); + miMusicVolumeField->allowWrap(false); + miMusicVolumeField->setItemChangedCode(MENU_CODE_MUSIC_VOLUME_CHANGED); miPlayNextMusicField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Next Music", 500, 220); miPlayNextMusicField->Add("Off", 0); diff --git a/src/smw/ui/MI_FrenzyModeOptions.cpp b/src/smw/ui/MI_FrenzyModeOptions.cpp index 20205eb5..bb3dc95f 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.cpp +++ b/src/smw/ui/MI_FrenzyModeOptions.cpp @@ -68,20 +68,20 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short short iPowerupMap[] = {8, 5, 11, 17, 19, 21, 23, 24, 25, 20, 9, 16, 10, 22, 12, 13, 14, 15, 27}; for (short iPowerup = 0; iPowerup < NUMFRENZYCARDS; iPowerup++) { miPowerupSlider[iPowerup] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_storedpoweruplarge, iPowerup < 10 ? 65 : 330, 0, 245, iPowerupMap[iPowerup]); - miPowerupSlider[iPowerup]->Add("", 0, "", false, false); - miPowerupSlider[iPowerup]->Add("", 1, "", false, false); - miPowerupSlider[iPowerup]->Add("", 2, "", false, false); - miPowerupSlider[iPowerup]->Add("", 3, "", false, false); - miPowerupSlider[iPowerup]->Add("", 4, "", false, false); - miPowerupSlider[iPowerup]->Add("", 5, "", false, false); - miPowerupSlider[iPowerup]->Add("", 6, "", false, false); - miPowerupSlider[iPowerup]->Add("", 7, "", false, false); - miPowerupSlider[iPowerup]->Add("", 8, "", false, false); - miPowerupSlider[iPowerup]->Add("", 9, "", false, false); - miPowerupSlider[iPowerup]->Add("", 10, "", false, false); - miPowerupSlider[iPowerup]->SetNoWrap(true); - miPowerupSlider[iPowerup]->SetData(&game_values.gamemodemenusettings.frenzy.powerupweight[iPowerup], NULL, NULL); - miPowerupSlider[iPowerup]->SetKey(game_values.gamemodemenusettings.frenzy.powerupweight[iPowerup]); + miPowerupSlider[iPowerup]->add("", 0); + miPowerupSlider[iPowerup]->add("", 1); + miPowerupSlider[iPowerup]->add("", 2); + miPowerupSlider[iPowerup]->add("", 3); + miPowerupSlider[iPowerup]->add("", 4); + miPowerupSlider[iPowerup]->add("", 5); + miPowerupSlider[iPowerup]->add("", 6); + miPowerupSlider[iPowerup]->add("", 7); + miPowerupSlider[iPowerup]->add("", 8); + miPowerupSlider[iPowerup]->add("", 9); + miPowerupSlider[iPowerup]->add("", 10); + miPowerupSlider[iPowerup]->allowWrap(false); + miPowerupSlider[iPowerup]->setOutputPtr(&game_values.gamemodemenusettings.frenzy.powerupweight[iPowerup]); + miPowerupSlider[iPowerup]->setCurrentValue(game_values.gamemodemenusettings.frenzy.powerupweight[iPowerup]); } miBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); @@ -243,7 +243,7 @@ void MI_FrenzyModeOptions::SetRandomGameModeSettings() game_values.gamemodesettings.frenzy.storedshells = miStoredShellsField->randomValue(); for (short iPowerup = 0; iPowerup < NUMFRENZYCARDS; iPowerup++) - game_values.gamemodesettings.frenzy.powerupweight[iPowerup] = miPowerupSlider[iPowerup]->GetRandomShortValue(); + game_values.gamemodesettings.frenzy.powerupweight[iPowerup] = miPowerupSlider[iPowerup]->randomValue(); } void MI_FrenzyModeOptions::AdjustDisplayArrows() diff --git a/src/smw/ui/MI_PowerupSelection.cpp b/src/smw/ui/MI_PowerupSelection.cpp index 6efa21b4..f8d6d51b 100644 --- a/src/smw/ui/MI_PowerupSelection.cpp +++ b/src/smw/ui/MI_PowerupSelection.cpp @@ -108,21 +108,21 @@ MI_PowerupSelection::MI_PowerupSelection(short x, short y, short width, short nu for (short iPowerup = 0; iPowerup < NUM_POWERUPS; iPowerup++) { miPowerupSlider[iPowerup] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_storedpoweruplarge, 0, 0, 245, iPowerupPositionMap[iPowerup]); - miPowerupSlider[iPowerup]->Add("", 0, "", false, false); - miPowerupSlider[iPowerup]->Add("", 1, "", false, false); - miPowerupSlider[iPowerup]->Add("", 2, "", false, false); - miPowerupSlider[iPowerup]->Add("", 3, "", false, false); - miPowerupSlider[iPowerup]->Add("", 4, "", false, false); - miPowerupSlider[iPowerup]->Add("", 5, "", false, false); - miPowerupSlider[iPowerup]->Add("", 6, "", false, false); - miPowerupSlider[iPowerup]->Add("", 7, "", false, false); - miPowerupSlider[iPowerup]->Add("", 8, "", false, false); - miPowerupSlider[iPowerup]->Add("", 9, "", false, false); - miPowerupSlider[iPowerup]->Add("", 10, "", false, false); - miPowerupSlider[iPowerup]->SetNoWrap(true); - miPowerupSlider[iPowerup]->SetData(&game_values.powerupweights[iPowerupPositionMap[iPowerup]], NULL, NULL); - miPowerupSlider[iPowerup]->SetKey(game_values.powerupweights[iPowerupPositionMap[iPowerup]]); - miPowerupSlider[iPowerup]->SetItemChangedCode(MENU_CODE_POWERUP_SETTING_CHANGED); + miPowerupSlider[iPowerup]->add("", 0); + miPowerupSlider[iPowerup]->add("", 1); + miPowerupSlider[iPowerup]->add("", 2); + miPowerupSlider[iPowerup]->add("", 3); + miPowerupSlider[iPowerup]->add("", 4); + miPowerupSlider[iPowerup]->add("", 5); + miPowerupSlider[iPowerup]->add("", 6); + miPowerupSlider[iPowerup]->add("", 7); + miPowerupSlider[iPowerup]->add("", 8); + miPowerupSlider[iPowerup]->add("", 9); + miPowerupSlider[iPowerup]->add("", 10); + miPowerupSlider[iPowerup]->allowWrap(false); + miPowerupSlider[iPowerup]->setOutputPtr(&game_values.powerupweights[iPowerupPositionMap[iPowerup]]); + miPowerupSlider[iPowerup]->setCurrentValue(game_values.powerupweights[iPowerupPositionMap[iPowerup]]); + miPowerupSlider[iPowerup]->setItemChangedCode(MENU_CODE_POWERUP_SETTING_CHANGED); } miRestoreDefaultsButton = new MI_Button(&rm->spr_selectfield, 160, 432, "Defaults", 150, TextAlign::CENTER); @@ -256,7 +256,7 @@ MenuCodeEnum MI_PowerupSelection::SendInput(CPlayerInput* playerInput) } else if (MENU_CODE_POWERUP_PRESET_CHANGED == ret) { for (short iPowerup = 0; iPowerup < NUM_POWERUPS; iPowerup++) { short iCurrentValue = g_iCurrentPowerupPresets[game_values.poweruppreset][iPowerupPositionMap[iPowerup]]; - miPowerupSlider[iPowerup]->SetKey(iCurrentValue); + miPowerupSlider[iPowerup]->setCurrentValue(iCurrentValue); game_values.powerupweights[iPowerupPositionMap[iPowerup]] = iCurrentValue; } @@ -300,7 +300,7 @@ MenuCodeEnum MI_PowerupSelection::SendInput(CPlayerInput* playerInput) //restore default powerup weights for powerup selection menu for (short iPowerup = 0; iPowerup < NUM_POWERUPS; iPowerup++) { short iDefaultValue = g_iDefaultPowerupPresets[game_values.poweruppreset][iPowerupPositionMap[iPowerup]]; - miPowerupSlider[iPowerup]->SetKey(iDefaultValue); + miPowerupSlider[iPowerup]->setCurrentValue(iDefaultValue); game_values.powerupweights[iPowerupPositionMap[iPowerup]] = iDefaultValue; g_iCurrentPowerupPresets[game_values.poweruppreset][iPowerupPositionMap[iPowerup]] = iDefaultValue; @@ -308,7 +308,7 @@ MenuCodeEnum MI_PowerupSelection::SendInput(CPlayerInput* playerInput) } else if (MENU_CODE_POWERUP_CLEAR_YES == ret) { //restore default powerup weights for powerup selection menu for (short iPowerup = 0; iPowerup < NUM_POWERUPS; iPowerup++) { - miPowerupSlider[iPowerup]->SetKey(0); + miPowerupSlider[iPowerup]->setCurrentValue(0); game_values.powerupweights[iPowerup] = 0; g_iCurrentPowerupPresets[game_values.poweruppreset][iPowerup] = 0; diff --git a/src/smw/ui/MI_PowerupSlider.cpp b/src/smw/ui/MI_PowerupSlider.cpp index 86f014ea..89fd43a5 100644 --- a/src/smw/ui/MI_PowerupSlider.cpp +++ b/src/smw/ui/MI_PowerupSlider.cpp @@ -5,12 +5,12 @@ MI_PowerupSlider::MI_PowerupSlider(gfxSprite* nspr, gfxSprite* nsprSlider, gfxSprite* nsprPowerup, short x, short y, short width, short powerupIndex) : MI_SliderField(nspr, nsprSlider, x, y, "", width, 0, 0) - , sprPowerup(nsprPowerup) - , iPowerupIndex(powerupIndex) - , iHalfWidth((width - 38) / 2) + , m_sprPowerup(nsprPowerup) + , m_powerupIndex(powerupIndex) + , m_halfWidth((width - 38) / 2) { miModifyImageLeft->SetPosition(ix + 25, iy + 4); - miModifyImageRight->SetPosition(ix + iWidth - 12, iy + 4); + miModifyImageRight->SetPosition(ix + m_width - 12, iy + 4); } void MI_PowerupSlider::Draw() @@ -18,30 +18,30 @@ void MI_PowerupSlider::Draw() if (!fShow) return; - spr->draw(ix + 38, iy, 0, (fSelected ? 32 : 0) + iAdjustmentY, iHalfWidth, 32); - spr->draw(ix + 38 + iHalfWidth, iy, 550 - iWidth + iHalfWidth, (fSelected ? 32 : 0) + iAdjustmentY, iWidth - iHalfWidth - 38, 32); + m_spr->draw(ix + 38, iy, 0, (fSelected ? 32 : 0) + m_adjustmentY, m_halfWidth, 32); + m_spr->draw(ix + 38 + m_halfWidth, iy, 550 - m_width + m_halfWidth, (fSelected ? 32 : 0) + m_adjustmentY, m_width - m_halfWidth - 38, 32); - short iSpacing = (iWidth - 100) / ((short)items.size() - 1); + short iSpacing = (m_width - 100) / ((short)m_items.size() - 1); short iSpot = 0; - for (unsigned int index = 0; index < items.size(); index++) { - if (index < items.size() - 1) - sprSlider->draw(ix + iSpot + 56, iy + 10, 0, 0, iSpacing, 13); + for (unsigned int index = 0; index < m_items.size(); index++) { + if (index < m_items.size() - 1) + m_sprSlider->draw(ix + iSpot + 56, iy + 10, 0, 0, iSpacing, 13); else - sprSlider->draw(ix + iSpot + 56, iy + 10, 164, 0, 4, 13); + m_sprSlider->draw(ix + iSpot + 56, iy + 10, 164, 0, 4, 13); iSpot += iSpacing; } - sprSlider->draw(ix + (iIndex * iSpacing) + 54, iy + 8, 168, 0, 8, 16); + m_sprSlider->draw(ix + (m_index * iSpacing) + 54, iy + 8, 168, 0, 8, 16); + m_sprSlider->draw(ix + m_width - 34, iy + 8, m_index * 16, 16, 16, 16); + m_sprPowerup->draw(ix, iy, m_powerupIndex * 32, 0, 32, 32); - sprSlider->draw(ix + iWidth - 34, iy + 8, iIndex * 16, 16, 16, 16); - - sprPowerup->draw(ix, iy, iPowerupIndex * 32, 0, 32, 32); - - if (current != items.begin() || !fNoWrap) + const bool drawLeft = m_index > 0; + if (m_wraps || drawLeft) miModifyImageLeft->Draw(); - if (current != --items.end() || !fNoWrap) + const bool drawRight = (m_index + 1) < m_items.size(); + if (m_wraps || drawRight) miModifyImageRight->Draw(); } diff --git a/src/smw/ui/MI_PowerupSlider.h b/src/smw/ui/MI_PowerupSlider.h index 2a5115a7..018aaf1c 100644 --- a/src/smw/ui/MI_PowerupSlider.h +++ b/src/smw/ui/MI_PowerupSlider.h @@ -13,7 +13,7 @@ class MI_PowerupSlider : public MI_SliderField { void Draw() override; protected: - gfxSprite* sprPowerup = nullptr; - short iPowerupIndex = 0; - short iHalfWidth = 0; + gfxSprite* m_sprPowerup = nullptr; + short m_powerupIndex = 0; + short m_halfWidth = 0; }; From f295b5491e062703a762de1d3a240fe37128daf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 00:18:32 +0100 Subject: [PATCH 05/14] Converted MI_ImageSelectField to use the new select field --- src/common/ui/MI_ImageSelectField.cpp | 24 +++----- src/common/ui/MI_ImageSelectField.h | 3 +- src/common/ui/MI_SelectField.cpp | 31 +++++++++- src/common/ui/MI_SelectField.h | 10 +--- src/smw/menu/GameSettingsMenu.cpp | 16 ++--- .../menu/network/NetNewRoomSettingsMenu.cpp | 2 +- src/smw/ui/MI_TourStop.cpp | 4 +- src/worldeditor/worldeditor.cpp | 60 ++++++++++--------- 8 files changed, 83 insertions(+), 67 deletions(-) diff --git a/src/common/ui/MI_ImageSelectField.cpp b/src/common/ui/MI_ImageSelectField.cpp index e5c56457..a237b79c 100644 --- a/src/common/ui/MI_ImageSelectField.cpp +++ b/src/common/ui/MI_ImageSelectField.cpp @@ -15,36 +15,28 @@ MI_ImageSelectField::MI_ImageSelectField( std::string name, short width, short indent, short imageHeight, short imageWidth) - : MI_SelectField(nspr, x, y, std::move(name), width, indent) + : MI_SelectFieldDyn(nspr, x, y, std::move(name), width, indent) , spr_image(nspr_image) , iImageWidth(imageWidth) , iImageHeight(imageHeight) {} -MI_ImageSelectField::MI_ImageSelectField(const MI_ImageSelectField& other) - : MI_SelectField(other) -{ - spr_image = other.spr_image; - iImageWidth = other.iImageWidth; - iImageHeight = other.iImageHeight; -} - void MI_ImageSelectField::Draw() { if (!fShow) return; - spr->draw(ix, iy, 0, (fSelected ? 32 : 0), iIndent - 16, 32); - spr->draw(ix + iIndent - 16, iy, 0, (fSelected ? 96 : 64), 32, 32); - spr->draw(ix + iIndent + 16, iy, 528 - iWidth + iIndent, (fSelected ? 32 : 0), iWidth - iIndent - 16, 32); + m_spr->draw(ix, iy, 0, (fSelected ? 32 : 0), m_indent - 16, 32); + m_spr->draw(ix + m_indent - 16, iy, 0, (fSelected ? 96 : 64), 32, 32); + m_spr->draw(ix + m_indent + 16, iy, 528 - m_width + m_indent, (fSelected ? 32 : 0), m_width - m_indent - 16, 32); - rm->menu_font_large.drawChopRight(ix + 16, iy + 5, iIndent - 8, szName.c_str()); + rm->menu_font_large.drawChopRight(ix + 16, iy + 5, m_indent - 8, m_name.c_str()); - if (!items.empty()) { - rm->menu_font_large.drawChopRight(ix + iIndent + iImageWidth + 10, iy + 5, iWidth - iIndent - 24, (*current)->sName.c_str()); + if (!m_items.empty()) { + rm->menu_font_large.drawChopRight(ix + m_indent + iImageWidth + 10, iy + 5, m_width - m_indent - 24, currentItem().name.c_str()); } - spr_image->draw(ix + iIndent + 8, iy + 16 - (iImageHeight >> 1), ((*current)->iIconOverride >= 0 ? (*current)->iIconOverride : (*current)->iValue) * iImageWidth, 0, iImageWidth, iImageHeight); + spr_image->draw(ix + m_indent + 8, iy + 16 - (iImageHeight >> 1), (currentItem().iconOverride >= 0 ? currentItem().iconOverride : currentItem().value) * iImageWidth, 0, iImageWidth, iImageHeight); miModifyImageRight->Draw(); miModifyImageLeft->Draw(); diff --git a/src/common/ui/MI_ImageSelectField.h b/src/common/ui/MI_ImageSelectField.h index 2916a1bd..92ca6f8a 100644 --- a/src/common/ui/MI_ImageSelectField.h +++ b/src/common/ui/MI_ImageSelectField.h @@ -3,7 +3,7 @@ #include "ui/MI_SelectField.h" -class MI_ImageSelectField : public MI_SelectField { +class MI_ImageSelectField : public MI_SelectFieldDyn { public: MI_ImageSelectField( gfxSprite* nspr, gfxSprite* nspr_image, @@ -11,7 +11,6 @@ class MI_ImageSelectField : public MI_SelectField { std::string name, short width, short indent, short imageHeight, short imageWidth); - MI_ImageSelectField(const MI_ImageSelectField&); virtual ~MI_ImageSelectField() = default; void Draw() override; diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index eb5651cd..19073d01 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -499,6 +499,33 @@ MI_SelectFieldDyn::MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std:: } +template +MI_SelectFieldDyn::MI_SelectFieldDyn(const MI_SelectFieldDyn& other) + : UI_Control(other) + , m_spr(other.m_spr) + , m_name(other.m_name) + , mcItemChangedCode(other.mcItemChangedCode) + , mcControlSelectedCode(other.mcControlSelectedCode) + , m_autoAdvance(other.m_autoAdvance) + , m_wraps(other.m_wraps) + , m_fastScroll(other.m_fastScroll) + , m_adjustmentY(other.m_adjustmentY) + , m_width(other.m_width) + , m_indent(other.m_indent) + , m_items(other.m_items) + , m_goodRandomIndices(other.m_goodRandomIndices) + , m_outputPtr(other.m_outputPtr) +{ + setCurrentIndex(other.m_index); + + miModifyImageLeft = std::make_unique(m_spr, ix + m_indent - 26, iy + 4, 32, 64, 26, 24, 4, 1, 8); + miModifyImageLeft->Show(false); + + miModifyImageRight = std::make_unique(m_spr, ix + m_width - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); + miModifyImageRight->Show(false); +} + + template void MI_SelectFieldDyn::Update() { @@ -690,7 +717,7 @@ void MI_SelectFieldDyn::updateOutput() const template -void MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool goodRandom) +SF_ListItemDyn& MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool goodRandom) { size_t new_idx = m_items.size(); m_items.emplace_back(std::move(name), std::move(value), hidden, -1); @@ -698,6 +725,8 @@ void MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool good if (goodRandom) m_goodRandomIndices.push_back(new_idx); + + return m_items.back(); } diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 2e87a493..5c1cb2c7 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -176,13 +176,6 @@ struct SF_ListItemDyn { static_assert(std::is_trivially_copyable::value, ""); } - /*SF_ListItemDyn(const SF_ListItemDyn& other) - : name(other.name) - , value(other.value) - , hidden(other.hidden) - , iconOverride(other.iconOverride) - {}*/ - const std::string name; //!< Display name const T value; bool hidden = false; @@ -196,6 +189,7 @@ class MI_SelectFieldDyn : public UI_Control { public: MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std::string name, short width, short indent); + MI_SelectFieldDyn(const MI_SelectFieldDyn&); virtual ~MI_SelectFieldDyn() = default; //! Set the displayed name. @@ -243,7 +237,7 @@ class MI_SelectFieldDyn : public UI_Control { //! Sets the currently selected item bool setCurrentIndex(size_t index); //! Adds an item to the list - void add(std::string name, T value, bool hidden = false, bool goodRandom = true); + Item& add(std::string name, T value, bool hidden = false, bool goodRandom = true); //! Removes all items void clear(); //! Hides the items containing the specified value diff --git a/src/smw/menu/GameSettingsMenu.cpp b/src/smw/menu/GameSettingsMenu.cpp index 35dc571f..454623c2 100644 --- a/src/smw/menu/GameSettingsMenu.cpp +++ b/src/smw/menu/GameSettingsMenu.cpp @@ -33,11 +33,11 @@ UI_GameSettingsMenu::UI_GameSettingsMenu() miModeField = new MI_ImageSelectField(&rm->spr_selectfield, &rm->menu_mode_small, 70, 85, "Mode", 500, 120, 16, 16); for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { - miModeField->Add(gamemodes[iGameMode]->GetModeName(), iGameMode, "", false, false); + miModeField->add(gamemodes[iGameMode]->GetModeName(), iGameMode); } - miModeField->SetData(¤tgamemode, NULL, NULL); - miModeField->SetKey(0); - miModeField->SetItemChangedCode(MENU_CODE_MODE_CHANGED); + miModeField->setOutputPtr(¤tgamemode); + miModeField->setCurrentValue(0); + miModeField->setItemChangedCode(MENU_CODE_MODE_CHANGED); for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { miGoalField[iGameMode] = new MI_SelectField(&rm->spr_selectfield, 70, 125, gamemodes[iGameMode]->GetGoalName().c_str(), 352, 120); @@ -142,11 +142,11 @@ UI_GameSettingsMenu::UI_GameSettingsMenu() void UI_GameSettingsMenu::RefreshGameModeButtons() { // Unhide/hide the settings button - miModeSettingsButton->Show(miModeField->GetShortValue() != game_mode_owned); + miModeSettingsButton->Show(miModeField->currentValue() != game_mode_owned); // Show the approprate goal field for (short iMode = 0; iMode < GAMEMODE_LAST; iMode++) { - miGoalField[iMode]->Show(miModeField->GetShortValue() == iMode); + miGoalField[iMode]->Show(miModeField->currentValue() == iMode); } } @@ -208,7 +208,7 @@ void UI_GameSettingsMenu::SetHeaderText(const char* string) void UI_GameSettingsMenu::GameModeChanged(short gmID) { - miModeField->SetKey(gmID); + miModeField->setCurrentValue(gmID); RefreshGameModeButtons(); } @@ -220,7 +220,7 @@ void UI_GameSettingsMenu::HideGMSettingsBtn() short UI_GameSettingsMenu::GetCurrentGameModeID() { - return miModeField->GetShortValue(); + return miModeField->currentValue(); } const char* UI_GameSettingsMenu::GetCurrentMapName() diff --git a/src/smw/menu/network/NetNewRoomSettingsMenu.cpp b/src/smw/menu/network/NetNewRoomSettingsMenu.cpp index d67d3c26..a6071f2a 100644 --- a/src/smw/menu/network/NetNewRoomSettingsMenu.cpp +++ b/src/smw/menu/network/NetNewRoomSettingsMenu.cpp @@ -73,7 +73,7 @@ UI_NetNewRoomSettingsMenu::UI_NetNewRoomSettingsMenu(const UI_GameSettingsMenu* void UI_NetNewRoomSettingsMenu::RefreshGameModeButtons() { for (short iMode = 0; iMode < GAMEMODE_LAST; iMode++) - miGoalField[iMode]->Show(miModeField->GetShortValue() == iMode); + miGoalField[iMode]->Show(miModeField->currentValue() == iMode); } std::string UI_NetNewRoomSettingsMenu::getCurrentMapPath() const diff --git a/src/smw/ui/MI_TourStop.cpp b/src/smw/ui/MI_TourStop.cpp index 74b5e543..28e60e8e 100644 --- a/src/smw/ui/MI_TourStop.cpp +++ b/src/smw/ui/MI_TourStop.cpp @@ -130,7 +130,7 @@ void MI_TourStop::Refresh(short iTourStop) TourStop * tourstop = game_values.tourstops[iTourStop]; if (tourstop->iStageType == 0) { - miModeField->Clear(); + miModeField->clear(); CGameMode * gamemode = NULL; short tourstopicon = 0; @@ -149,7 +149,7 @@ void MI_TourStop::Refresh(short iTourStop) tourstopicon = tourstop->iMode; } - miModeField->Add(gamemode->GetModeName(), tourstopicon, "", false, false); + miModeField->add(gamemode->GetModeName(), tourstopicon); miGoalField->Clear(); char szTemp[16]; diff --git a/src/worldeditor/worldeditor.cpp b/src/worldeditor/worldeditor.cpp index 9c2859c1..d8c7207c 100644 --- a/src/worldeditor/worldeditor.cpp +++ b/src/worldeditor/worldeditor.cpp @@ -650,27 +650,27 @@ int main(int argc, char *argv[]) miModeField = new MI_ImageSelectField(&rm->spr_selectfield, &rm->menu_mode_small, 70, 60, "Mode", 500, 120, 16, 16); //miModeField->SetData(game_values.tourstops[0]->iMode, NULL, NULL); //miModeField->SetKey(0); - miModeField->SetItemChangedCode(MENU_CODE_MODE_CHANGED); + miModeField->setItemChangedCode(MENU_CODE_MODE_CHANGED); for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { - miModeField->Add(stagemodes[iGameMode].szName, iGameMode, "", false, false); + miModeField->add(stagemodes[iGameMode].szName, iGameMode); miGoalField[iGameMode] = new MI_SelectField(&rm->spr_selectfield, 70, 100, stagemodes[iGameMode].szGoal, 352, 120); miGoalField[iGameMode]->Show(iGameMode == 0); for (short iGameModeOption = 0; iGameModeOption < GAMEMODE_NUM_OPTIONS - 1; iGameModeOption++) { StageModeOption * option = &stagemodes[iGameMode].options[iGameModeOption]; - miGoalField[iGameMode]->Add(option->szName, option->iValue, "", false, false); + miGoalField[iGameMode]->Add(option->szName, option->iValue); } //miGoalField[iGameMode]->SetData(&gamemodes[iGameMode]->goal, NULL, NULL); //miGoalField[iGameMode]->SetKey(gamemodes[iGameMode]->goal); } - miModeField->Add("Bonus House", 24); - miModeField->Add("Pipe Minigame", 25); - miModeField->Add("Boss Minigame", 26); - miModeField->Add("Boxes Minigame", 27); + miModeField->add("Bonus House", 24); + miModeField->add("Pipe Minigame", 25); + miModeField->add("Boss Minigame", 26); + miModeField->add("Boxes Minigame", 27); //Create goal field for pipe game miSpecialGoalField[0] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Points", 352, 120); @@ -838,20 +838,20 @@ int main(int argc, char *argv[]) //Create Vehicle Menu miVehicleSpriteField = new MI_ImageSelectField(&rm->spr_selectfield, &spr_vehicleicons, 70, 80, "Sprite", 500, 150, 16, 16); - miVehicleSpriteField->Add("Hammer Brother", 0); - miVehicleSpriteField->Add("Boomerang Brother", 1); - miVehicleSpriteField->Add("Fire Brother", 2); - miVehicleSpriteField->Add("Tank 1", 3); - miVehicleSpriteField->Add("Boat 1", 4); - miVehicleSpriteField->Add("Boat 2", 5); - miVehicleSpriteField->Add("Airship 1", 6); - miVehicleSpriteField->Add("Airship 2", 7); - miVehicleSpriteField->Add("Tank 2", 8); - miVehicleSpriteField->SetData(&g_wvVehicleStamp.iDrawSprite, NULL, NULL); - miVehicleSpriteField->SetKey(g_wvVehicleStamp.iDrawSprite); + miVehicleSpriteField->add("Hammer Brother", 0); + miVehicleSpriteField->add("Boomerang Brother", 1); + miVehicleSpriteField->add("Fire Brother", 2); + miVehicleSpriteField->add("Tank 1", 3); + miVehicleSpriteField->add("Boat 1", 4); + miVehicleSpriteField->add("Boat 2", 5); + miVehicleSpriteField->add("Airship 1", 6); + miVehicleSpriteField->add("Airship 2", 7); + miVehicleSpriteField->add("Tank 2", 8); + miVehicleSpriteField->setOutputPtr(&g_wvVehicleStamp.iDrawSprite); + miVehicleSpriteField->setCurrentValue(g_wvVehicleStamp.iDrawSprite); miVehicleStageField = new MI_ImageSelectField(&rm->spr_selectfield, &rm->menu_mode_small, 70, 120, "Stage", 500, 150, 16, 16); - miVehicleStageField->SetData(&g_wvVehicleStamp.iActionId, NULL, NULL); + miVehicleStageField->setOutputPtr(&g_wvVehicleStamp.iActionId); miVehicleMinMovesField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Min Moves", 500, 150); @@ -1195,8 +1195,8 @@ int editor_edit() g_wvVehicleStamp.iDrawDirection = vehicle->iDrawDirection; g_wvVehicleStamp.iBoundary = vehicle->iBoundary; - miVehicleSpriteField->SetKey(g_wvVehicleStamp.iDrawSprite); - miVehicleStageField->SetKey(g_wvVehicleStamp.iActionId); + miVehicleSpriteField->setCurrentValue(g_wvVehicleStamp.iDrawSprite); + miVehicleStageField->setCurrentValue(g_wvVehicleStamp.iActionId); miVehicleMinMovesField->SetKey(g_wvVehicleStamp.iMinMoves); miVehicleMaxMovesField->SetKey(g_wvVehicleStamp.iMaxMoves); miVehiclePacesField->SetKey(g_wvVehicleStamp.fSpritePaces ? 1 : 0); @@ -3297,16 +3297,18 @@ int editor_vehicles() bool done = false; - miVehicleStageField->Clear(); + miVehicleStageField->clear(); for (short iStage = 0; iStage < g_worldmap.iNumStages; iStage++) { TourStop * ts = game_values.tourstops[iStage]; char szStageName[256]; sprintf(szStageName, "(%d) %s", iStage + 1, ts->szName); - miVehicleStageField->Add(szStageName, iStage, false, true, ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode)); + + SF_ListItemDyn& item = miVehicleStageField->add(szStageName, iStage, false, true); + item.iconOverride = ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode); } - miVehicleStageField->SetKey(g_wvVehicleStamp.iActionId); + miVehicleStageField->setCurrentValue(g_wvVehicleStamp.iActionId); while (!done) { int framestart = SDL_GetTicks(); @@ -3705,7 +3707,7 @@ void EditStage(short iEditStage) //Set fields to write data to the selected stage TourStop * ts = game_values.tourstops[iEditStage]; - miModeField->SetData(&ts->iMode, NULL, NULL); + miModeField->setOutputPtr(&ts->iMode); miNameField->SetData(ts->szName, 128); miPointsField->SetData(&ts->iPoints, NULL, NULL); @@ -3750,7 +3752,7 @@ void EditStage(short iEditStage) miBonusItemsButton->SetPosition(430, iStageType == 0 ? 220 : 340); if (iStageType == 0 && iMode >= 0 && iMode < GAMEMODE_LAST) { - miModeField->SetKey(iMode); + miModeField->setCurrentValue(iMode); miModeSettingsButton->Show(iMode != game_mode_owned); @@ -3774,9 +3776,9 @@ void EditStage(short iEditStage) } if (iStageType == 1) { //Bonus House - miModeField->SetKey(24); + miModeField->setCurrentValue(24); } else if (iMode >= 1000 && iMode <= 1002) { //Pipe, Boss and Boxes Game - miModeField->SetKey(iMode - 975); + miModeField->setCurrentValue(iMode - 975); miSpecialGoalField[iMode-1000]->SetData(&game_values.tourstops[iEditStage]->iGoal, NULL, NULL); miSpecialGoalField[iMode-1000]->SetKey(game_values.tourstops[iEditStage]->iGoal); miPointsField->SetKey(game_values.tourstops[iEditStage]->iPoints); @@ -4064,7 +4066,7 @@ int editor_stage() //We are no longer working on a specific stage iEditStage = -1; } else if (MENU_CODE_MODE_CHANGED == code) { - short iMode = miModeField->GetShortValue(); + short iMode = miModeField->currentValue(); miPointsField->Show(iMode != 24); miFinalStageField->Show(iMode != 24); From 86627c35ea0c6b4ce7728bd9c09d242d05439039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 11:35:22 +0200 Subject: [PATCH 06/14] Removed some unused select field arguments --- src/common/ui/MI_SelectField.cpp | 4 +- src/common/ui/MI_SelectField.h | 6 +- src/smw/menu/ModeOptionsMenu.cpp | 178 +++++++++++++++---------------- src/worldeditor/worldeditor.cpp | 2 +- 4 files changed, 94 insertions(+), 96 deletions(-) diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index 19073d01..b6bbd888 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -717,10 +717,10 @@ void MI_SelectFieldDyn::updateOutput() const template -SF_ListItemDyn& MI_SelectFieldDyn::add(std::string name, T value, bool hidden, bool goodRandom) +SF_ListItemDyn& MI_SelectFieldDyn::add(std::string name, T value, bool goodRandom) { size_t new_idx = m_items.size(); - m_items.emplace_back(std::move(name), std::move(value), hidden, -1); + m_items.emplace_back(std::move(name), std::move(value)); m_index = 0; if (goodRandom) diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 5c1cb2c7..af60cd30 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -167,11 +167,9 @@ class MI_SelectField : public UI_Control template struct SF_ListItemDyn { - SF_ListItemDyn(std::string&& name, T value, bool hidden, short iconOverride) + SF_ListItemDyn(std::string&& name, T value) : name(std::move(name)) , value(value) - , hidden(hidden) - , iconOverride(iconOverride) { static_assert(std::is_trivially_copyable::value, ""); } @@ -237,7 +235,7 @@ class MI_SelectFieldDyn : public UI_Control { //! Sets the currently selected item bool setCurrentIndex(size_t index); //! Adds an item to the list - Item& add(std::string name, T value, bool hidden = false, bool goodRandom = true); + Item& add(std::string name, T value, bool goodRandom = true); //! Removes all items void clear(); //! Hides the items containing the specified value diff --git a/src/smw/menu/ModeOptionsMenu.cpp b/src/smw/menu/ModeOptionsMenu.cpp index 6df3041a..56f511e3 100644 --- a/src/smw/menu/ModeOptionsMenu.cpp +++ b/src/smw/menu/ModeOptionsMenu.cpp @@ -104,8 +104,8 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miTimeLimitModeScoringField->SetKey(game_values.gamemodemenusettings.time.scoring); miTimeLimitModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); - miTimeLimitModePercentExtraTime->add("0", 0, false, false); - miTimeLimitModePercentExtraTime->add("5", 5, false, false); + miTimeLimitModePercentExtraTime->add("0", 0, false); + miTimeLimitModePercentExtraTime->add("5", 5, false); miTimeLimitModePercentExtraTime->add("10", 10); miTimeLimitModePercentExtraTime->add("15", 15); miTimeLimitModePercentExtraTime->add("20", 20); @@ -115,16 +115,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miTimeLimitModePercentExtraTime->add("40", 40); miTimeLimitModePercentExtraTime->add("45", 45); miTimeLimitModePercentExtraTime->add("50", 50); - miTimeLimitModePercentExtraTime->add("55", 55, false, false); - miTimeLimitModePercentExtraTime->add("60", 60, false, false); - miTimeLimitModePercentExtraTime->add("65", 65, false, false); - miTimeLimitModePercentExtraTime->add("70", 70, false, false); - miTimeLimitModePercentExtraTime->add("75", 75, false, false); - miTimeLimitModePercentExtraTime->add("80", 80, false, false); - miTimeLimitModePercentExtraTime->add("85", 85, false, false); - miTimeLimitModePercentExtraTime->add("90", 90, false, false); - miTimeLimitModePercentExtraTime->add("95", 95, false, false); - miTimeLimitModePercentExtraTime->add("100", 100, false, false); + miTimeLimitModePercentExtraTime->add("55", 55, false); + miTimeLimitModePercentExtraTime->add("60", 60, false); + miTimeLimitModePercentExtraTime->add("65", 65, false); + miTimeLimitModePercentExtraTime->add("70", 70, false); + miTimeLimitModePercentExtraTime->add("75", 75, false); + miTimeLimitModePercentExtraTime->add("80", 80, false); + miTimeLimitModePercentExtraTime->add("85", 85, false); + miTimeLimitModePercentExtraTime->add("90", 90, false); + miTimeLimitModePercentExtraTime->add("95", 95, false); + miTimeLimitModePercentExtraTime->add("100", 100, false); miTimeLimitModePercentExtraTime->setOutputPtr(&game_values.gamemodemenusettings.time.percentextratime); miTimeLimitModePercentExtraTime->setCurrentValue(game_values.gamemodemenusettings.time.percentextratime); miTimeLimitModePercentExtraTime->allowWrap(false); @@ -185,8 +185,8 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miJailModeTagFreeField->setAutoAdvance(true); miJailModeJailKeyField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Jail Key", 400, 150, 384); - miJailModeJailKeyField->add("0", 0, false, false); - miJailModeJailKeyField->add("5", 5, false, false); + miJailModeJailKeyField->add("0", 0, false); + miJailModeJailKeyField->add("5", 5, false); miJailModeJailKeyField->add("10", 10); miJailModeJailKeyField->add("15", 15); miJailModeJailKeyField->add("20", 20); @@ -196,16 +196,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miJailModeJailKeyField->add("40", 40); miJailModeJailKeyField->add("45", 45); miJailModeJailKeyField->add("50", 50); - miJailModeJailKeyField->add("55", 55, false, false); - miJailModeJailKeyField->add("60", 60, false, false); - miJailModeJailKeyField->add("65", 65, false, false); - miJailModeJailKeyField->add("70", 70, false, false); - miJailModeJailKeyField->add("75", 75, false, false); - miJailModeJailKeyField->add("80", 80, false, false); - miJailModeJailKeyField->add("85", 85, false, false); - miJailModeJailKeyField->add("90", 90, false, false); - miJailModeJailKeyField->add("95", 95, false, false); - miJailModeJailKeyField->add("100", 100, false, false); + miJailModeJailKeyField->add("55", 55, false); + miJailModeJailKeyField->add("60", 60, false); + miJailModeJailKeyField->add("65", 65, false); + miJailModeJailKeyField->add("70", 70, false); + miJailModeJailKeyField->add("75", 75, false); + miJailModeJailKeyField->add("80", 80, false); + miJailModeJailKeyField->add("85", 85, false); + miJailModeJailKeyField->add("90", 90, false); + miJailModeJailKeyField->add("95", 95, false); + miJailModeJailKeyField->add("100", 100, false); miJailModeJailKeyField->setOutputPtr(&game_values.gamemodemenusettings.jail.percentkey); miJailModeJailKeyField->setCurrentValue(game_values.gamemodemenusettings.jail.percentkey); miJailModeJailKeyField->allowWrap(false); @@ -257,8 +257,8 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCoinModeQuantityField->SetKey(game_values.gamemodemenusettings.coins.quantity); miCoinModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Coins", 400, 150, 384); - miCoinModePercentExtraCoin->add("0", 0, false, false); - miCoinModePercentExtraCoin->add("5", 5, false, false); + miCoinModePercentExtraCoin->add("0", 0, false); + miCoinModePercentExtraCoin->add("5", 5, false); miCoinModePercentExtraCoin->add("10", 10); miCoinModePercentExtraCoin->add("15", 15); miCoinModePercentExtraCoin->add("20", 20); @@ -268,16 +268,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCoinModePercentExtraCoin->add("40", 40); miCoinModePercentExtraCoin->add("45", 45); miCoinModePercentExtraCoin->add("50", 50); - miCoinModePercentExtraCoin->add("55", 55, false, false); - miCoinModePercentExtraCoin->add("60", 60, false, false); - miCoinModePercentExtraCoin->add("65", 65, false, false); - miCoinModePercentExtraCoin->add("70", 70, false, false); - miCoinModePercentExtraCoin->add("75", 75, false, false); - miCoinModePercentExtraCoin->add("80", 80, false, false); - miCoinModePercentExtraCoin->add("85", 85, false, false); - miCoinModePercentExtraCoin->add("90", 90, false, false); - miCoinModePercentExtraCoin->add("95", 95, false, false); - miCoinModePercentExtraCoin->add("100", 100, false, false); + miCoinModePercentExtraCoin->add("55", 55, false); + miCoinModePercentExtraCoin->add("60", 60, false); + miCoinModePercentExtraCoin->add("65", 65, false); + miCoinModePercentExtraCoin->add("70", 70, false); + miCoinModePercentExtraCoin->add("75", 75, false); + miCoinModePercentExtraCoin->add("80", 80, false); + miCoinModePercentExtraCoin->add("85", 85, false); + miCoinModePercentExtraCoin->add("90", 90, false); + miCoinModePercentExtraCoin->add("95", 95, false); + miCoinModePercentExtraCoin->add("100", 100, false); miCoinModePercentExtraCoin->setOutputPtr(&game_values.gamemodemenusettings.coins.percentextracoin); miCoinModePercentExtraCoin->setCurrentValue(game_values.gamemodemenusettings.coins.percentextracoin); miCoinModePercentExtraCoin->allowWrap(false); @@ -371,11 +371,11 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iEggField = 0; iEggField < 4; iEggField++) { miEggModeEggQuantityField[iEggField] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_egg, 170, 60 + 40 * iEggField, 300, iEggField); - miEggModeEggQuantityField[iEggField]->add("0", 0, false, iEggField == 0 ? false : true); - miEggModeEggQuantityField[iEggField]->add("1", 1, false, iEggField >= 2 ? false : true); - miEggModeEggQuantityField[iEggField]->add("2", 2, false, iEggField >= 2 ? false : true); - miEggModeEggQuantityField[iEggField]->add("3", 3, false, iEggField >= 1 ? false : true); - miEggModeEggQuantityField[iEggField]->add("4", 4, false, false); + miEggModeEggQuantityField[iEggField]->add("0", 0, iEggField == 0 ? false : true); + miEggModeEggQuantityField[iEggField]->add("1", 1, iEggField >= 2 ? false : true); + miEggModeEggQuantityField[iEggField]->add("2", 2, iEggField >= 2 ? false : true); + miEggModeEggQuantityField[iEggField]->add("3", 3, iEggField >= 1 ? false : true); + miEggModeEggQuantityField[iEggField]->add("4", 4); miEggModeEggQuantityField[iEggField]->setOutputPtr(&game_values.gamemodemenusettings.egg.eggs[iEggField]); miEggModeEggQuantityField[iEggField]->setCurrentValue(game_values.gamemodemenusettings.egg.eggs[iEggField]); miEggModeEggQuantityField[iEggField]->allowWrap(false); @@ -383,11 +383,11 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iYoshiField = 0; iYoshiField < 4; iYoshiField++) { miEggModeYoshiQuantityField[iYoshiField] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_egg, 170, 220 + 40 * iYoshiField, 300, iYoshiField + 4); - miEggModeYoshiQuantityField[iYoshiField]->add("0", 0, false, iYoshiField == 0 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->add("1", 1, false, iYoshiField >= 2 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->add("2", 2, false, iYoshiField >= 1 ? false : true); - miEggModeYoshiQuantityField[iYoshiField]->add("3", 3, false, false); - miEggModeYoshiQuantityField[iYoshiField]->add("4", 4, false, false); + miEggModeYoshiQuantityField[iYoshiField]->add("0", 0, iYoshiField == 0 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->add("1", 1, iYoshiField >= 2 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->add("2", 2, iYoshiField >= 1 ? false : true); + miEggModeYoshiQuantityField[iYoshiField]->add("3", 3); + miEggModeYoshiQuantityField[iYoshiField]->add("4", 4); miEggModeYoshiQuantityField[iYoshiField]->setOutputPtr(&game_values.gamemodemenusettings.egg.yoshis[iYoshiField]); miEggModeYoshiQuantityField[iYoshiField]->setCurrentValue(game_values.gamemodemenusettings.egg.yoshis[iYoshiField]); miEggModeYoshiQuantityField[iYoshiField]->allowWrap(false); @@ -444,9 +444,9 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModeSpeedField->add("3", 3); miFlagModeSpeedField->add("4", 4); miFlagModeSpeedField->add("5", 5); - miFlagModeSpeedField->add("6", 6, false, false); - miFlagModeSpeedField->add("7", 7, false, false); - miFlagModeSpeedField->add("8", 8, false, false); + miFlagModeSpeedField->add("6", 6, false); + miFlagModeSpeedField->add("7", 7, false); + miFlagModeSpeedField->add("8", 8, false); miFlagModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.flag.speed); miFlagModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.flag.speed); miFlagModeSpeedField->allowWrap(false); @@ -617,8 +617,8 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miStarModeShineField->SetKey(game_values.gamemodemenusettings.star.shine); miStarModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); - miStarModePercentExtraTime->add("0", 0, false, false); - miStarModePercentExtraTime->add("5", 5, false, false); + miStarModePercentExtraTime->add("0", 0, false); + miStarModePercentExtraTime->add("5", 5, false); miStarModePercentExtraTime->add("10", 10); miStarModePercentExtraTime->add("15", 15); miStarModePercentExtraTime->add("20", 20); @@ -628,16 +628,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miStarModePercentExtraTime->add("40", 40); miStarModePercentExtraTime->add("45", 45); miStarModePercentExtraTime->add("50", 50); - miStarModePercentExtraTime->add("55", 55, false, false); - miStarModePercentExtraTime->add("60", 60, false, false); - miStarModePercentExtraTime->add("65", 65, false, false); - miStarModePercentExtraTime->add("70", 70, false, false); - miStarModePercentExtraTime->add("75", 75, false, false); - miStarModePercentExtraTime->add("80", 80, false, false); - miStarModePercentExtraTime->add("85", 85, false, false); - miStarModePercentExtraTime->add("90", 90, false, false); - miStarModePercentExtraTime->add("95", 95, false, false); - miStarModePercentExtraTime->add("100", 100, false, false); + miStarModePercentExtraTime->add("55", 55, false); + miStarModePercentExtraTime->add("60", 60, false); + miStarModePercentExtraTime->add("65", 65, false); + miStarModePercentExtraTime->add("70", 70, false); + miStarModePercentExtraTime->add("75", 75, false); + miStarModePercentExtraTime->add("80", 80, false); + miStarModePercentExtraTime->add("85", 85, false); + miStarModePercentExtraTime->add("90", 90, false); + miStarModePercentExtraTime->add("95", 95, false); + miStarModePercentExtraTime->add("100", 100, false); miStarModePercentExtraTime->setOutputPtr(&game_values.gamemodemenusettings.star.percentextratime); miStarModePercentExtraTime->setCurrentValue(game_values.gamemodemenusettings.star.percentextratime); miStarModePercentExtraTime->allowWrap(false); @@ -1009,8 +1009,8 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModeMultiplier->SetKey(game_values.gamemodemenusettings.greed.multiplier); miGreedModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Extra Coins", 400, 150, 384); - miGreedModePercentExtraCoin->add("0", 0, false, false); - miGreedModePercentExtraCoin->add("5", 5, false, false); + miGreedModePercentExtraCoin->add("0", 0, false); + miGreedModePercentExtraCoin->add("5", 5, false); miGreedModePercentExtraCoin->add("10", 10); miGreedModePercentExtraCoin->add("15", 15); miGreedModePercentExtraCoin->add("20", 20); @@ -1020,16 +1020,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModePercentExtraCoin->add("40", 40); miGreedModePercentExtraCoin->add("45", 45); miGreedModePercentExtraCoin->add("50", 50); - miGreedModePercentExtraCoin->add("55", 55, false, false); - miGreedModePercentExtraCoin->add("60", 60, false, false); - miGreedModePercentExtraCoin->add("65", 65, false, false); - miGreedModePercentExtraCoin->add("70", 70, false, false); - miGreedModePercentExtraCoin->add("75", 75, false, false); - miGreedModePercentExtraCoin->add("80", 80, false, false); - miGreedModePercentExtraCoin->add("85", 85, false, false); - miGreedModePercentExtraCoin->add("90", 90, false, false); - miGreedModePercentExtraCoin->add("95", 95, false, false); - miGreedModePercentExtraCoin->add("100", 100, false, false); + miGreedModePercentExtraCoin->add("55", 55, false); + miGreedModePercentExtraCoin->add("60", 60, false); + miGreedModePercentExtraCoin->add("65", 65, false); + miGreedModePercentExtraCoin->add("70", 70, false); + miGreedModePercentExtraCoin->add("75", 75, false); + miGreedModePercentExtraCoin->add("80", 80, false); + miGreedModePercentExtraCoin->add("85", 85, false); + miGreedModePercentExtraCoin->add("90", 90, false); + miGreedModePercentExtraCoin->add("95", 95, false); + miGreedModePercentExtraCoin->add("100", 100, false); miGreedModePercentExtraCoin->setOutputPtr(&game_values.gamemodemenusettings.greed.percentextracoin); miGreedModePercentExtraCoin->setCurrentValue(game_values.gamemodemenusettings.greed.percentextracoin); miGreedModePercentExtraCoin->allowWrap(false); @@ -1090,8 +1090,8 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miHealthModeMaxLife->SetItemChangedCode(MENU_CODE_HEALTH_MODE_MAX_LIFE_CHANGED); miHealthModePercentExtraLife = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Life", 400, 150, 384); - miHealthModePercentExtraLife->add("0", 0, false, false); - miHealthModePercentExtraLife->add("5", 5, false, false); + miHealthModePercentExtraLife->add("0", 0, false); + miHealthModePercentExtraLife->add("5", 5, false); miHealthModePercentExtraLife->add("10", 10); miHealthModePercentExtraLife->add("15", 15); miHealthModePercentExtraLife->add("20", 20); @@ -1101,16 +1101,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miHealthModePercentExtraLife->add("40", 40); miHealthModePercentExtraLife->add("45", 45); miHealthModePercentExtraLife->add("50", 50); - miHealthModePercentExtraLife->add("55", 55, false, false); - miHealthModePercentExtraLife->add("60", 60, false, false); - miHealthModePercentExtraLife->add("65", 65, false, false); - miHealthModePercentExtraLife->add("70", 70, false, false); - miHealthModePercentExtraLife->add("75", 75, false, false); - miHealthModePercentExtraLife->add("80", 80, false, false); - miHealthModePercentExtraLife->add("85", 85, false, false); - miHealthModePercentExtraLife->add("90", 90, false, false); - miHealthModePercentExtraLife->add("95", 95, false, false); - miHealthModePercentExtraLife->add("100", 100, false, false); + miHealthModePercentExtraLife->add("55", 55, false); + miHealthModePercentExtraLife->add("60", 60, false); + miHealthModePercentExtraLife->add("65", 65, false); + miHealthModePercentExtraLife->add("70", 70, false); + miHealthModePercentExtraLife->add("75", 75, false); + miHealthModePercentExtraLife->add("80", 80, false); + miHealthModePercentExtraLife->add("85", 85, false); + miHealthModePercentExtraLife->add("90", 90, false); + miHealthModePercentExtraLife->add("95", 95, false); + miHealthModePercentExtraLife->add("100", 100, false); miHealthModePercentExtraLife->setOutputPtr(&game_values.gamemodemenusettings.health.percentextralife); miHealthModePercentExtraLife->setCurrentValue(game_values.gamemodemenusettings.health.percentextralife); miHealthModePercentExtraLife->allowWrap(false); @@ -1239,12 +1239,12 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() for (short iPhanto = 0; iPhanto < 3; iPhanto++) { miChaseModeQuantitySlider[iPhanto] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_phanto, 120, 200 + 40 * iPhanto, 400, iPhanto); - miChaseModeQuantitySlider[iPhanto]->add("", 0, false, iPhanto == 0 ? false : true); + miChaseModeQuantitySlider[iPhanto]->add("", 0, iPhanto == 0 ? false : true); miChaseModeQuantitySlider[iPhanto]->add("", 1); miChaseModeQuantitySlider[iPhanto]->add("", 2); - miChaseModeQuantitySlider[iPhanto]->add("", 3, false, false); - miChaseModeQuantitySlider[iPhanto]->add("", 4, false, false); - miChaseModeQuantitySlider[iPhanto]->add("", 5, false, false); + miChaseModeQuantitySlider[iPhanto]->add("", 3, false); + miChaseModeQuantitySlider[iPhanto]->add("", 4, false); + miChaseModeQuantitySlider[iPhanto]->add("", 5, false); miChaseModeQuantitySlider[iPhanto]->allowWrap(false); miChaseModeQuantitySlider[iPhanto]->setOutputPtr(&game_values.gamemodemenusettings.chase.phantoquantity[iPhanto]); miChaseModeQuantitySlider[iPhanto]->setCurrentValue(game_values.gamemodemenusettings.chase.phantoquantity[iPhanto]); diff --git a/src/worldeditor/worldeditor.cpp b/src/worldeditor/worldeditor.cpp index d8c7207c..62a645f5 100644 --- a/src/worldeditor/worldeditor.cpp +++ b/src/worldeditor/worldeditor.cpp @@ -3304,7 +3304,7 @@ int editor_vehicles() char szStageName[256]; sprintf(szStageName, "(%d) %s", iStage + 1, ts->szName); - SF_ListItemDyn& item = miVehicleStageField->add(szStageName, iStage, false, true); + SF_ListItemDyn& item = miVehicleStageField->add(szStageName, iStage); item.iconOverride = ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode); } From 729f6022af97cad4ef524a462bba77ec0081581f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 12:06:41 +0200 Subject: [PATCH 07/14] Converted all game mode settings to use the new select field --- src/smw/menu/ModeOptionsMenu.cpp | 972 +++++++++++++++---------------- src/smw/menu/ModeOptionsMenu.h | 77 ++- 2 files changed, 524 insertions(+), 525 deletions(-) diff --git a/src/smw/menu/ModeOptionsMenu.cpp b/src/smw/menu/ModeOptionsMenu.cpp index 56f511e3..a9186c04 100644 --- a/src/smw/menu/ModeOptionsMenu.cpp +++ b/src/smw/menu/ModeOptionsMenu.cpp @@ -21,17 +21,17 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Classic Mode Settings //*********************** - miClassicModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); - miClassicModeStyleField->Add("Respawn", 0); - miClassicModeStyleField->Add("Shield", 1); - miClassicModeStyleField->SetData(&game_values.gamemodemenusettings.classic.style, NULL, NULL); - miClassicModeStyleField->SetKey(game_values.gamemodemenusettings.classic.style); - - miClassicModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); - miClassicModeScoringField->Add("All Kills", 0); - miClassicModeScoringField->Add("Push Kills Only", 1, false, false); - miClassicModeScoringField->SetData(&game_values.gamemodemenusettings.classic.scoring, NULL, NULL); - miClassicModeScoringField->SetKey(game_values.gamemodemenusettings.classic.scoring); + miClassicModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); + miClassicModeStyleField->add("Respawn", 0); + miClassicModeStyleField->add("Shield", 1); + miClassicModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.classic.style); + miClassicModeStyleField->setCurrentValue(game_values.gamemodemenusettings.classic.style); + + miClassicModeScoringField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); + miClassicModeScoringField->add("All Kills", 0); + miClassicModeScoringField->add("Push Kills Only", 1, false); + miClassicModeScoringField->setOutputPtr(&game_values.gamemodemenusettings.classic.scoring); + miClassicModeScoringField->setCurrentValue(game_values.gamemodemenusettings.classic.scoring); miClassicModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miClassicModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -56,17 +56,17 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Frag Mode Settings //*********************** - miFragModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); - miFragModeStyleField->Add("Respawn", 0); - miFragModeStyleField->Add("Shield", 1); - miFragModeStyleField->SetData(&game_values.gamemodemenusettings.frag.style, NULL, NULL); - miFragModeStyleField->SetKey(game_values.gamemodemenusettings.frag.style); + miFragModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); + miFragModeStyleField->add("Respawn", 0); + miFragModeStyleField->add("Shield", 1); + miFragModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.frag.style); + miFragModeStyleField->setCurrentValue(game_values.gamemodemenusettings.frag.style); - miFragModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); - miFragModeScoringField->Add("All Kills", 0); - miFragModeScoringField->Add("Push Kills Only", 1, false, false); - miFragModeScoringField->SetData(&game_values.gamemodemenusettings.frag.scoring, NULL, NULL); - miFragModeScoringField->SetKey(game_values.gamemodemenusettings.frag.scoring); + miFragModeScoringField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); + miFragModeScoringField->add("All Kills", 0); + miFragModeScoringField->add("Push Kills Only", 1, false); + miFragModeScoringField->setOutputPtr(&game_values.gamemodemenusettings.frag.scoring); + miFragModeScoringField->setCurrentValue(game_values.gamemodemenusettings.frag.scoring); miFragModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miFragModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -91,17 +91,17 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Time Limit Mode Settings //*********************** - miTimeLimitModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "On Kill", 400, 150); - miTimeLimitModeStyleField->Add("Respawn", 0); - miTimeLimitModeStyleField->Add("Shield", 1); - miTimeLimitModeStyleField->SetData(&game_values.gamemodemenusettings.time.style, NULL, NULL); - miTimeLimitModeStyleField->SetKey(game_values.gamemodemenusettings.time.style); + miTimeLimitModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "On Kill", 400, 150); + miTimeLimitModeStyleField->add("Respawn", 0); + miTimeLimitModeStyleField->add("Shield", 1); + miTimeLimitModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.time.style); + miTimeLimitModeStyleField->setCurrentValue(game_values.gamemodemenusettings.time.style); - miTimeLimitModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Scoring", 400, 150); - miTimeLimitModeScoringField->Add("All Kills", 0); - miTimeLimitModeScoringField->Add("Push Kills Only", 1, false, false); - miTimeLimitModeScoringField->SetData(&game_values.gamemodemenusettings.time.scoring, NULL, NULL); - miTimeLimitModeScoringField->SetKey(game_values.gamemodemenusettings.time.scoring); + miTimeLimitModeScoringField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Scoring", 400, 150); + miTimeLimitModeScoringField->add("All Kills", 0); + miTimeLimitModeScoringField->add("Push Kills Only", 1, false); + miTimeLimitModeScoringField->setOutputPtr(&game_values.gamemodemenusettings.time.scoring); + miTimeLimitModeScoringField->setCurrentValue(game_values.gamemodemenusettings.time.scoring); miTimeLimitModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); miTimeLimitModePercentExtraTime->add("0", 0, false); @@ -153,29 +153,29 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Jail Mode Settings //*********************** - miJailModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Style", 400, 150); - miJailModeStyleField->Add("Classic", 0); - miJailModeStyleField->Add("Owned", 1, "", true, false); - miJailModeStyleField->Add("Free For All", 2, "", true, false); - miJailModeStyleField->SetData(&game_values.gamemodemenusettings.jail.style, NULL, NULL); - miJailModeStyleField->SetKey(game_values.gamemodemenusettings.jail.style); - - miJailModeTimeFreeField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Free Timer", 400, 150); - miJailModeTimeFreeField->Add("None", 1); - miJailModeTimeFreeField->Add("5 Seconds", 310, false, false); - miJailModeTimeFreeField->Add("10 Seconds", 620); - miJailModeTimeFreeField->Add("15 Seconds", 930); - miJailModeTimeFreeField->Add("20 Seconds", 1240); - miJailModeTimeFreeField->Add("25 Seconds", 1550); - miJailModeTimeFreeField->Add("30 Seconds", 1860); - miJailModeTimeFreeField->Add("35 Seconds", 2170); - miJailModeTimeFreeField->Add("40 Seconds", 2480); - miJailModeTimeFreeField->Add("45 Seconds", 2790, false, false); - miJailModeTimeFreeField->Add("50 Seconds", 3100, false, false); - miJailModeTimeFreeField->Add("55 Seconds", 3410, false, false); - miJailModeTimeFreeField->Add("60 Seconds", 3720, false, false); - miJailModeTimeFreeField->SetData(&game_values.gamemodemenusettings.jail.timetofree, NULL, NULL); - miJailModeTimeFreeField->SetKey(game_values.gamemodemenusettings.jail.timetofree); + miJailModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Style", 400, 150); + miJailModeStyleField->add("Classic", 0); + miJailModeStyleField->add("Owned", 1, false); + miJailModeStyleField->add("Free For All", 2, false); + miJailModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.jail.style); + miJailModeStyleField->setCurrentValue(game_values.gamemodemenusettings.jail.style); + + miJailModeTimeFreeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Free Timer", 400, 150); + miJailModeTimeFreeField->add("None", 1); + miJailModeTimeFreeField->add("5 Seconds", 310, false); + miJailModeTimeFreeField->add("10 Seconds", 620); + miJailModeTimeFreeField->add("15 Seconds", 930); + miJailModeTimeFreeField->add("20 Seconds", 1240); + miJailModeTimeFreeField->add("25 Seconds", 1550); + miJailModeTimeFreeField->add("30 Seconds", 1860); + miJailModeTimeFreeField->add("35 Seconds", 2170); + miJailModeTimeFreeField->add("40 Seconds", 2480); + miJailModeTimeFreeField->add("45 Seconds", 2790, false); + miJailModeTimeFreeField->add("50 Seconds", 3100, false); + miJailModeTimeFreeField->add("55 Seconds", 3410, false); + miJailModeTimeFreeField->add("60 Seconds", 3720, false); + miJailModeTimeFreeField->setOutputPtr(&game_values.gamemodemenusettings.jail.timetofree); + miJailModeTimeFreeField->setCurrentValue(game_values.gamemodemenusettings.jail.timetofree); miJailModeTagFreeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Tag Free", 400, 150); miJailModeTagFreeField->add("Off", false); @@ -242,19 +242,19 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCoinModePenaltyField->setCurrentValue(game_values.gamemodemenusettings.coins.penalty ? 1 : 0); miCoinModePenaltyField->setAutoAdvance(true); - miCoinModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Quantity", 400, 150); - miCoinModeQuantityField->Add("1", 1); - miCoinModeQuantityField->Add("2", 2); - miCoinModeQuantityField->Add("3", 3); - miCoinModeQuantityField->Add("4", 4); - miCoinModeQuantityField->Add("5", 5); - miCoinModeQuantityField->Add("6", 6); - miCoinModeQuantityField->Add("7", 7); - miCoinModeQuantityField->Add("8", 8); - miCoinModeQuantityField->Add("9", 9); - miCoinModeQuantityField->Add("10", 10); - miCoinModeQuantityField->SetData(&game_values.gamemodemenusettings.coins.quantity, NULL, NULL); - miCoinModeQuantityField->SetKey(game_values.gamemodemenusettings.coins.quantity); + miCoinModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Quantity", 400, 150); + miCoinModeQuantityField->add("1", 1); + miCoinModeQuantityField->add("2", 2); + miCoinModeQuantityField->add("3", 3); + miCoinModeQuantityField->add("4", 4); + miCoinModeQuantityField->add("5", 5); + miCoinModeQuantityField->add("6", 6); + miCoinModeQuantityField->add("7", 7); + miCoinModeQuantityField->add("8", 8); + miCoinModeQuantityField->add("9", 9); + miCoinModeQuantityField->add("10", 10); + miCoinModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.coins.quantity); + miCoinModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.coins.quantity); miCoinModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Coins", 400, 150, 384); miCoinModePercentExtraCoin->add("0", 0, false); @@ -306,16 +306,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Stomp Mode Settings //*********************** - miStompModeRateField = new MI_SelectField(&rm->spr_selectfield, 120, 40, "Rate", 400, 180); - miStompModeRateField->Add("Very Slow", 150, false, false); - miStompModeRateField->Add("Slow", 120); - miStompModeRateField->Add("Moderate", 90); - miStompModeRateField->Add("Fast", 60); - miStompModeRateField->Add("Very Fast", 30, false, false); - miStompModeRateField->Add("Extremely Fast", 15, false, false); - miStompModeRateField->Add("Insanely Fast", 5, false, false); - miStompModeRateField->SetData(&game_values.gamemodemenusettings.stomp.rate, NULL, NULL); - miStompModeRateField->SetKey(game_values.gamemodemenusettings.stomp.rate); + miStompModeRateField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 40, "Rate", 400, 180); + miStompModeRateField->add("Very Slow", 150, false); + miStompModeRateField->add("Slow", 120); + miStompModeRateField->add("Moderate", 90); + miStompModeRateField->add("Fast", 60); + miStompModeRateField->add("Very Fast", 30, false); + miStompModeRateField->add("Extremely Fast", 15, false); + miStompModeRateField->add("Insanely Fast", 5, false); + miStompModeRateField->setOutputPtr(&game_values.gamemodemenusettings.stomp.rate); + miStompModeRateField->setCurrentValue(game_values.gamemodemenusettings.stomp.rate); for (short iEnemy = 0; iEnemy < NUMSTOMPENEMIES; iEnemy++) { miStompModeEnemySlider[iEnemy] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->menu_stomp, 120, 80 + 40 * iEnemy, 400, iEnemy); @@ -393,16 +393,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miEggModeYoshiQuantityField[iYoshiField]->allowWrap(false); } - miEggModeExplosionTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 380, "Explosion Timer", 400, 180); - miEggModeExplosionTimeField->Add("Off", 0); - miEggModeExplosionTimeField->Add("3 Seconds", 3, false, false); - miEggModeExplosionTimeField->Add("5 Seconds", 5); - miEggModeExplosionTimeField->Add("8 Seconds", 8); - miEggModeExplosionTimeField->Add("10 Seconds", 10); - miEggModeExplosionTimeField->Add("15 Seconds", 15); - miEggModeExplosionTimeField->Add("20 Seconds", 20); - miEggModeExplosionTimeField->SetData(&game_values.gamemodemenusettings.egg.explode, NULL, NULL); - miEggModeExplosionTimeField->SetKey(game_values.gamemodemenusettings.egg.explode); + miEggModeExplosionTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 380, "Explosion Timer", 400, 180); + miEggModeExplosionTimeField->add("Off", 0); + miEggModeExplosionTimeField->add("3 Seconds", 3, false); + miEggModeExplosionTimeField->add("5 Seconds", 5); + miEggModeExplosionTimeField->add("8 Seconds", 8); + miEggModeExplosionTimeField->add("10 Seconds", 10); + miEggModeExplosionTimeField->add("15 Seconds", 15); + miEggModeExplosionTimeField->add("20 Seconds", 20); + miEggModeExplosionTimeField->setOutputPtr(&game_values.gamemodemenusettings.egg.explode); + miEggModeExplosionTimeField->setCurrentValue(game_values.gamemodemenusettings.egg.explode); miEggModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miEggModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -465,22 +465,22 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModePointMoveField->setCurrentValue(game_values.gamemodemenusettings.flag.pointmove ? 1 : 0); miFlagModePointMoveField->setAutoAdvance(true); - miFlagModeAutoReturnField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Auto Return", 400, 180); - miFlagModeAutoReturnField->Add("None", 0); - miFlagModeAutoReturnField->Add("5 Seconds", 310, false, false); - miFlagModeAutoReturnField->Add("10 Seconds", 620); - miFlagModeAutoReturnField->Add("15 Seconds", 930, false, false); - miFlagModeAutoReturnField->Add("20 Seconds", 1240); - miFlagModeAutoReturnField->Add("25 Seconds", 1550, false, false); - miFlagModeAutoReturnField->Add("30 Seconds", 1860, false, false); - miFlagModeAutoReturnField->Add("35 Seconds", 2170, false, false); - miFlagModeAutoReturnField->Add("40 Seconds", 2480, false, false); - miFlagModeAutoReturnField->Add("45 Seconds", 2790, false, false); - miFlagModeAutoReturnField->Add("50 Seconds", 3100, false, false); - miFlagModeAutoReturnField->Add("55 Seconds", 3410, false, false); - miFlagModeAutoReturnField->Add("60 Seconds", 3720, false, false); - miFlagModeAutoReturnField->SetData(&game_values.gamemodemenusettings.flag.autoreturn, NULL, NULL); - miFlagModeAutoReturnField->SetKey(game_values.gamemodemenusettings.flag.autoreturn); + miFlagModeAutoReturnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Auto Return", 400, 180); + miFlagModeAutoReturnField->add("None", 0); + miFlagModeAutoReturnField->add("5 Seconds", 310, false); + miFlagModeAutoReturnField->add("10 Seconds", 620); + miFlagModeAutoReturnField->add("15 Seconds", 930, false); + miFlagModeAutoReturnField->add("20 Seconds", 1240); + miFlagModeAutoReturnField->add("25 Seconds", 1550, false); + miFlagModeAutoReturnField->add("30 Seconds", 1860, false); + miFlagModeAutoReturnField->add("35 Seconds", 2170, false); + miFlagModeAutoReturnField->add("40 Seconds", 2480, false); + miFlagModeAutoReturnField->add("45 Seconds", 2790, false); + miFlagModeAutoReturnField->add("50 Seconds", 3100, false); + miFlagModeAutoReturnField->add("55 Seconds", 3410, false); + miFlagModeAutoReturnField->add("60 Seconds", 3720, false); + miFlagModeAutoReturnField->setOutputPtr(&game_values.gamemodemenusettings.flag.autoreturn); + miFlagModeAutoReturnField->setCurrentValue(game_values.gamemodemenusettings.flag.autoreturn); miFlagModeHomeScoreField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Need Home", 400, 180); miFlagModeHomeScoreField->add("Off", false); @@ -592,29 +592,29 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Star Mode Settings //*********************** - miStarModeTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Time", 400, 150); - miStarModeTimeField->Add("5 Seconds", 5, false, false); - miStarModeTimeField->Add("10 Seconds", 10, false, false); - miStarModeTimeField->Add("15 Seconds", 15); - miStarModeTimeField->Add("20 Seconds", 20); - miStarModeTimeField->Add("25 Seconds", 25); - miStarModeTimeField->Add("30 Seconds", 30); - miStarModeTimeField->Add("35 Seconds", 35); - miStarModeTimeField->Add("40 Seconds", 40); - miStarModeTimeField->Add("45 Seconds", 45, false, false); - miStarModeTimeField->Add("50 Seconds", 50, false, false); - miStarModeTimeField->Add("55 Seconds", 55, false, false); - miStarModeTimeField->Add("60 Seconds", 60, false, false); - miStarModeTimeField->SetData(&game_values.gamemodemenusettings.star.time, NULL, NULL); - miStarModeTimeField->SetKey(game_values.gamemodemenusettings.star.time); - - miStarModeShineField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Star Type", 400, 150); - miStarModeShineField->Add("Ztar", 0); - miStarModeShineField->Add("Shine", 1); - miStarModeShineField->Add("Multi Star", 2); - miStarModeShineField->Add("Random", 3); - miStarModeShineField->SetData(&game_values.gamemodemenusettings.star.shine, NULL, NULL); - miStarModeShineField->SetKey(game_values.gamemodemenusettings.star.shine); + miStarModeTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Time", 400, 150); + miStarModeTimeField->add("5 Seconds", 5, false); + miStarModeTimeField->add("10 Seconds", 10, false); + miStarModeTimeField->add("15 Seconds", 15); + miStarModeTimeField->add("20 Seconds", 20); + miStarModeTimeField->add("25 Seconds", 25); + miStarModeTimeField->add("30 Seconds", 30); + miStarModeTimeField->add("35 Seconds", 35); + miStarModeTimeField->add("40 Seconds", 40); + miStarModeTimeField->add("45 Seconds", 45, false); + miStarModeTimeField->add("50 Seconds", 50, false); + miStarModeTimeField->add("55 Seconds", 55, false); + miStarModeTimeField->add("60 Seconds", 60, false); + miStarModeTimeField->setOutputPtr(&game_values.gamemodemenusettings.star.time); + miStarModeTimeField->setCurrentValue(game_values.gamemodemenusettings.star.time); + + miStarModeShineField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Star Type", 400, 150); + miStarModeShineField->add("Ztar", 0); + miStarModeShineField->add("Shine", 1); + miStarModeShineField->add("Multi Star", 2); + miStarModeShineField->add("Random", 3); + miStarModeShineField->setOutputPtr(&game_values.gamemodemenusettings.star.shine); + miStarModeShineField->setCurrentValue(game_values.gamemodemenusettings.star.shine); miStarModePercentExtraTime = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Time", 400, 150, 384); miStarModePercentExtraTime->add("0", 0, false); @@ -666,49 +666,49 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Domination Mode Settings //*********************** - miDominationModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 120, "Quantity", 400, 180); - miDominationModeQuantityField->Add("1 Base", 1, false, false); - miDominationModeQuantityField->Add("2 Bases", 2, false, false); - miDominationModeQuantityField->Add("3 Bases", 3); - miDominationModeQuantityField->Add("4 Bases", 4); - miDominationModeQuantityField->Add("5 Bases", 5); - miDominationModeQuantityField->Add("6 Bases", 6, false, false); - miDominationModeQuantityField->Add("7 Bases", 7, false, false); - miDominationModeQuantityField->Add("8 Bases", 8, false, false); - miDominationModeQuantityField->Add("9 Bases", 9, false, false); - miDominationModeQuantityField->Add("10 Bases", 10, false, false); - miDominationModeQuantityField->Add("# Players - 1", 11, false, false); - miDominationModeQuantityField->Add("# Players", 12, false, false); - miDominationModeQuantityField->Add("# Players + 1", 13); - miDominationModeQuantityField->Add("# Players + 2", 14); - miDominationModeQuantityField->Add("# Players + 3", 15); - miDominationModeQuantityField->Add("# Players + 4", 16); - miDominationModeQuantityField->Add("# Players + 5", 17); - miDominationModeQuantityField->Add("# Players + 6", 18, false, false); - miDominationModeQuantityField->Add("2x Players - 3", 19, false, false); - miDominationModeQuantityField->Add("2x Players - 2", 20, false, false); - miDominationModeQuantityField->Add("2x Players - 1", 21); - miDominationModeQuantityField->Add("2x Players", 22); - miDominationModeQuantityField->Add("2x Players + 1", 23, false, false); - miDominationModeQuantityField->Add("2x Players + 2", 24, false, false); - miDominationModeQuantityField->SetData(&game_values.gamemodemenusettings.domination.quantity, NULL, NULL); - miDominationModeQuantityField->SetKey(game_values.gamemodemenusettings.domination.quantity); - - miDominationModeRelocateFrequencyField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Relocate", 400, 180); - miDominationModeRelocateFrequencyField->Add("Never", 0); - miDominationModeRelocateFrequencyField->Add("5 Seconds", 310, false, false); - miDominationModeRelocateFrequencyField->Add("10 Seconds", 620); - miDominationModeRelocateFrequencyField->Add("15 Seconds", 930); - miDominationModeRelocateFrequencyField->Add("20 Seconds", 1240); - miDominationModeRelocateFrequencyField->Add("30 Seconds", 1860); - miDominationModeRelocateFrequencyField->Add("45 Seconds", 2790); - miDominationModeRelocateFrequencyField->Add("1 Minute", 3720); - miDominationModeRelocateFrequencyField->Add("1.5 Minutes", 5580); - miDominationModeRelocateFrequencyField->Add("2 Minutes", 7440); - miDominationModeRelocateFrequencyField->Add("2.5 Minutes", 9300); - miDominationModeRelocateFrequencyField->Add("3 Minutes", 11160); - miDominationModeRelocateFrequencyField->SetData(&game_values.gamemodemenusettings.domination.relocationfrequency, NULL, NULL); - miDominationModeRelocateFrequencyField->SetKey(game_values.gamemodemenusettings.domination.relocationfrequency); + miDominationModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 120, "Quantity", 400, 180); + miDominationModeQuantityField->add("1 Base", 1, false); + miDominationModeQuantityField->add("2 Bases", 2, false); + miDominationModeQuantityField->add("3 Bases", 3); + miDominationModeQuantityField->add("4 Bases", 4); + miDominationModeQuantityField->add("5 Bases", 5); + miDominationModeQuantityField->add("6 Bases", 6, false); + miDominationModeQuantityField->add("7 Bases", 7, false); + miDominationModeQuantityField->add("8 Bases", 8, false); + miDominationModeQuantityField->add("9 Bases", 9, false); + miDominationModeQuantityField->add("10 Bases", 10, false); + miDominationModeQuantityField->add("# Players - 1", 11, false); + miDominationModeQuantityField->add("# Players", 12, false); + miDominationModeQuantityField->add("# Players + 1", 13); + miDominationModeQuantityField->add("# Players + 2", 14); + miDominationModeQuantityField->add("# Players + 3", 15); + miDominationModeQuantityField->add("# Players + 4", 16); + miDominationModeQuantityField->add("# Players + 5", 17); + miDominationModeQuantityField->add("# Players + 6", 18, false); + miDominationModeQuantityField->add("2x Players - 3", 19, false); + miDominationModeQuantityField->add("2x Players - 2", 20, false); + miDominationModeQuantityField->add("2x Players - 1", 21); + miDominationModeQuantityField->add("2x Players", 22); + miDominationModeQuantityField->add("2x Players + 1", 23, false); + miDominationModeQuantityField->add("2x Players + 2", 24, false); + miDominationModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.domination.quantity); + miDominationModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.domination.quantity); + + miDominationModeRelocateFrequencyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Relocate", 400, 180); + miDominationModeRelocateFrequencyField->add("Never", 0); + miDominationModeRelocateFrequencyField->add("5 Seconds", 310, false); + miDominationModeRelocateFrequencyField->add("10 Seconds", 620); + miDominationModeRelocateFrequencyField->add("15 Seconds", 930); + miDominationModeRelocateFrequencyField->add("20 Seconds", 1240); + miDominationModeRelocateFrequencyField->add("30 Seconds", 1860); + miDominationModeRelocateFrequencyField->add("45 Seconds", 2790); + miDominationModeRelocateFrequencyField->add("1 Minute", 3720); + miDominationModeRelocateFrequencyField->add("1.5 Minutes", 5580); + miDominationModeRelocateFrequencyField->add("2 Minutes", 7440); + miDominationModeRelocateFrequencyField->add("2.5 Minutes", 9300); + miDominationModeRelocateFrequencyField->add("3 Minutes", 11160); + miDominationModeRelocateFrequencyField->setOutputPtr(&game_values.gamemodemenusettings.domination.relocationfrequency); + miDominationModeRelocateFrequencyField->setCurrentValue(game_values.gamemodemenusettings.domination.relocationfrequency); miDominationModeDeathText = new MI_Text("On Death", 120, 210, 0, true, TextAlign::LEFT); @@ -762,40 +762,40 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // King of the Hill Mode Settings //*********************** - miKingOfTheHillModeSizeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Size", 400, 180); - miKingOfTheHillModeSizeField->Add("2 x 2", 2); - miKingOfTheHillModeSizeField->Add("3 x 3", 3); - miKingOfTheHillModeSizeField->Add("4 x 4", 4); - miKingOfTheHillModeSizeField->Add("5 x 5", 5); - miKingOfTheHillModeSizeField->Add("6 x 6", 6); - miKingOfTheHillModeSizeField->Add("7 x 7", 7); - miKingOfTheHillModeSizeField->SetData(&game_values.gamemodemenusettings.kingofthehill.areasize, NULL, NULL); - miKingOfTheHillModeSizeField->SetKey(game_values.gamemodemenusettings.kingofthehill.areasize); - - miKingOfTheHillModeRelocateFrequencyField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Relocate", 400, 180); - miKingOfTheHillModeRelocateFrequencyField->Add("Never", 0); - miKingOfTheHillModeRelocateFrequencyField->Add("5 Seconds", 310, false, false); - miKingOfTheHillModeRelocateFrequencyField->Add("10 Seconds", 620); - miKingOfTheHillModeRelocateFrequencyField->Add("15 Seconds", 930); - miKingOfTheHillModeRelocateFrequencyField->Add("20 Seconds", 1240); - miKingOfTheHillModeRelocateFrequencyField->Add("30 Seconds", 1860); - miKingOfTheHillModeRelocateFrequencyField->Add("45 Seconds", 2790); - miKingOfTheHillModeRelocateFrequencyField->Add("1 Minute", 3720); - miKingOfTheHillModeRelocateFrequencyField->Add("1.5 Minutes", 5580); - miKingOfTheHillModeRelocateFrequencyField->Add("2 Minutes", 7440); - miKingOfTheHillModeRelocateFrequencyField->Add("2.5 Minutes", 9300); - miKingOfTheHillModeRelocateFrequencyField->Add("3 Minutes", 11160); - miKingOfTheHillModeRelocateFrequencyField->SetData(&game_values.gamemodemenusettings.kingofthehill.relocationfrequency, NULL, NULL); - miKingOfTheHillModeRelocateFrequencyField->SetKey(game_values.gamemodemenusettings.kingofthehill.relocationfrequency); - - miKingOfTheHillModeMultiplierField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Max Multiplier", 400, 180); - miKingOfTheHillModeMultiplierField->Add("None", 1); - miKingOfTheHillModeMultiplierField->Add("2", 2); - miKingOfTheHillModeMultiplierField->Add("3", 3); - miKingOfTheHillModeMultiplierField->Add("4", 4); - miKingOfTheHillModeMultiplierField->Add("5", 5); - miKingOfTheHillModeMultiplierField->SetData(&game_values.gamemodemenusettings.kingofthehill.maxmultiplier, NULL, NULL); - miKingOfTheHillModeMultiplierField->SetKey(game_values.gamemodemenusettings.kingofthehill.maxmultiplier); + miKingOfTheHillModeSizeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Size", 400, 180); + miKingOfTheHillModeSizeField->add("2 x 2", 2); + miKingOfTheHillModeSizeField->add("3 x 3", 3); + miKingOfTheHillModeSizeField->add("4 x 4", 4); + miKingOfTheHillModeSizeField->add("5 x 5", 5); + miKingOfTheHillModeSizeField->add("6 x 6", 6); + miKingOfTheHillModeSizeField->add("7 x 7", 7); + miKingOfTheHillModeSizeField->setOutputPtr(&game_values.gamemodemenusettings.kingofthehill.areasize); + miKingOfTheHillModeSizeField->setCurrentValue(game_values.gamemodemenusettings.kingofthehill.areasize); + + miKingOfTheHillModeRelocateFrequencyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Relocate", 400, 180); + miKingOfTheHillModeRelocateFrequencyField->add("Never", 0); + miKingOfTheHillModeRelocateFrequencyField->add("5 Seconds", 310, false); + miKingOfTheHillModeRelocateFrequencyField->add("10 Seconds", 620); + miKingOfTheHillModeRelocateFrequencyField->add("15 Seconds", 930); + miKingOfTheHillModeRelocateFrequencyField->add("20 Seconds", 1240); + miKingOfTheHillModeRelocateFrequencyField->add("30 Seconds", 1860); + miKingOfTheHillModeRelocateFrequencyField->add("45 Seconds", 2790); + miKingOfTheHillModeRelocateFrequencyField->add("1 Minute", 3720); + miKingOfTheHillModeRelocateFrequencyField->add("1.5 Minutes", 5580); + miKingOfTheHillModeRelocateFrequencyField->add("2 Minutes", 7440); + miKingOfTheHillModeRelocateFrequencyField->add("2.5 Minutes", 9300); + miKingOfTheHillModeRelocateFrequencyField->add("3 Minutes", 11160); + miKingOfTheHillModeRelocateFrequencyField->setOutputPtr(&game_values.gamemodemenusettings.kingofthehill.relocationfrequency); + miKingOfTheHillModeRelocateFrequencyField->setCurrentValue(game_values.gamemodemenusettings.kingofthehill.relocationfrequency); + + miKingOfTheHillModeMultiplierField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Max Multiplier", 400, 180); + miKingOfTheHillModeMultiplierField->add("None", 1); + miKingOfTheHillModeMultiplierField->add("2", 2); + miKingOfTheHillModeMultiplierField->add("3", 3); + miKingOfTheHillModeMultiplierField->add("4", 4); + miKingOfTheHillModeMultiplierField->add("5", 5); + miKingOfTheHillModeMultiplierField->setOutputPtr(&game_values.gamemodemenusettings.kingofthehill.maxmultiplier); + miKingOfTheHillModeMultiplierField->setCurrentValue(game_values.gamemodemenusettings.kingofthehill.maxmultiplier); miKingOfTheHillModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miKingOfTheHillModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -822,35 +822,35 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Race Mode Settings //*********************** - miRaceModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Quantity", 400, 180); - miRaceModeQuantityField->Add("2", 2, false, false); - miRaceModeQuantityField->Add("3", 3); - miRaceModeQuantityField->Add("4", 4); - miRaceModeQuantityField->Add("5", 5); - miRaceModeQuantityField->Add("6", 6); - miRaceModeQuantityField->Add("7", 7); - miRaceModeQuantityField->Add("8", MAXRACEGOALS); - miRaceModeQuantityField->SetData(&game_values.gamemodemenusettings.race.quantity, NULL, NULL); - miRaceModeQuantityField->SetKey(game_values.gamemodemenusettings.race.quantity); - - miRaceModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Speed", 400, 180); - miRaceModeSpeedField->Add("Stationary", 0); - miRaceModeSpeedField->Add("Very Slow", 2); - miRaceModeSpeedField->Add("Slow", 3); - miRaceModeSpeedField->Add("Moderate", 4); - miRaceModeSpeedField->Add("Fast", 6); - miRaceModeSpeedField->Add("Very Fast", 8, false, false); - miRaceModeSpeedField->Add("Extremely Fast", 15, false, false); - miRaceModeSpeedField->Add("Insanely Fast", 30, false, false); - miRaceModeSpeedField->SetData(&game_values.gamemodemenusettings.race.speed, NULL, NULL); - miRaceModeSpeedField->SetKey(game_values.gamemodemenusettings.race.speed); - - miRaceModePenaltyField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Penalty", 400, 180); - miRaceModePenaltyField->Add("None", 0); - miRaceModePenaltyField->Add("One Goal", 1); - miRaceModePenaltyField->Add("All Goals", 2); - miRaceModePenaltyField->SetData(&game_values.gamemodemenusettings.race.penalty, NULL, NULL); - miRaceModePenaltyField->SetKey(game_values.gamemodemenusettings.race.penalty); + miRaceModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Quantity", 400, 180); + miRaceModeQuantityField->add("2", 2, false); + miRaceModeQuantityField->add("3", 3); + miRaceModeQuantityField->add("4", 4); + miRaceModeQuantityField->add("5", 5); + miRaceModeQuantityField->add("6", 6); + miRaceModeQuantityField->add("7", 7); + miRaceModeQuantityField->add("8", MAXRACEGOALS); + miRaceModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.race.quantity); + miRaceModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.race.quantity); + + miRaceModeSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Speed", 400, 180); + miRaceModeSpeedField->add("Stationary", 0); + miRaceModeSpeedField->add("Very Slow", 2); + miRaceModeSpeedField->add("Slow", 3); + miRaceModeSpeedField->add("Moderate", 4); + miRaceModeSpeedField->add("Fast", 6); + miRaceModeSpeedField->add("Very Fast", 8, false); + miRaceModeSpeedField->add("Extremely Fast", 15, false); + miRaceModeSpeedField->add("Insanely Fast", 30, false); + miRaceModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.race.speed); + miRaceModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.race.speed); + + miRaceModePenaltyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Penalty", 400, 180); + miRaceModePenaltyField->add("None", 0); + miRaceModePenaltyField->add("One Goal", 1); + miRaceModePenaltyField->add("All Goals", 2); + miRaceModePenaltyField->setOutputPtr(&game_values.gamemodemenusettings.race.penalty); + miRaceModePenaltyField->setCurrentValue(game_values.gamemodemenusettings.race.penalty); miRaceModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miRaceModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -916,27 +916,27 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miSurvivalModeEnemySlider[iEnemy]->setCurrentValue(game_values.gamemodemenusettings.survival.enemyweight[iEnemy]); } - miSurvivalModeDensityField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Density", 400, 180); - miSurvivalModeDensityField->Add("Very Low", 40, false, false); - miSurvivalModeDensityField->Add("Low", 30); - miSurvivalModeDensityField->Add("Medium", 20); - miSurvivalModeDensityField->Add("High", 15); - miSurvivalModeDensityField->Add("Very High", 10, false, false); - miSurvivalModeDensityField->Add("Extremely High", 6); - miSurvivalModeDensityField->Add("Insanely High", 2, false, false); - miSurvivalModeDensityField->SetData(&game_values.gamemodemenusettings.survival.density, NULL, NULL); - miSurvivalModeDensityField->SetKey(game_values.gamemodemenusettings.survival.density); - - miSurvivalModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Speed", 400, 180); - miSurvivalModeSpeedField->Add("Very Slow", 2, false, false); - miSurvivalModeSpeedField->Add("Slow", 3); - miSurvivalModeSpeedField->Add("Moderate", 4); - miSurvivalModeSpeedField->Add("Fast", 6); - miSurvivalModeSpeedField->Add("Very Fast", 8, false, false); - miSurvivalModeSpeedField->Add("Extremely Fast", 15, false, false); - miSurvivalModeSpeedField->Add("Insanely Fast", 30, false, false); - miSurvivalModeSpeedField->SetData(&game_values.gamemodemenusettings.survival.speed, NULL, NULL); - miSurvivalModeSpeedField->SetKey(game_values.gamemodemenusettings.survival.speed); + miSurvivalModeDensityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Density", 400, 180); + miSurvivalModeDensityField->add("Very Low", 40, false); + miSurvivalModeDensityField->add("Low", 30); + miSurvivalModeDensityField->add("Medium", 20); + miSurvivalModeDensityField->add("High", 15); + miSurvivalModeDensityField->add("Very High", 10, false); + miSurvivalModeDensityField->add("Extremely High", 6); + miSurvivalModeDensityField->add("Insanely High", 2, false); + miSurvivalModeDensityField->setOutputPtr(&game_values.gamemodemenusettings.survival.density); + miSurvivalModeDensityField->setCurrentValue(game_values.gamemodemenusettings.survival.density); + + miSurvivalModeSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Speed", 400, 180); + miSurvivalModeSpeedField->add("Very Slow", 2, false); + miSurvivalModeSpeedField->add("Slow", 3); + miSurvivalModeSpeedField->add("Moderate", 4); + miSurvivalModeSpeedField->add("Fast", 6); + miSurvivalModeSpeedField->add("Very Fast", 8, false); + miSurvivalModeSpeedField->add("Extremely Fast", 15, false); + miSurvivalModeSpeedField->add("Insanely Fast", 30, false); + miSurvivalModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.survival.speed); + miSurvivalModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.survival.speed); miSurvivalModeShieldField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Shield", 400, 180); miSurvivalModeShieldField->add("Off", false); @@ -971,25 +971,25 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** // Greed Mode Settings //*********************** - miGreedModeCoinLife = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Coin Life", 400, 150); - miGreedModeCoinLife->Add("1 Second", 62, false, false); - miGreedModeCoinLife->Add("2 Seconds", 124, false, false); - miGreedModeCoinLife->Add("3 Seconds", 186); - miGreedModeCoinLife->Add("4 Seconds", 248); - miGreedModeCoinLife->Add("5 Seconds", 310); - miGreedModeCoinLife->Add("6 Seconds", 372); - miGreedModeCoinLife->Add("7 Seconds", 434); - miGreedModeCoinLife->Add("8 Seconds", 496); - miGreedModeCoinLife->Add("9 Seconds", 558); - miGreedModeCoinLife->Add("10 Seconds", 620); - miGreedModeCoinLife->Add("12 Seconds", 744); - miGreedModeCoinLife->Add("15 Seconds", 930); - miGreedModeCoinLife->Add("18 Seconds", 1116); - miGreedModeCoinLife->Add("20 Seconds", 1240); - miGreedModeCoinLife->Add("25 Seconds", 1550); - miGreedModeCoinLife->Add("30 Seconds", 1860); - miGreedModeCoinLife->SetData(&game_values.gamemodemenusettings.greed.coinlife, NULL, NULL); - miGreedModeCoinLife->SetKey(game_values.gamemodemenusettings.greed.coinlife); + miGreedModeCoinLife = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Coin Life", 400, 150); + miGreedModeCoinLife->add("1 Second", 62, false); + miGreedModeCoinLife->add("2 Seconds", 124, false); + miGreedModeCoinLife->add("3 Seconds", 186); + miGreedModeCoinLife->add("4 Seconds", 248); + miGreedModeCoinLife->add("5 Seconds", 310); + miGreedModeCoinLife->add("6 Seconds", 372); + miGreedModeCoinLife->add("7 Seconds", 434); + miGreedModeCoinLife->add("8 Seconds", 496); + miGreedModeCoinLife->add("9 Seconds", 558); + miGreedModeCoinLife->add("10 Seconds", 620); + miGreedModeCoinLife->add("12 Seconds", 744); + miGreedModeCoinLife->add("15 Seconds", 930); + miGreedModeCoinLife->add("18 Seconds", 1116); + miGreedModeCoinLife->add("20 Seconds", 1240); + miGreedModeCoinLife->add("25 Seconds", 1550); + miGreedModeCoinLife->add("30 Seconds", 1860); + miGreedModeCoinLife->setOutputPtr(&game_values.gamemodemenusettings.greed.coinlife); + miGreedModeCoinLife->setCurrentValue(game_values.gamemodemenusettings.greed.coinlife); miGreedModeOwnCoins = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Own Coins", 400, 150); miGreedModeOwnCoins->add("Yes", true); @@ -998,15 +998,15 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModeOwnCoins->setCurrentValue(game_values.gamemodemenusettings.greed.owncoins); miGreedModeOwnCoins->setAutoAdvance(true); - miGreedModeMultiplier = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Multipler", 400, 150); - miGreedModeMultiplier->Add("0.5", 1, false, false); - miGreedModeMultiplier->Add("1", 2); - miGreedModeMultiplier->Add("1.5", 3); - miGreedModeMultiplier->Add("2", 4); - miGreedModeMultiplier->Add("2.5", 5, false, false); - miGreedModeMultiplier->Add("3", 6, false, false); - miGreedModeMultiplier->SetData(&game_values.gamemodemenusettings.greed.multiplier, NULL, NULL); - miGreedModeMultiplier->SetKey(game_values.gamemodemenusettings.greed.multiplier); + miGreedModeMultiplier = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Multipler", 400, 150); + miGreedModeMultiplier->add("0.5", 1, false); + miGreedModeMultiplier->add("1", 2); + miGreedModeMultiplier->add("1.5", 3); + miGreedModeMultiplier->add("2", 4); + miGreedModeMultiplier->add("2.5", 5, false); + miGreedModeMultiplier->add("3", 6, false); + miGreedModeMultiplier->setOutputPtr(&game_values.gamemodemenusettings.greed.multiplier); + miGreedModeMultiplier->setCurrentValue(game_values.gamemodemenusettings.greed.multiplier); miGreedModePercentExtraCoin = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 280, "Extra Coins", 400, 150, 384); miGreedModePercentExtraCoin->add("0", 0, false); @@ -1059,35 +1059,35 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** // Health Mode Settings //*********************** - miHealthModeStartLife = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Start Life", 400, 150); - miHealthModeStartLife->Add("2", 2, false, false); - miHealthModeStartLife->Add("3", 3, false, false); - miHealthModeStartLife->Add("4", 4); - miHealthModeStartLife->Add("5", 5); - miHealthModeStartLife->Add("6", 6); - miHealthModeStartLife->Add("7", 7, false, false); - miHealthModeStartLife->Add("8", 8, false, false); - miHealthModeStartLife->Add("9", 9, false, false); - miHealthModeStartLife->Add("10", 10, false, false); - miHealthModeStartLife->SetData(&game_values.gamemodemenusettings.health.startlife, NULL, NULL); - miHealthModeStartLife->SetKey(game_values.gamemodemenusettings.health.startlife); - miHealthModeStartLife->SetNoWrap(true); - miHealthModeStartLife->SetItemChangedCode(MENU_CODE_HEALTH_MODE_START_LIFE_CHANGED); - - miHealthModeMaxLife = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Max Life", 400, 150); - miHealthModeMaxLife->Add("2", 2, false, false); - miHealthModeMaxLife->Add("3", 3, false, false); - miHealthModeMaxLife->Add("4", 4, false, false); - miHealthModeMaxLife->Add("5", 5, false, false); - miHealthModeMaxLife->Add("6", 6); - miHealthModeMaxLife->Add("7", 7); - miHealthModeMaxLife->Add("8", 8); - miHealthModeMaxLife->Add("9", 9); - miHealthModeMaxLife->Add("10", 10); - miHealthModeMaxLife->SetData(&game_values.gamemodemenusettings.health.maxlife, NULL, NULL); - miHealthModeMaxLife->SetKey(game_values.gamemodemenusettings.health.maxlife); - miHealthModeMaxLife->SetNoWrap(true); - miHealthModeMaxLife->SetItemChangedCode(MENU_CODE_HEALTH_MODE_MAX_LIFE_CHANGED); + miHealthModeStartLife = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Start Life", 400, 150); + miHealthModeStartLife->add("2", 2, false); + miHealthModeStartLife->add("3", 3, false); + miHealthModeStartLife->add("4", 4); + miHealthModeStartLife->add("5", 5); + miHealthModeStartLife->add("6", 6); + miHealthModeStartLife->add("7", 7, false); + miHealthModeStartLife->add("8", 8, false); + miHealthModeStartLife->add("9", 9, false); + miHealthModeStartLife->add("10", 10, false); + miHealthModeStartLife->setOutputPtr(&game_values.gamemodemenusettings.health.startlife); + miHealthModeStartLife->setCurrentValue(game_values.gamemodemenusettings.health.startlife); + miHealthModeStartLife->allowWrap(false); + miHealthModeStartLife->setItemChangedCode(MENU_CODE_HEALTH_MODE_START_LIFE_CHANGED); + + miHealthModeMaxLife = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Max Life", 400, 150); + miHealthModeMaxLife->add("2", 2, false); + miHealthModeMaxLife->add("3", 3, false); + miHealthModeMaxLife->add("4", 4, false); + miHealthModeMaxLife->add("5", 5, false); + miHealthModeMaxLife->add("6", 6); + miHealthModeMaxLife->add("7", 7); + miHealthModeMaxLife->add("8", 8); + miHealthModeMaxLife->add("9", 9); + miHealthModeMaxLife->add("10", 10); + miHealthModeMaxLife->setOutputPtr(&game_values.gamemodemenusettings.health.maxlife); + miHealthModeMaxLife->setCurrentValue(game_values.gamemodemenusettings.health.maxlife); + miHealthModeMaxLife->allowWrap(false); + miHealthModeMaxLife->setItemChangedCode(MENU_CODE_HEALTH_MODE_MAX_LIFE_CHANGED); miHealthModePercentExtraLife = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 120, 260, "Extra Life", 400, 150, 384); miHealthModePercentExtraLife->add("0", 0, false); @@ -1139,68 +1139,68 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Card Collection Mode Settings //*********************** - miCollectionModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Limit", 400, 180); - miCollectionModeQuantityField->Add("1 Card", 1); - miCollectionModeQuantityField->Add("2 Cards", 2); - miCollectionModeQuantityField->Add("3 Cards", 3); - miCollectionModeQuantityField->Add("4 Cards", 4, false, false); - miCollectionModeQuantityField->Add("5 Cards", 5, false, false); - miCollectionModeQuantityField->Add("# Players - 1", 6); - miCollectionModeQuantityField->Add("# Players", 7); - miCollectionModeQuantityField->Add("# Players + 1", 8, false, false); - miCollectionModeQuantityField->Add("# Players + 2", 9, false, false); - miCollectionModeQuantityField->Add("# Players + 3", 10, false, false); - miCollectionModeQuantityField->SetData(&game_values.gamemodemenusettings.collection.quantity, NULL, NULL); - miCollectionModeQuantityField->SetKey(game_values.gamemodemenusettings.collection.quantity); - - miCollectionModeRateField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Rate", 400, 180); - miCollectionModeRateField->Add("Instant", 0); - miCollectionModeRateField->Add("1 Second", 62); - miCollectionModeRateField->Add("2 Seconds", 124); - miCollectionModeRateField->Add("3 Seconds", 186); - miCollectionModeRateField->Add("5 Seconds", 310); - miCollectionModeRateField->Add("10 Seconds", 620, false, false); - miCollectionModeRateField->Add("15 Seconds", 930, false, false); - miCollectionModeRateField->Add("20 Seconds", 1240, false, false); - miCollectionModeRateField->Add("25 Seconds", 1550, false, false); - miCollectionModeRateField->Add("30 Seconds", 1860, false, false); - miCollectionModeRateField->SetData(&game_values.gamemodemenusettings.collection.rate, NULL, NULL); - miCollectionModeRateField->SetKey(game_values.gamemodemenusettings.collection.rate); - - miCollectionModeBankTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Bank Time", 400, 180); - miCollectionModeBankTimeField->Add("Instant", 0, false, false); - miCollectionModeBankTimeField->Add("1 Second", 62, false, false); - miCollectionModeBankTimeField->Add("2 Seconds", 124); - miCollectionModeBankTimeField->Add("3 Seconds", 186); - miCollectionModeBankTimeField->Add("4 Seconds", 248); - miCollectionModeBankTimeField->Add("5 Seconds", 310); - miCollectionModeBankTimeField->Add("6 Seconds", 372, false, false); - miCollectionModeBankTimeField->Add("7 Seconds", 434, false, false); - miCollectionModeBankTimeField->Add("8 Seconds", 496, false, false); - miCollectionModeBankTimeField->Add("9 Seconds", 558, false, false); - miCollectionModeBankTimeField->Add("10 Seconds", 620, false, false); - miCollectionModeBankTimeField->SetData(&game_values.gamemodemenusettings.collection.banktime, NULL, NULL); - miCollectionModeBankTimeField->SetKey(game_values.gamemodemenusettings.collection.banktime); - - miCollectionModeCardLifeField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Card Life", 400, 180); - miCollectionModeCardLifeField->Add("1 Second", 62, false, false); - miCollectionModeCardLifeField->Add("2 Seconds", 124, false, false); - miCollectionModeCardLifeField->Add("3 Seconds", 186); - miCollectionModeCardLifeField->Add("4 Seconds", 248); - miCollectionModeCardLifeField->Add("5 Seconds", 310); - miCollectionModeCardLifeField->Add("6 Seconds", 372); - miCollectionModeCardLifeField->Add("7 Seconds", 434); - miCollectionModeCardLifeField->Add("8 Seconds", 496); - miCollectionModeCardLifeField->Add("9 Seconds", 558); - miCollectionModeCardLifeField->Add("10 Seconds", 620); - miCollectionModeCardLifeField->Add("12 Seconds", 744); - miCollectionModeCardLifeField->Add("15 Seconds", 930); - miCollectionModeCardLifeField->Add("18 Seconds", 1116); - miCollectionModeCardLifeField->Add("20 Seconds", 1240); - miCollectionModeCardLifeField->Add("25 Seconds", 1550); - miCollectionModeCardLifeField->Add("30 Seconds", 1860); - miCollectionModeCardLifeField->SetData(&game_values.gamemodemenusettings.collection.cardlife, NULL, NULL); - miCollectionModeCardLifeField->SetKey(game_values.gamemodemenusettings.collection.cardlife); + miCollectionModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Limit", 400, 180); + miCollectionModeQuantityField->add("1 Card", 1); + miCollectionModeQuantityField->add("2 Cards", 2); + miCollectionModeQuantityField->add("3 Cards", 3); + miCollectionModeQuantityField->add("4 Cards", 4, false); + miCollectionModeQuantityField->add("5 Cards", 5, false); + miCollectionModeQuantityField->add("# Players - 1", 6); + miCollectionModeQuantityField->add("# Players", 7); + miCollectionModeQuantityField->add("# Players + 1", 8, false); + miCollectionModeQuantityField->add("# Players + 2", 9, false); + miCollectionModeQuantityField->add("# Players + 3", 10, false); + miCollectionModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.collection.quantity); + miCollectionModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.collection.quantity); + + miCollectionModeRateField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Rate", 400, 180); + miCollectionModeRateField->add("Instant", 0); + miCollectionModeRateField->add("1 Second", 62); + miCollectionModeRateField->add("2 Seconds", 124); + miCollectionModeRateField->add("3 Seconds", 186); + miCollectionModeRateField->add("5 Seconds", 310); + miCollectionModeRateField->add("10 Seconds", 620, false); + miCollectionModeRateField->add("15 Seconds", 930, false); + miCollectionModeRateField->add("20 Seconds", 1240, false); + miCollectionModeRateField->add("25 Seconds", 1550, false); + miCollectionModeRateField->add("30 Seconds", 1860, false); + miCollectionModeRateField->setOutputPtr(&game_values.gamemodemenusettings.collection.rate); + miCollectionModeRateField->setCurrentValue(game_values.gamemodemenusettings.collection.rate); + + miCollectionModeBankTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Bank Time", 400, 180); + miCollectionModeBankTimeField->add("Instant", 0, false); + miCollectionModeBankTimeField->add("1 Second", 62, false); + miCollectionModeBankTimeField->add("2 Seconds", 124); + miCollectionModeBankTimeField->add("3 Seconds", 186); + miCollectionModeBankTimeField->add("4 Seconds", 248); + miCollectionModeBankTimeField->add("5 Seconds", 310); + miCollectionModeBankTimeField->add("6 Seconds", 372, false); + miCollectionModeBankTimeField->add("7 Seconds", 434, false); + miCollectionModeBankTimeField->add("8 Seconds", 496, false); + miCollectionModeBankTimeField->add("9 Seconds", 558, false); + miCollectionModeBankTimeField->add("10 Seconds", 620, false); + miCollectionModeBankTimeField->setOutputPtr(&game_values.gamemodemenusettings.collection.banktime); + miCollectionModeBankTimeField->setCurrentValue(game_values.gamemodemenusettings.collection.banktime); + + miCollectionModeCardLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Card Life", 400, 180); + miCollectionModeCardLifeField->add("1 Second", 62, false); + miCollectionModeCardLifeField->add("2 Seconds", 124, false); + miCollectionModeCardLifeField->add("3 Seconds", 186); + miCollectionModeCardLifeField->add("4 Seconds", 248); + miCollectionModeCardLifeField->add("5 Seconds", 310); + miCollectionModeCardLifeField->add("6 Seconds", 372); + miCollectionModeCardLifeField->add("7 Seconds", 434); + miCollectionModeCardLifeField->add("8 Seconds", 496); + miCollectionModeCardLifeField->add("9 Seconds", 558); + miCollectionModeCardLifeField->add("10 Seconds", 620); + miCollectionModeCardLifeField->add("12 Seconds", 744); + miCollectionModeCardLifeField->add("15 Seconds", 930); + miCollectionModeCardLifeField->add("18 Seconds", 1116); + miCollectionModeCardLifeField->add("20 Seconds", 1240); + miCollectionModeCardLifeField->add("25 Seconds", 1550); + miCollectionModeCardLifeField->add("30 Seconds", 1860); + miCollectionModeCardLifeField->setOutputPtr(&game_values.gamemodemenusettings.collection.cardlife); + miCollectionModeCardLifeField->setCurrentValue(game_values.gamemodemenusettings.collection.cardlife); miCollectionModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miCollectionModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -1226,16 +1226,16 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Chase Mode Settings //*********************** - miChaseModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Speed", 400, 180); - miChaseModeSpeedField->Add("Very Slow", 3, false, false); - miChaseModeSpeedField->Add("Slow", 4); - miChaseModeSpeedField->Add("Moderate", 5); - miChaseModeSpeedField->Add("Fast", 6); - miChaseModeSpeedField->Add("Very Fast", 7); - miChaseModeSpeedField->Add("Extremely Fast", 8, false, false); - miChaseModeSpeedField->Add("Insanely Fast", 10, false, false); - miChaseModeSpeedField->SetData(&game_values.gamemodemenusettings.chase.phantospeed, NULL, NULL); - miChaseModeSpeedField->SetKey(game_values.gamemodemenusettings.chase.phantospeed); + miChaseModeSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Speed", 400, 180); + miChaseModeSpeedField->add("Very Slow", 3, false); + miChaseModeSpeedField->add("Slow", 4); + miChaseModeSpeedField->add("Moderate", 5); + miChaseModeSpeedField->add("Fast", 6); + miChaseModeSpeedField->add("Very Fast", 7); + miChaseModeSpeedField->add("Extremely Fast", 8, false); + miChaseModeSpeedField->add("Insanely Fast", 10, false); + miChaseModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.chase.phantospeed); + miChaseModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.chase.phantospeed); for (short iPhanto = 0; iPhanto < 3; iPhanto++) { miChaseModeQuantitySlider[iPhanto] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_phanto, 120, 200 + 40 * iPhanto, 400, iPhanto); @@ -1284,27 +1284,27 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miShyGuyTagModeTagOnSuicideField->setCurrentValue(game_values.gamemodemenusettings.shyguytag.tagonsuicide ? 1 : 0); miShyGuyTagModeTagOnSuicideField->setAutoAdvance(true); - miShyGuyTagModeTagOnStompField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Tag Transfer", 400, 180); - miShyGuyTagModeTagOnStompField->Add("Touch Only", 0); - miShyGuyTagModeTagOnStompField->Add("Kills Only", 1); - miShyGuyTagModeTagOnStompField->Add("Touch and Kills", 2); - miShyGuyTagModeTagOnStompField->SetData(&game_values.gamemodemenusettings.shyguytag.tagtransfer, NULL, NULL); - miShyGuyTagModeTagOnStompField->SetKey(game_values.gamemodemenusettings.shyguytag.tagtransfer); - - miShyGuyTagModeFreeTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Free Time", 400, 180); - miShyGuyTagModeFreeTimeField->Add("Instant", 0); - miShyGuyTagModeFreeTimeField->Add("1 Second", 1); - miShyGuyTagModeFreeTimeField->Add("2 Seconds", 2); - miShyGuyTagModeFreeTimeField->Add("3 Seconds", 3); - miShyGuyTagModeFreeTimeField->Add("4 Seconds", 4); - miShyGuyTagModeFreeTimeField->Add("5 Seconds", 5); - miShyGuyTagModeFreeTimeField->Add("6 Seconds", 6); - miShyGuyTagModeFreeTimeField->Add("7 Seconds", 7); - miShyGuyTagModeFreeTimeField->Add("8 Seconds", 8); - miShyGuyTagModeFreeTimeField->Add("9 Seconds", 9); - miShyGuyTagModeFreeTimeField->Add("10 Seconds", 10); - miShyGuyTagModeFreeTimeField->SetData(&game_values.gamemodemenusettings.shyguytag.freetime, NULL, NULL); - miShyGuyTagModeFreeTimeField->SetKey(game_values.gamemodemenusettings.shyguytag.freetime); + miShyGuyTagModeTagOnStompField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Tag Transfer", 400, 180); + miShyGuyTagModeTagOnStompField->add("Touch Only", 0); + miShyGuyTagModeTagOnStompField->add("Kills Only", 1); + miShyGuyTagModeTagOnStompField->add("Touch and Kills", 2); + miShyGuyTagModeTagOnStompField->setOutputPtr(&game_values.gamemodemenusettings.shyguytag.tagtransfer); + miShyGuyTagModeTagOnStompField->setCurrentValue(game_values.gamemodemenusettings.shyguytag.tagtransfer); + + miShyGuyTagModeFreeTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Free Time", 400, 180); + miShyGuyTagModeFreeTimeField->add("Instant", 0); + miShyGuyTagModeFreeTimeField->add("1 Second", 1); + miShyGuyTagModeFreeTimeField->add("2 Seconds", 2); + miShyGuyTagModeFreeTimeField->add("3 Seconds", 3); + miShyGuyTagModeFreeTimeField->add("4 Seconds", 4); + miShyGuyTagModeFreeTimeField->add("5 Seconds", 5); + miShyGuyTagModeFreeTimeField->add("6 Seconds", 6); + miShyGuyTagModeFreeTimeField->add("7 Seconds", 7); + miShyGuyTagModeFreeTimeField->add("8 Seconds", 8); + miShyGuyTagModeFreeTimeField->add("9 Seconds", 9); + miShyGuyTagModeFreeTimeField->add("10 Seconds", 10); + miShyGuyTagModeFreeTimeField->setOutputPtr(&game_values.gamemodemenusettings.shyguytag.freetime); + miShyGuyTagModeFreeTimeField->setCurrentValue(game_values.gamemodemenusettings.shyguytag.freetime); miShyGuyTagModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miShyGuyTagModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -1330,45 +1330,45 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Boss Mode Settings //*********************** - miBossModeTypeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Type", 400, 180); - miBossModeTypeField->Add("Hammer", 0); - miBossModeTypeField->Add("Bomb", 1); - miBossModeTypeField->Add("Fire", 2); - miBossModeTypeField->SetData(&game_values.gamemodemenusettings.boss.bosstype, NULL, NULL); - miBossModeTypeField->SetKey(game_values.gamemodemenusettings.boss.bosstype); - - miBossModeDifficultyField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Difficulty", 400, 180); - miBossModeDifficultyField->Add("Very Easy", 0, false, false); - miBossModeDifficultyField->Add("Easy", 1); - miBossModeDifficultyField->Add("Moderate", 2); - miBossModeDifficultyField->Add("Hard", 3); - miBossModeDifficultyField->Add("Very Hard", 4, false, false); - miBossModeDifficultyField->SetData(&game_values.gamemodemenusettings.boss.difficulty, NULL, NULL); - miBossModeDifficultyField->SetKey(game_values.gamemodemenusettings.boss.difficulty); - - miBossModeHitPointsField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Health", 400, 180); - miBossModeHitPointsField->Add("1", 1, false, false); - miBossModeHitPointsField->Add("2", 2, false, false); - miBossModeHitPointsField->Add("3", 3); - miBossModeHitPointsField->Add("4", 4); - miBossModeHitPointsField->Add("5", 5); - miBossModeHitPointsField->Add("6", 6); - miBossModeHitPointsField->Add("7", 7); - miBossModeHitPointsField->Add("8", 8); - miBossModeHitPointsField->Add("9", 9, false, false); - miBossModeHitPointsField->Add("10", 10, false, false); - miBossModeHitPointsField->Add("11", 11, false, false); - miBossModeHitPointsField->Add("12", 12, false, false); - miBossModeHitPointsField->Add("13", 13, false, false); - miBossModeHitPointsField->Add("14", 14, false, false); - miBossModeHitPointsField->Add("15", 15, false, false); - miBossModeHitPointsField->Add("16", 16, false, false); - miBossModeHitPointsField->Add("17", 17, false, false); - miBossModeHitPointsField->Add("18", 18, false, false); - miBossModeHitPointsField->Add("19", 19, false, false); - miBossModeHitPointsField->Add("20", 20, false, false); - miBossModeHitPointsField->SetData(&game_values.gamemodemenusettings.boss.hitpoints, NULL, NULL); - miBossModeHitPointsField->SetKey(game_values.gamemodemenusettings.boss.hitpoints); + miBossModeTypeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Type", 400, 180); + miBossModeTypeField->add("Hammer", 0); + miBossModeTypeField->add("Bomb", 1); + miBossModeTypeField->add("Fire", 2); + miBossModeTypeField->setOutputPtr(&game_values.gamemodemenusettings.boss.bosstype); + miBossModeTypeField->setCurrentValue(game_values.gamemodemenusettings.boss.bosstype); + + miBossModeDifficultyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Difficulty", 400, 180); + miBossModeDifficultyField->add("Very Easy", 0, false); + miBossModeDifficultyField->add("Easy", 1); + miBossModeDifficultyField->add("Moderate", 2); + miBossModeDifficultyField->add("Hard", 3); + miBossModeDifficultyField->add("Very Hard", 4, false); + miBossModeDifficultyField->setOutputPtr(&game_values.gamemodemenusettings.boss.difficulty); + miBossModeDifficultyField->setCurrentValue(game_values.gamemodemenusettings.boss.difficulty); + + miBossModeHitPointsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Health", 400, 180); + miBossModeHitPointsField->add("1", 1, false); + miBossModeHitPointsField->add("2", 2, false); + miBossModeHitPointsField->add("3", 3); + miBossModeHitPointsField->add("4", 4); + miBossModeHitPointsField->add("5", 5); + miBossModeHitPointsField->add("6", 6); + miBossModeHitPointsField->add("7", 7); + miBossModeHitPointsField->add("8", 8); + miBossModeHitPointsField->add("9", 9, false); + miBossModeHitPointsField->add("10", 10, false); + miBossModeHitPointsField->add("11", 11, false); + miBossModeHitPointsField->add("12", 12, false); + miBossModeHitPointsField->add("13", 13, false); + miBossModeHitPointsField->add("14", 14, false); + miBossModeHitPointsField->add("15", 15, false); + miBossModeHitPointsField->add("16", 16, false); + miBossModeHitPointsField->add("17", 17, false); + miBossModeHitPointsField->add("18", 18, false); + miBossModeHitPointsField->add("19", 19, false); + miBossModeHitPointsField->add("20", 20, false); + miBossModeHitPointsField->setOutputPtr(&game_values.gamemodemenusettings.boss.hitpoints); + miBossModeHitPointsField->setCurrentValue(game_values.gamemodemenusettings.boss.hitpoints); miBossModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miBossModeBackButton->SetCode(MENU_CODE_BACK_TO_GAME_SETUP_MENU_FROM_MODE_SETTINGS); @@ -1399,26 +1399,26 @@ void UI_ModeOptionsMenu::SetControllingTeam(short iControlTeam) void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) { if (iMode == game_mode_classic) { // classic - game_values.gamemodesettings.classic.style = miClassicModeStyleField->GetRandomShortValue(); - game_values.gamemodesettings.classic.scoring = miClassicModeScoringField->GetRandomShortValue(); + game_values.gamemodesettings.classic.style = miClassicModeStyleField->randomValue(); + game_values.gamemodesettings.classic.scoring = miClassicModeScoringField->randomValue(); } else if (iMode == game_mode_frag) { // frag - game_values.gamemodesettings.frag.style = miFragModeStyleField->GetRandomShortValue(); - game_values.gamemodesettings.frag.scoring = miFragModeScoringField->GetRandomShortValue(); + game_values.gamemodesettings.frag.style = miFragModeStyleField->randomValue(); + game_values.gamemodesettings.frag.scoring = miFragModeScoringField->randomValue(); } else if (iMode == game_mode_timelimit) { // time - game_values.gamemodesettings.time.style = miTimeLimitModeStyleField->GetRandomShortValue(); - game_values.gamemodesettings.time.scoring = miTimeLimitModeScoringField->GetRandomShortValue(); + game_values.gamemodesettings.time.style = miTimeLimitModeStyleField->randomValue(); + game_values.gamemodesettings.time.scoring = miTimeLimitModeScoringField->randomValue(); game_values.gamemodesettings.time.percentextratime = miTimeLimitModePercentExtraTime->currentValue(); } else if (iMode == game_mode_jail) { // jail - game_values.gamemodesettings.jail.style = miJailModeStyleField->GetRandomShortValue(); - game_values.gamemodesettings.jail.timetofree = miJailModeTimeFreeField->GetRandomShortValue(); + game_values.gamemodesettings.jail.style = miJailModeStyleField->randomValue(); + game_values.gamemodesettings.jail.timetofree = miJailModeTimeFreeField->randomValue(); game_values.gamemodesettings.jail.tagfree = miJailModeTagFreeField->randomValue(); game_values.gamemodesettings.jail.percentkey = miJailModeJailKeyField->currentValue(); } else if (iMode == game_mode_coins) { // coins game_values.gamemodesettings.coins.penalty = miCoinModePenaltyField->randomValue(); - game_values.gamemodesettings.coins.quantity = miCoinModeQuantityField->GetRandomShortValue(); + game_values.gamemodesettings.coins.quantity = miCoinModeQuantityField->randomValue(); game_values.gamemodesettings.coins.percentextracoin = miCoinModePercentExtraCoin->currentValue(); } else if (iMode == game_mode_stomp) { // stomp - game_values.gamemodesettings.stomp.rate = miStompModeRateField->GetRandomShortValue(); + game_values.gamemodesettings.stomp.rate = miStompModeRateField->randomValue(); for (short iEnemy = 0; iEnemy < NUMSTOMPENEMIES; iEnemy++) game_values.gamemodesettings.stomp.enemyweight[iEnemy] = miStompModeEnemySlider[iEnemy]->currentValue(); @@ -1429,12 +1429,12 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) for (int iYoshi = 0; iYoshi < 4; iYoshi++) game_values.gamemodesettings.egg.yoshis[iYoshi] = miEggModeYoshiQuantityField[iYoshi]->currentValue(); - game_values.gamemodesettings.egg.explode = miEggModeExplosionTimeField->GetRandomShortValue(); + game_values.gamemodesettings.egg.explode = miEggModeExplosionTimeField->randomValue(); } else if (iMode == game_mode_ctf) { // capture the flag game_values.gamemodesettings.flag.speed = miFlagModeSpeedField->currentValue(); game_values.gamemodesettings.flag.touchreturn = miFlagModeTouchReturnField->randomValue(); game_values.gamemodesettings.flag.pointmove = miFlagModePointMoveField->randomValue(); - game_values.gamemodesettings.flag.autoreturn = miFlagModeAutoReturnField->GetRandomShortValue(); + game_values.gamemodesettings.flag.autoreturn = miFlagModeAutoReturnField->randomValue(); game_values.gamemodesettings.flag.homescore = miFlagModeHomeScoreField->randomValue(); game_values.gamemodesettings.flag.centerflag = miFlagModeCenterFlagField->randomValue(); } else if (iMode == game_mode_chicken) { // chicken @@ -1443,75 +1443,75 @@ void UI_ModeOptionsMenu::SetRandomGameModeSettings(short iMode) } else if (iMode == game_mode_tag) { // tag game_values.gamemodesettings.tag.tagontouch = miTagModeTagOnTouchField->randomValue(); } else if (iMode == game_mode_star) { // star - game_values.gamemodesettings.star.time = miStarModeTimeField->GetRandomShortValue(); - game_values.gamemodesettings.star.shine = miStarModeShineField->GetRandomShortValue(); + game_values.gamemodesettings.star.time = miStarModeTimeField->randomValue(); + game_values.gamemodesettings.star.shine = miStarModeShineField->randomValue(); game_values.gamemodesettings.star.percentextratime = miStarModePercentExtraTime->currentValue(); } else if (iMode == game_mode_domination) { // domination - game_values.gamemodesettings.domination.quantity = miDominationModeQuantityField->GetRandomShortValue(); + game_values.gamemodesettings.domination.quantity = miDominationModeQuantityField->randomValue(); game_values.gamemodesettings.domination.loseondeath = miDominationModeLoseOnDeathField->randomValue(); game_values.gamemodesettings.domination.relocateondeath = miDominationModeRelocateOnDeathField->randomValue(); game_values.gamemodesettings.domination.stealondeath = miDominationModeStealOnDeathField->randomValue(); - game_values.gamemodesettings.domination.relocationfrequency = miDominationModeRelocateFrequencyField->GetRandomShortValue(); + game_values.gamemodesettings.domination.relocationfrequency = miDominationModeRelocateFrequencyField->randomValue(); } else if (iMode == game_mode_koth) { // king of the hill - game_values.gamemodesettings.kingofthehill.areasize = miKingOfTheHillModeSizeField->GetRandomShortValue(); - game_values.gamemodesettings.kingofthehill.relocationfrequency = miKingOfTheHillModeRelocateFrequencyField->GetRandomShortValue(); - game_values.gamemodesettings.kingofthehill.maxmultiplier = miKingOfTheHillModeMultiplierField->GetRandomShortValue(); + game_values.gamemodesettings.kingofthehill.areasize = miKingOfTheHillModeSizeField->randomValue(); + game_values.gamemodesettings.kingofthehill.relocationfrequency = miKingOfTheHillModeRelocateFrequencyField->randomValue(); + game_values.gamemodesettings.kingofthehill.maxmultiplier = miKingOfTheHillModeMultiplierField->randomValue(); } else if (iMode == game_mode_race) { // race - game_values.gamemodesettings.race.quantity = miRaceModeQuantityField->GetRandomShortValue(); - game_values.gamemodesettings.race.speed = miRaceModeSpeedField->GetRandomShortValue(); - game_values.gamemodesettings.race.penalty = miRaceModePenaltyField->GetRandomShortValue(); + game_values.gamemodesettings.race.quantity = miRaceModeQuantityField->randomValue(); + game_values.gamemodesettings.race.speed = miRaceModeSpeedField->randomValue(); + game_values.gamemodesettings.race.penalty = miRaceModePenaltyField->randomValue(); } else if (iMode == game_mode_frenzy) { // frenzy miFrenzyModeOptions->SetRandomGameModeSettings(); } else if (iMode == game_mode_survival) { // survival - game_values.gamemodesettings.survival.density = miSurvivalModeDensityField->GetRandomShortValue(); - game_values.gamemodesettings.survival.speed = miSurvivalModeSpeedField->GetRandomShortValue(); + game_values.gamemodesettings.survival.density = miSurvivalModeDensityField->randomValue(); + game_values.gamemodesettings.survival.speed = miSurvivalModeSpeedField->randomValue(); game_values.gamemodesettings.survival.shield = miSurvivalModeShieldField->randomValue(); for (short iEnemy = 0; iEnemy < NUMSURVIVALENEMIES; iEnemy++) game_values.gamemodesettings.survival.enemyweight[iEnemy] = miSurvivalModeEnemySlider[iEnemy]->currentValue(); } else if (iMode == game_mode_greed) { // greed - game_values.gamemodesettings.greed.coinlife = miGreedModeCoinLife->GetRandomShortValue(); + game_values.gamemodesettings.greed.coinlife = miGreedModeCoinLife->randomValue(); game_values.gamemodesettings.greed.owncoins = miGreedModeOwnCoins->randomValue(); - game_values.gamemodesettings.greed.multiplier = miGreedModeMultiplier->GetRandomShortValue(); + game_values.gamemodesettings.greed.multiplier = miGreedModeMultiplier->randomValue(); game_values.gamemodesettings.greed.percentextracoin = miGreedModePercentExtraCoin->currentValue(); } else if (iMode == game_mode_health) { // health - game_values.gamemodesettings.health.startlife = miHealthModeStartLife->GetRandomShortValue(); - game_values.gamemodesettings.health.maxlife = miHealthModeMaxLife->GetRandomShortValue(); + game_values.gamemodesettings.health.startlife = miHealthModeStartLife->randomValue(); + game_values.gamemodesettings.health.maxlife = miHealthModeMaxLife->randomValue(); game_values.gamemodesettings.health.percentextralife = miHealthModePercentExtraLife->currentValue(); } else if (iMode == game_mode_collection) { // card collection - game_values.gamemodesettings.collection.quantity = miCollectionModeQuantityField->GetRandomShortValue(); - game_values.gamemodesettings.collection.rate = miCollectionModeRateField->GetRandomShortValue(); - game_values.gamemodesettings.collection.banktime = miCollectionModeBankTimeField->GetRandomShortValue(); - game_values.gamemodesettings.collection.cardlife = miCollectionModeCardLifeField->GetRandomShortValue(); + game_values.gamemodesettings.collection.quantity = miCollectionModeQuantityField->randomValue(); + game_values.gamemodesettings.collection.rate = miCollectionModeRateField->randomValue(); + game_values.gamemodesettings.collection.banktime = miCollectionModeBankTimeField->randomValue(); + game_values.gamemodesettings.collection.cardlife = miCollectionModeCardLifeField->randomValue(); } else if (iMode == game_mode_chase) { // chase (phanto) - game_values.gamemodesettings.chase.phantospeed = miChaseModeSpeedField->GetRandomShortValue(); + game_values.gamemodesettings.chase.phantospeed = miChaseModeSpeedField->randomValue(); for (short iPhanto = 0; iPhanto < 3; iPhanto++) game_values.gamemodesettings.chase.phantoquantity[iPhanto] = miChaseModeQuantitySlider[iPhanto]->currentValue(); } else if (iMode == game_mode_shyguytag) { // shyguy tag game_values.gamemodesettings.shyguytag.tagonsuicide = miShyGuyTagModeTagOnSuicideField->randomValue(); - game_values.gamemodesettings.shyguytag.tagtransfer = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); - game_values.gamemodesettings.shyguytag.freetime = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); + game_values.gamemodesettings.shyguytag.tagtransfer = miShyGuyTagModeTagOnStompField->randomValue(); + game_values.gamemodesettings.shyguytag.freetime = miShyGuyTagModeTagOnStompField->randomValue(); } else if (iMode == game_mode_boss_minigame) { // boss - game_values.gamemodesettings.boss.bosstype = miBossModeTypeField->GetRandomShortValue(); - game_values.gamemodesettings.boss.difficulty = miBossModeDifficultyField->GetRandomShortValue(); - game_values.gamemodesettings.boss.hitpoints = miBossModeHitPointsField->GetRandomShortValue(); + game_values.gamemodesettings.boss.bosstype = miBossModeTypeField->randomValue(); + game_values.gamemodesettings.boss.difficulty = miBossModeDifficultyField->randomValue(); + game_values.gamemodesettings.boss.hitpoints = miBossModeHitPointsField->randomValue(); } } void UI_ModeOptionsMenu::HealthModeStartLifeChanged() { - short iMaxLife = miHealthModeMaxLife->GetShortValue(); - if (miHealthModeStartLife->GetShortValue() > iMaxLife) { - miHealthModeStartLife->SetKey(iMaxLife); + short iMaxLife = miHealthModeMaxLife->currentValue(); + if (miHealthModeStartLife->currentValue() > iMaxLife) { + miHealthModeStartLife->setCurrentValue(iMaxLife); } } void UI_ModeOptionsMenu::HealthModeMaxLifeChanged() { - short iStartLife = miHealthModeStartLife->GetShortValue(); - if (miHealthModeMaxLife->GetShortValue() < iStartLife) { - miHealthModeMaxLife->SetKey(iStartLife); + short iStartLife = miHealthModeStartLife->currentValue(); + if (miHealthModeMaxLife->currentValue() < iStartLife) { + miHealthModeMaxLife->setCurrentValue(iStartLife); } } diff --git a/src/smw/menu/ModeOptionsMenu.h b/src/smw/menu/ModeOptionsMenu.h index 13b2c7cd..38dcd034 100644 --- a/src/smw/menu/ModeOptionsMenu.h +++ b/src/smw/menu/ModeOptionsMenu.h @@ -6,7 +6,6 @@ class MI_Button; class MI_Image; class MI_FrenzyModeOptions; class MI_PowerupSlider; -class MI_SelectField; class MI_SliderField; class MI_Text; template class MI_SelectFieldDyn; @@ -38,8 +37,8 @@ class UI_ModeOptionsMenu : public UI_Menu { UI_Menu mBossSettingsMenu; // Classic - MI_SelectField* miClassicModeStyleField; - MI_SelectField* miClassicModeScoringField; + MI_SelectFieldDyn* miClassicModeStyleField; + MI_SelectFieldDyn* miClassicModeScoringField; MI_Button* miClassicModeBackButton; MI_Image* miClassicModeLeftHeaderBar; @@ -47,8 +46,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miClassicModeHeaderText; // Frag - MI_SelectField* miFragModeStyleField; - MI_SelectField* miFragModeScoringField; + MI_SelectFieldDyn* miFragModeStyleField; + MI_SelectFieldDyn* miFragModeScoringField; MI_Button* miFragModeBackButton; MI_Image* miFragModeLeftHeaderBar; @@ -56,8 +55,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miFragModeHeaderText; // Time Limit - MI_SelectField* miTimeLimitModeStyleField; - MI_SelectField* miTimeLimitModeScoringField; + MI_SelectFieldDyn* miTimeLimitModeStyleField; + MI_SelectFieldDyn* miTimeLimitModeScoringField; MI_SliderField* miTimeLimitModePercentExtraTime; MI_Button* miTimeLimitModeBackButton; @@ -66,9 +65,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miTimeLimitModeHeaderText; // Jail - MI_SelectField* miJailModeStyleField; + MI_SelectFieldDyn* miJailModeStyleField; MI_SelectFieldDyn* miJailModeTagFreeField; - MI_SelectField* miJailModeTimeFreeField; + MI_SelectFieldDyn* miJailModeTimeFreeField; MI_SliderField* miJailModeJailKeyField; MI_Button* miJailModeBackButton; @@ -78,7 +77,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Coins MI_SelectFieldDyn* miCoinModePenaltyField; - MI_SelectField* miCoinModeQuantityField; + MI_SelectFieldDyn* miCoinModeQuantityField; MI_SliderField* miCoinModePercentExtraCoin; MI_Button* miCoinModeBackButton; @@ -89,7 +88,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Yoshi's Eggs MI_PowerupSlider* miEggModeEggQuantityField[4]; MI_PowerupSlider* miEggModeYoshiQuantityField[4]; - MI_SelectField* miEggModeExplosionTimeField; + MI_SelectFieldDyn* miEggModeExplosionTimeField; MI_Button* miEggModeBackButton; MI_Image* miEggModeLeftHeaderBar; @@ -100,7 +99,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_SliderField* miFlagModeSpeedField; MI_SelectFieldDyn* miFlagModeTouchReturnField; MI_SelectFieldDyn* miFlagModePointMoveField; - MI_SelectField* miFlagModeAutoReturnField; + MI_SelectFieldDyn* miFlagModeAutoReturnField; MI_SelectFieldDyn* miFlagModeHomeScoreField; MI_SelectFieldDyn* miFlagModeCenterFlagField; MI_Button* miFlagModeBackButton; @@ -127,8 +126,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miTagModeHeaderText; // Star - MI_SelectField* miStarModeTimeField; - MI_SelectField* miStarModeShineField; + MI_SelectFieldDyn* miStarModeTimeField; + MI_SelectFieldDyn* miStarModeShineField; MI_SliderField* miStarModePercentExtraTime; MI_Button* miStarModeBackButton; @@ -137,11 +136,11 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miStarModeHeaderText; // Domination - MI_SelectField* miDominationModeQuantityField; + MI_SelectFieldDyn* miDominationModeQuantityField; MI_SelectFieldDyn* miDominationModeLoseOnDeathField; MI_SelectFieldDyn* miDominationModeRelocateOnDeathField; MI_SelectFieldDyn* miDominationModeStealOnDeathField; - MI_SelectField* miDominationModeRelocateFrequencyField; + MI_SelectFieldDyn* miDominationModeRelocateFrequencyField; MI_Text* miDominationModeDeathText; @@ -152,9 +151,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miDominationModeHeaderText; // King of the Hill - MI_SelectField* miKingOfTheHillModeSizeField; - MI_SelectField* miKingOfTheHillModeRelocateFrequencyField; - MI_SelectField* miKingOfTheHillModeMultiplierField; + MI_SelectFieldDyn* miKingOfTheHillModeSizeField; + MI_SelectFieldDyn* miKingOfTheHillModeRelocateFrequencyField; + MI_SelectFieldDyn* miKingOfTheHillModeMultiplierField; MI_Button* miKingOfTheHillModeBackButton; @@ -163,9 +162,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miKingOfTheHillModeHeaderText; // Race - MI_SelectField* miRaceModeQuantityField; - MI_SelectField* miRaceModeSpeedField; - MI_SelectField* miRaceModePenaltyField; + MI_SelectFieldDyn* miRaceModeQuantityField; + MI_SelectFieldDyn* miRaceModeSpeedField; + MI_SelectFieldDyn* miRaceModePenaltyField; MI_Button* miRaceModeBackButton; MI_Image* miRaceModeLeftHeaderBar; @@ -173,7 +172,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miRaceModeHeaderText; // Stomp - MI_SelectField* miStompModeRateField; + MI_SelectFieldDyn* miStompModeRateField; MI_PowerupSlider* miStompModeEnemySlider[NUMSTOMPENEMIES]; MI_Button* miStompModeBackButton; @@ -190,8 +189,8 @@ class UI_ModeOptionsMenu : public UI_Menu { // Survival MI_PowerupSlider* miSurvivalModeEnemySlider[NUMSURVIVALENEMIES]; - MI_SelectField* miSurvivalModeDensityField; - MI_SelectField* miSurvivalModeSpeedField; + MI_SelectFieldDyn* miSurvivalModeDensityField; + MI_SelectFieldDyn* miSurvivalModeSpeedField; MI_SelectFieldDyn* miSurvivalModeShieldField; MI_Button* miSurvivalModeBackButton; @@ -200,9 +199,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miSurvivalModeHeaderText; // Greed - MI_SelectField* miGreedModeCoinLife; + MI_SelectFieldDyn* miGreedModeCoinLife; MI_SelectFieldDyn* miGreedModeOwnCoins; - MI_SelectField* miGreedModeMultiplier; + MI_SelectFieldDyn* miGreedModeMultiplier; MI_SliderField* miGreedModePercentExtraCoin; MI_Button* miGreedModeBackButton; @@ -211,8 +210,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miGreedModeHeaderText; // Health - MI_SelectField* miHealthModeStartLife; - MI_SelectField* miHealthModeMaxLife; + MI_SelectFieldDyn* miHealthModeStartLife; + MI_SelectFieldDyn* miHealthModeMaxLife; MI_SliderField* miHealthModePercentExtraLife; MI_Button* miHealthModeBackButton; @@ -221,10 +220,10 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miHealthModeHeaderText; // Card Collection - MI_SelectField* miCollectionModeQuantityField; - MI_SelectField* miCollectionModeRateField; - MI_SelectField* miCollectionModeBankTimeField; - MI_SelectField* miCollectionModeCardLifeField; + MI_SelectFieldDyn* miCollectionModeQuantityField; + MI_SelectFieldDyn* miCollectionModeRateField; + MI_SelectFieldDyn* miCollectionModeBankTimeField; + MI_SelectFieldDyn* miCollectionModeCardLifeField; MI_Button* miCollectionModeBackButton; MI_Image* miCollectionModeLeftHeaderBar; @@ -232,7 +231,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miCollectionModeHeaderText; // Phanto Chase - MI_SelectField* miChaseModeSpeedField; + MI_SelectFieldDyn* miChaseModeSpeedField; MI_PowerupSlider* miChaseModeQuantitySlider[3]; MI_Button* miChaseModeBackButton; @@ -242,8 +241,8 @@ class UI_ModeOptionsMenu : public UI_Menu { // Shyguy Tag MI_SelectFieldDyn* miShyGuyTagModeTagOnSuicideField; - MI_SelectField* miShyGuyTagModeTagOnStompField; - MI_SelectField* miShyGuyTagModeFreeTimeField; + MI_SelectFieldDyn* miShyGuyTagModeTagOnStompField; + MI_SelectFieldDyn* miShyGuyTagModeFreeTimeField; MI_Button* miShyGuyTagModeBackButton; MI_Image* miShyGuyTagModeLeftHeaderBar; @@ -251,9 +250,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miShyGuyTagModeHeaderText; // Boss - MI_SelectField* miBossModeTypeField; - MI_SelectField* miBossModeDifficultyField; - MI_SelectField* miBossModeHitPointsField; + MI_SelectFieldDyn* miBossModeTypeField; + MI_SelectFieldDyn* miBossModeDifficultyField; + MI_SelectFieldDyn* miBossModeHitPointsField; MI_Button* miBossModeBackButton; MI_Image* miBossModeLeftHeaderBar; From 33baeb8cfafe197232d829340b172b18c294b0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 13:55:21 +0200 Subject: [PATCH 08/14] Updated the options menus to use the new select field --- src/smw/menu/options/EyeCandyOptionsMenu.cpp | 116 +++--- src/smw/menu/options/EyeCandyOptionsMenu.h | 18 +- src/smw/menu/options/GameplayOptionsMenu.cpp | 240 ++++++------ src/smw/menu/options/GameplayOptionsMenu.h | 22 +- src/smw/menu/options/GraphicsOptionsMenu.cpp | 84 ++--- src/smw/menu/options/GraphicsOptionsMenu.h | 8 +- src/smw/menu/options/PowerupSettingsMenu.cpp | 126 +++---- src/smw/menu/options/PowerupSettingsMenu.h | 14 +- src/smw/menu/options/ProjectileLimitsMenu.cpp | 286 +++++++-------- src/smw/menu/options/ProjectileLimitsMenu.h | 20 +- .../menu/options/ProjectileOptionsMenu.cpp | 346 +++++++++--------- src/smw/menu/options/ProjectileOptionsMenu.h | 28 +- src/smw/menu/options/SoundOptionsMenu.cpp | 22 +- src/smw/menu/options/SoundOptionsMenu.h | 6 +- src/smw/menu/options/TeamOptionsMenu.cpp | 50 +-- src/smw/menu/options/TeamOptionsMenu.h | 8 +- 16 files changed, 697 insertions(+), 697 deletions(-) diff --git a/src/smw/menu/options/EyeCandyOptionsMenu.cpp b/src/smw/menu/options/EyeCandyOptionsMenu.cpp index 08585f86..f13e7683 100644 --- a/src/smw/menu/options/EyeCandyOptionsMenu.cpp +++ b/src/smw/menu/options/EyeCandyOptionsMenu.cpp @@ -14,64 +14,64 @@ extern CGameValues game_values; UI_EyeCandyOptionsMenu::UI_EyeCandyOptionsMenu() : UI_Menu() { - miSpawnStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 80, "Spawn Style", 500, 220); - miSpawnStyleField->Add("Instant", 0); - miSpawnStyleField->Add("Door", 1); - miSpawnStyleField->Add("Swirl", 2); - miSpawnStyleField->SetData(&game_values.spawnstyle, NULL, NULL); - miSpawnStyleField->SetKey(game_values.spawnstyle); - - miAwardStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Award Style", 500, 220); - miAwardStyleField->Add("None", 0); - miAwardStyleField->Add("Fireworks", 1); - miAwardStyleField->Add("Spiral", 2); - miAwardStyleField->Add("Ring", 3); - miAwardStyleField->Add("Souls", 4); - miAwardStyleField->Add("Text", 5); - miAwardStyleField->SetData(&game_values.awardstyle, NULL, NULL); - miAwardStyleField->SetKey(game_values.awardstyle); - - miScoreStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Score Location", 500, 220); - miScoreStyleField->Add("Top", 0); - miScoreStyleField->Add("Bottom", 1); - miScoreStyleField->Add("Corners", 2); - miScoreStyleField->SetData(&game_values.scoreboardstyle, NULL, NULL); - miScoreStyleField->SetKey(game_values.scoreboardstyle); - - miCrunchField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Crunch", 500, 220); - miCrunchField->Add("Off", 0); - miCrunchField->Add("On", 1, "", true, false); - miCrunchField->SetData(NULL, NULL, &game_values.screencrunch); - miCrunchField->SetKey(game_values.screencrunch ? 1 : 0); - miCrunchField->SetAutoAdvance(true); - - miWinningCrownField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Leader Crown", 500, 220); - miWinningCrownField->Add("Off", 0); - miWinningCrownField->Add("On", 1, "", true, false); - miWinningCrownField->SetData(NULL, NULL, &game_values.showwinningcrown); - miWinningCrownField->SetKey(game_values.showwinningcrown ? 1 : 0); - miWinningCrownField->SetAutoAdvance(true); - - miStartCountDownField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Start Countdown", 500, 220); - miStartCountDownField->Add("Off", 0); - miStartCountDownField->Add("On", 1, "", true, false); - miStartCountDownField->SetData(NULL, NULL, &game_values.startgamecountdown); - miStartCountDownField->SetKey(game_values.startgamecountdown ? 1 : 0); - miStartCountDownField->SetAutoAdvance(true); - - miStartModeDisplayField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Show Mode", 500, 220); - miStartModeDisplayField->Add("Off", 0); - miStartModeDisplayField->Add("On", 1, "", true, false); - miStartModeDisplayField->SetData(NULL, NULL, &game_values.startmodedisplay); - miStartModeDisplayField->SetKey(game_values.startmodedisplay ? 1 : 0); - miStartModeDisplayField->SetAutoAdvance(true); - - miDeadTeamNoticeField = new MI_SelectField(&rm->spr_selectfield, 70, 360, "Dead Team Notice", 500, 220); - miDeadTeamNoticeField->Add("Off", 0); - miDeadTeamNoticeField->Add("On", 1, "", true, false); - miDeadTeamNoticeField->SetData(NULL, NULL, &game_values.deadteamnotice); - miDeadTeamNoticeField->SetKey(game_values.deadteamnotice ? 1 : 0); - miDeadTeamNoticeField->SetAutoAdvance(true); + miSpawnStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 80, "Spawn Style", 500, 220); + miSpawnStyleField->add("Instant", 0); + miSpawnStyleField->add("Door", 1); + miSpawnStyleField->add("Swirl", 2); + miSpawnStyleField->setOutputPtr(&game_values.spawnstyle); + miSpawnStyleField->setCurrentValue(game_values.spawnstyle); + + miAwardStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 120, "Award Style", 500, 220); + miAwardStyleField->add("None", 0); + miAwardStyleField->add("Fireworks", 1); + miAwardStyleField->add("Spiral", 2); + miAwardStyleField->add("Ring", 3); + miAwardStyleField->add("Souls", 4); + miAwardStyleField->add("Text", 5); + miAwardStyleField->setOutputPtr(&game_values.awardstyle); + miAwardStyleField->setCurrentValue(game_values.awardstyle); + + miScoreStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Score Location", 500, 220); + miScoreStyleField->add("Top", 0); + miScoreStyleField->add("Bottom", 1); + miScoreStyleField->add("Corners", 2); + miScoreStyleField->setOutputPtr(&game_values.scoreboardstyle); + miScoreStyleField->setCurrentValue(game_values.scoreboardstyle); + + miCrunchField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Screen Crunch", 500, 220); + miCrunchField->add("Off", false); + miCrunchField->add("On", true); + miCrunchField->setOutputPtr(&game_values.screencrunch); + miCrunchField->setCurrentValue(game_values.screencrunch ? 1 : 0); + miCrunchField->setAutoAdvance(true); + + miWinningCrownField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 240, "Leader Crown", 500, 220); + miWinningCrownField->add("Off", false); + miWinningCrownField->add("On", true); + miWinningCrownField->setOutputPtr(&game_values.showwinningcrown); + miWinningCrownField->setCurrentValue(game_values.showwinningcrown ? 1 : 0); + miWinningCrownField->setAutoAdvance(true); + + miStartCountDownField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Start Countdown", 500, 220); + miStartCountDownField->add("Off", false); + miStartCountDownField->add("On", true); + miStartCountDownField->setOutputPtr(&game_values.startgamecountdown); + miStartCountDownField->setCurrentValue(game_values.startgamecountdown ? 1 : 0); + miStartCountDownField->setAutoAdvance(true); + + miStartModeDisplayField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 320, "Show Mode", 500, 220); + miStartModeDisplayField->add("Off", false); + miStartModeDisplayField->add("On", true); + miStartModeDisplayField->setOutputPtr(&game_values.startmodedisplay); + miStartModeDisplayField->setCurrentValue(game_values.startmodedisplay ? 1 : 0); + miStartModeDisplayField->setAutoAdvance(true); + + miDeadTeamNoticeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 360, "Dead Team Notice", 500, 220); + miDeadTeamNoticeField->add("Off", false); + miDeadTeamNoticeField->add("On", true); + miDeadTeamNoticeField->setOutputPtr(&game_values.deadteamnotice); + miDeadTeamNoticeField->setCurrentValue(game_values.deadteamnotice ? 1 : 0); + miDeadTeamNoticeField->setAutoAdvance(true); miEyeCandyOptionsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miEyeCandyOptionsMenuBackButton->SetCode(MENU_CODE_BACK_TO_OPTIONS_MENU); diff --git a/src/smw/menu/options/EyeCandyOptionsMenu.h b/src/smw/menu/options/EyeCandyOptionsMenu.h index 6e8d881d..90d5e5e5 100644 --- a/src/smw/menu/options/EyeCandyOptionsMenu.h +++ b/src/smw/menu/options/EyeCandyOptionsMenu.h @@ -4,8 +4,8 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; class UI_EyeCandyOptionsMenu : public UI_Menu { @@ -13,14 +13,14 @@ class UI_EyeCandyOptionsMenu : public UI_Menu { UI_EyeCandyOptionsMenu(); private: - MI_SelectField* miSpawnStyleField; - MI_SelectField* miAwardStyleField; - MI_SelectField* miScoreStyleField; - MI_SelectField* miCrunchField; - MI_SelectField* miWinningCrownField; - MI_SelectField* miStartCountDownField; - MI_SelectField* miStartModeDisplayField; - MI_SelectField* miDeadTeamNoticeField; + MI_SelectFieldDyn* miSpawnStyleField; + MI_SelectFieldDyn* miAwardStyleField; + MI_SelectFieldDyn* miScoreStyleField; + MI_SelectFieldDyn* miCrunchField; + MI_SelectFieldDyn* miWinningCrownField; + MI_SelectFieldDyn* miStartCountDownField; + MI_SelectFieldDyn* miStartModeDisplayField; + MI_SelectFieldDyn* miDeadTeamNoticeField; MI_Button* miEyeCandyOptionsMenuBackButton; diff --git a/src/smw/menu/options/GameplayOptionsMenu.cpp b/src/smw/menu/options/GameplayOptionsMenu.cpp index cb8b18e3..fcc6faf5 100644 --- a/src/smw/menu/options/GameplayOptionsMenu.cpp +++ b/src/smw/menu/options/GameplayOptionsMenu.cpp @@ -14,126 +14,126 @@ extern CGameValues game_values; UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() : UI_Menu() { - miRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 40, "Respawn Time", 500, 220); - miRespawnField->Add("Instant", 0); - miRespawnField->Add("0.5 Seconds", 1); - miRespawnField->Add("1.0 Seconds", 2); - miRespawnField->Add("1.5 Seconds", 3); - miRespawnField->Add("2.0 Seconds", 4); - miRespawnField->Add("2.5 Seconds", 5); - miRespawnField->Add("3.0 Seconds", 6); - miRespawnField->Add("3.5 Seconds", 7); - miRespawnField->Add("4.0 Seconds", 8); - miRespawnField->Add("4.5 Seconds", 9); - miRespawnField->Add("5.0 Seconds", 10); - miRespawnField->Add("5.5 Seconds", 11); - miRespawnField->Add("6.0 Seconds", 12); - miRespawnField->Add("6.5 Seconds", 13); - miRespawnField->Add("7.0 Seconds", 14); - miRespawnField->Add("7.5 Seconds", 15); - miRespawnField->Add("8.0 Seconds", 16); - miRespawnField->Add("8.5 Seconds", 17); - miRespawnField->Add("9.0 Seconds", 18); - miRespawnField->Add("9.5 Seconds", 19); - miRespawnField->Add("10.0 Seconds", 20); - miRespawnField->SetData(&game_values.respawn, NULL, NULL); - miRespawnField->SetKey(game_values.respawn); - - miShieldStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 80, "Shield Style", 500, 220); - miShieldStyleField->Add("No Shield", 0); - miShieldStyleField->Add("Soft", 1); - miShieldStyleField->Add("Soft with Stomp", 2); - miShieldStyleField->Add("Hard", 3); - miShieldStyleField->SetData(&game_values.shieldstyle, NULL, NULL); - miShieldStyleField->SetKey(game_values.shieldstyle); - - miShieldTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Shield Time", 500, 220); - miShieldTimeField->Add("0.5 Seconds", 31); - miShieldTimeField->Add("1.0 Seconds", 62); - miShieldTimeField->Add("1.5 Seconds", 93); - miShieldTimeField->Add("2.0 Seconds", 124); - miShieldTimeField->Add("2.5 Seconds", 155); - miShieldTimeField->Add("3.0 Seconds", 186); - miShieldTimeField->Add("3.5 Seconds", 217); - miShieldTimeField->Add("4.0 Seconds", 248); - miShieldTimeField->Add("4.5 Seconds", 279); - miShieldTimeField->Add("5.0 Seconds", 310); - miShieldTimeField->SetData(&game_values.shieldtime, NULL, NULL); - miShieldTimeField->SetKey(game_values.shieldtime); - - miBoundsTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Bounds Time", 500, 220); - miBoundsTimeField->Add("Infinite", 0); - miBoundsTimeField->Add("1 Second", 1); - miBoundsTimeField->Add("2 Seconds", 2); - miBoundsTimeField->Add("3 Seconds", 3); - miBoundsTimeField->Add("4 Seconds", 4); - miBoundsTimeField->Add("5 Seconds", 5); - miBoundsTimeField->Add("6 Seconds", 6); - miBoundsTimeField->Add("7 Seconds", 7); - miBoundsTimeField->Add("8 Seconds", 8); - miBoundsTimeField->Add("9 Seconds", 9); - miBoundsTimeField->Add("10 Seconds", 10); - miBoundsTimeField->SetData(&game_values.outofboundstime, NULL, NULL); - miBoundsTimeField->SetKey(game_values.outofboundstime); - - miSuicideTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Suicide Time", 500, 220); - miSuicideTimeField->Add("Off", 0); - miSuicideTimeField->Add("3 Seconds", 186); - miSuicideTimeField->Add("5 Seconds", 310); - miSuicideTimeField->Add("8 Seconds", 496); - miSuicideTimeField->Add("10 Seconds", 620); - miSuicideTimeField->Add("15 Seconds", 930); - miSuicideTimeField->Add("20 Seconds", 1240); - miSuicideTimeField->SetData(&game_values.suicidetime, NULL, NULL); - miSuicideTimeField->SetKey(game_values.suicidetime); - - miWarpLockStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Warp Lock Style", 500, 220); - miWarpLockStyleField->Add("Entrance Only", 0); - miWarpLockStyleField->Add("Exit Only", 1); - miWarpLockStyleField->Add("Entrance and Exit", 2); - miWarpLockStyleField->Add("Entire Connection", 3); - miWarpLockStyleField->Add("All Warps", 4); - miWarpLockStyleField->SetData(&game_values.warplockstyle, NULL, NULL); - miWarpLockStyleField->SetKey(game_values.warplockstyle); - - miWarpLockTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Warp Lock Time", 500, 220); - miWarpLockTimeField->Add("Off", 0); - miWarpLockTimeField->Add("1 Second", 62); - miWarpLockTimeField->Add("2 Seconds", 124); - miWarpLockTimeField->Add("3 Seconds", 186); - miWarpLockTimeField->Add("4 Seconds", 248); - miWarpLockTimeField->Add("5 Seconds", 310); - miWarpLockTimeField->Add("6 Seconds", 372); - miWarpLockTimeField->Add("7 Seconds", 434); - miWarpLockTimeField->Add("8 Seconds", 496); - miWarpLockTimeField->Add("9 Seconds", 558); - miWarpLockTimeField->Add("10 Seconds", 620); - miWarpLockTimeField->SetData(&game_values.warplocktime, NULL, NULL); - miWarpLockTimeField->SetKey(game_values.warplocktime); - - miBotsField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Bot Difficulty", 500, 220); - miBotsField->Add("Very Easy", 0); - miBotsField->Add("Easy", 1); - miBotsField->Add("Moderate", 2); - miBotsField->Add("Hard", 3); - miBotsField->Add("Very Hard", 4); - miBotsField->SetData(&game_values.cpudifficulty, NULL, NULL); - miBotsField->SetKey(game_values.cpudifficulty); - - miPointSpeedField = new MI_SelectField(&rm->spr_selectfield, 70, 360, "Point Speed", 500, 220); - miPointSpeedField->Add("Very Slow", 60); - miPointSpeedField->Add("Slow", 40); - miPointSpeedField->Add("Moderate", 20); - miPointSpeedField->Add("Fast", 10); - miPointSpeedField->Add("Very Fast", 5); - miPointSpeedField->SetData(&game_values.pointspeed, NULL, NULL); - miPointSpeedField->SetKey(game_values.pointspeed); - - miSecretsField = new MI_SelectField(&rm->spr_selectfield, 70, 400, "Secrets", 500, 220); - miSecretsField->Add("Off", 0); - miSecretsField->Add("On", 1, "", true, false); - miSecretsField->SetData(NULL, NULL, &game_values.secretsenabled); - miSecretsField->SetKey(game_values.secretsenabled ? 1 : 0); + miRespawnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 40, "Respawn Time", 500, 220); + miRespawnField->add("Instant", 0); + miRespawnField->add("0.5 Seconds", 1); + miRespawnField->add("1.0 Seconds", 2); + miRespawnField->add("1.5 Seconds", 3); + miRespawnField->add("2.0 Seconds", 4); + miRespawnField->add("2.5 Seconds", 5); + miRespawnField->add("3.0 Seconds", 6); + miRespawnField->add("3.5 Seconds", 7); + miRespawnField->add("4.0 Seconds", 8); + miRespawnField->add("4.5 Seconds", 9); + miRespawnField->add("5.0 Seconds", 10); + miRespawnField->add("5.5 Seconds", 11); + miRespawnField->add("6.0 Seconds", 12); + miRespawnField->add("6.5 Seconds", 13); + miRespawnField->add("7.0 Seconds", 14); + miRespawnField->add("7.5 Seconds", 15); + miRespawnField->add("8.0 Seconds", 16); + miRespawnField->add("8.5 Seconds", 17); + miRespawnField->add("9.0 Seconds", 18); + miRespawnField->add("9.5 Seconds", 19); + miRespawnField->add("10.0 Seconds", 20); + miRespawnField->setOutputPtr(&game_values.respawn); + miRespawnField->setCurrentValue(game_values.respawn); + + miShieldStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 80, "Shield Style", 500, 220); + miShieldStyleField->add("No Shield", 0); + miShieldStyleField->add("Soft", 1); + miShieldStyleField->add("Soft with Stomp", 2); + miShieldStyleField->add("Hard", 3); + miShieldStyleField->setOutputPtr(&game_values.shieldstyle); + miShieldStyleField->setCurrentValue(game_values.shieldstyle); + + miShieldTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 120, "Shield Time", 500, 220); + miShieldTimeField->add("0.5 Seconds", 31); + miShieldTimeField->add("1.0 Seconds", 62); + miShieldTimeField->add("1.5 Seconds", 93); + miShieldTimeField->add("2.0 Seconds", 124); + miShieldTimeField->add("2.5 Seconds", 155); + miShieldTimeField->add("3.0 Seconds", 186); + miShieldTimeField->add("3.5 Seconds", 217); + miShieldTimeField->add("4.0 Seconds", 248); + miShieldTimeField->add("4.5 Seconds", 279); + miShieldTimeField->add("5.0 Seconds", 310); + miShieldTimeField->setOutputPtr(&game_values.shieldtime); + miShieldTimeField->setCurrentValue(game_values.shieldtime); + + miBoundsTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Bounds Time", 500, 220); + miBoundsTimeField->add("Infinite", 0); + miBoundsTimeField->add("1 Second", 1); + miBoundsTimeField->add("2 Seconds", 2); + miBoundsTimeField->add("3 Seconds", 3); + miBoundsTimeField->add("4 Seconds", 4); + miBoundsTimeField->add("5 Seconds", 5); + miBoundsTimeField->add("6 Seconds", 6); + miBoundsTimeField->add("7 Seconds", 7); + miBoundsTimeField->add("8 Seconds", 8); + miBoundsTimeField->add("9 Seconds", 9); + miBoundsTimeField->add("10 Seconds", 10); + miBoundsTimeField->setOutputPtr(&game_values.outofboundstime); + miBoundsTimeField->setCurrentValue(game_values.outofboundstime); + + miSuicideTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Suicide Time", 500, 220); + miSuicideTimeField->add("Off", 0); + miSuicideTimeField->add("3 Seconds", 186); + miSuicideTimeField->add("5 Seconds", 310); + miSuicideTimeField->add("8 Seconds", 496); + miSuicideTimeField->add("10 Seconds", 620); + miSuicideTimeField->add("15 Seconds", 930); + miSuicideTimeField->add("20 Seconds", 1240); + miSuicideTimeField->setOutputPtr(&game_values.suicidetime); + miSuicideTimeField->setCurrentValue(game_values.suicidetime); + + miWarpLockStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 240, "Warp Lock Style", 500, 220); + miWarpLockStyleField->add("Entrance Only", 0); + miWarpLockStyleField->add("Exit Only", 1); + miWarpLockStyleField->add("Entrance and Exit", 2); + miWarpLockStyleField->add("Entire Connection", 3); + miWarpLockStyleField->add("All Warps", 4); + miWarpLockStyleField->setOutputPtr(&game_values.warplockstyle); + miWarpLockStyleField->setCurrentValue(game_values.warplockstyle); + + miWarpLockTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Warp Lock Time", 500, 220); + miWarpLockTimeField->add("Off", 0); + miWarpLockTimeField->add("1 Second", 62); + miWarpLockTimeField->add("2 Seconds", 124); + miWarpLockTimeField->add("3 Seconds", 186); + miWarpLockTimeField->add("4 Seconds", 248); + miWarpLockTimeField->add("5 Seconds", 310); + miWarpLockTimeField->add("6 Seconds", 372); + miWarpLockTimeField->add("7 Seconds", 434); + miWarpLockTimeField->add("8 Seconds", 496); + miWarpLockTimeField->add("9 Seconds", 558); + miWarpLockTimeField->add("10 Seconds", 620); + miWarpLockTimeField->setOutputPtr(&game_values.warplocktime); + miWarpLockTimeField->setCurrentValue(game_values.warplocktime); + + miBotsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 320, "Bot Difficulty", 500, 220); + miBotsField->add("Very Easy", 0); + miBotsField->add("Easy", 1); + miBotsField->add("Moderate", 2); + miBotsField->add("Hard", 3); + miBotsField->add("Very Hard", 4); + miBotsField->setOutputPtr(&game_values.cpudifficulty); + miBotsField->setCurrentValue(game_values.cpudifficulty); + + miPointSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 360, "Point Speed", 500, 220); + miPointSpeedField->add("Very Slow", 60); + miPointSpeedField->add("Slow", 40); + miPointSpeedField->add("Moderate", 20); + miPointSpeedField->add("Fast", 10); + miPointSpeedField->add("Very Fast", 5); + miPointSpeedField->setOutputPtr(&game_values.pointspeed); + miPointSpeedField->setCurrentValue(game_values.pointspeed); + + miSecretsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 400, "Secrets", 500, 220); + miSecretsField->add("Off", false); + miSecretsField->add("On", true); + miSecretsField->setOutputPtr(&game_values.secretsenabled); + miSecretsField->setCurrentValue(game_values.secretsenabled ? 1 : 0); miGameplayOptionsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miGameplayOptionsMenuBackButton->SetCode(MENU_CODE_BACK_TO_OPTIONS_MENU); diff --git a/src/smw/menu/options/GameplayOptionsMenu.h b/src/smw/menu/options/GameplayOptionsMenu.h index 239bd916..527b1c4e 100644 --- a/src/smw/menu/options/GameplayOptionsMenu.h +++ b/src/smw/menu/options/GameplayOptionsMenu.h @@ -4,8 +4,8 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; /* This menu is where you can change various gameplay-related @@ -16,16 +16,16 @@ class UI_GameplayOptionsMenu : public UI_Menu { UI_GameplayOptionsMenu(); private: - MI_SelectField* miRespawnField; - MI_SelectField* miShieldStyleField; - MI_SelectField* miShieldTimeField; - MI_SelectField* miBoundsTimeField; - MI_SelectField* miSuicideTimeField; - MI_SelectField* miWarpLockStyleField; - MI_SelectField* miWarpLockTimeField; - MI_SelectField* miBotsField; - MI_SelectField* miPointSpeedField; - MI_SelectField* miSecretsField; + MI_SelectFieldDyn* miRespawnField; + MI_SelectFieldDyn* miShieldStyleField; + MI_SelectFieldDyn* miShieldTimeField; + MI_SelectFieldDyn* miBoundsTimeField; + MI_SelectFieldDyn* miSuicideTimeField; + MI_SelectFieldDyn* miWarpLockStyleField; + MI_SelectFieldDyn* miWarpLockTimeField; + MI_SelectFieldDyn* miBotsField; + MI_SelectFieldDyn* miPointSpeedField; + MI_SelectFieldDyn* miSecretsField; MI_Button* miGameplayOptionsMenuBackButton; MI_Image* miGameplayOptionsMenuLeftHeaderBar; diff --git a/src/smw/menu/options/GraphicsOptionsMenu.cpp b/src/smw/menu/options/GraphicsOptionsMenu.cpp index af350ca5..a7a82780 100644 --- a/src/smw/menu/options/GraphicsOptionsMenu.cpp +++ b/src/smw/menu/options/GraphicsOptionsMenu.cpp @@ -19,54 +19,54 @@ extern GraphicsList* gamegraphicspacklist; UI_GraphicsOptionsMenu::UI_GraphicsOptionsMenu() : UI_Menu() { - miTopLayerField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Draw Top Layer", 500, 220); - miTopLayerField->Add("Background", 0); - miTopLayerField->Add("Foreground", 1, "", true, false); - miTopLayerField->SetData(NULL, NULL, &game_values.toplayer); - miTopLayerField->SetKey(game_values.toplayer ? 1 : 0); - miTopLayerField->SetAutoAdvance(true); + miTopLayerField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 120, "Draw Top Layer", 500, 220); + miTopLayerField->add("Background", false); + miTopLayerField->add("Foreground", true); + miTopLayerField->setOutputPtr(&game_values.toplayer); + miTopLayerField->setCurrentValue(game_values.toplayer ? 1 : 0); + miTopLayerField->setAutoAdvance(true); - miFrameLimiterField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Frame Limit", 500, 220); - miFrameLimiterField->Add("10 FPS", 100); - miFrameLimiterField->Add("15 FPS", 67); - miFrameLimiterField->Add("20 FPS", 50); - miFrameLimiterField->Add("25 FPS", 40); - miFrameLimiterField->Add("30 FPS", 33); - miFrameLimiterField->Add("35 FPS", 28); - miFrameLimiterField->Add("40 FPS", 25); - miFrameLimiterField->Add("45 FPS", 22); - miFrameLimiterField->Add("50 FPS", 20); - miFrameLimiterField->Add("55 FPS", 18); - miFrameLimiterField->Add("62 FPS (Normal)", 16); - miFrameLimiterField->Add("66 FPS", 15); - miFrameLimiterField->Add("71 FPS", 14); - miFrameLimiterField->Add("77 FPS", 13); - miFrameLimiterField->Add("83 FPS", 12); - miFrameLimiterField->Add("90 FPS", 11); - miFrameLimiterField->Add("100 FPS", 10); - miFrameLimiterField->Add("111 FPS", 9); - miFrameLimiterField->Add("125 FPS", 8); - miFrameLimiterField->Add("142 FPS", 7); - miFrameLimiterField->Add("166 FPS", 6); - miFrameLimiterField->Add("200 FPS", 5); - miFrameLimiterField->Add("250 FPS", 4); - miFrameLimiterField->Add("333 FPS", 3); - miFrameLimiterField->Add("500 FPS", 2); - miFrameLimiterField->Add("No Limit", 0); - miFrameLimiterField->SetData(&game_values.framelimiter, NULL, NULL); - miFrameLimiterField->SetKey(game_values.framelimiter); + miFrameLimiterField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Frame Limit", 500, 220); + miFrameLimiterField->add("10 FPS", 100); + miFrameLimiterField->add("15 FPS", 67); + miFrameLimiterField->add("20 FPS", 50); + miFrameLimiterField->add("25 FPS", 40); + miFrameLimiterField->add("30 FPS", 33); + miFrameLimiterField->add("35 FPS", 28); + miFrameLimiterField->add("40 FPS", 25); + miFrameLimiterField->add("45 FPS", 22); + miFrameLimiterField->add("50 FPS", 20); + miFrameLimiterField->add("55 FPS", 18); + miFrameLimiterField->add("62 FPS (Normal)", 16); + miFrameLimiterField->add("66 FPS", 15); + miFrameLimiterField->add("71 FPS", 14); + miFrameLimiterField->add("77 FPS", 13); + miFrameLimiterField->add("83 FPS", 12); + miFrameLimiterField->add("90 FPS", 11); + miFrameLimiterField->add("100 FPS", 10); + miFrameLimiterField->add("111 FPS", 9); + miFrameLimiterField->add("125 FPS", 8); + miFrameLimiterField->add("142 FPS", 7); + miFrameLimiterField->add("166 FPS", 6); + miFrameLimiterField->add("200 FPS", 5); + miFrameLimiterField->add("250 FPS", 4); + miFrameLimiterField->add("333 FPS", 3); + miFrameLimiterField->add("500 FPS", 2); + miFrameLimiterField->add("No Limit", 0); + miFrameLimiterField->setOutputPtr(&game_values.framelimiter); + miFrameLimiterField->setCurrentValue(game_values.framelimiter); #ifdef _XBOX miScreenSettingsButton = new MI_Button(&rm->spr_selectfield, 70, 200, "Screen Settings", 500, 0); miScreenSettingsButton->SetCode(MENU_CODE_TO_SCREEN_SETTINGS); #else - miFullscreenField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Size", 500, 220); - miFullscreenField->Add("Windowed", 0); - miFullscreenField->Add("Fullscreen", 1, "", true, false); - miFullscreenField->SetData(NULL, NULL, &game_values.fullscreen); - miFullscreenField->SetKey(game_values.fullscreen ? 1 : 0); - miFullscreenField->SetAutoAdvance(true); - miFullscreenField->SetItemChangedCode(MENU_CODE_TOGGLE_FULLSCREEN); + miFullscreenField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Screen Size", 500, 220); + miFullscreenField->add("Windowed", false); + miFullscreenField->add("Fullscreen", true); + miFullscreenField->setOutputPtr(&game_values.fullscreen); + miFullscreenField->setCurrentValue(game_values.fullscreen ? 1 : 0); + miFullscreenField->setAutoAdvance(true); + miFullscreenField->setItemChangedCode(MENU_CODE_TOGGLE_FULLSCREEN); #endif //_XBOX miMenuGraphicsPackField = new MI_PacksField(&rm->spr_selectfield, 70, 240, "Menu Graphics", 500, 220, menugraphicspacklist, MENU_CODE_MENU_GRAPHICS_PACK_CHANGED); diff --git a/src/smw/menu/options/GraphicsOptionsMenu.h b/src/smw/menu/options/GraphicsOptionsMenu.h index 3ff9ce98..7ba98948 100644 --- a/src/smw/menu/options/GraphicsOptionsMenu.h +++ b/src/smw/menu/options/GraphicsOptionsMenu.h @@ -5,8 +5,8 @@ class MI_Button; class MI_Image; class MI_PacksField; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; /* @@ -18,13 +18,13 @@ class UI_GraphicsOptionsMenu : public UI_Menu { UI_GraphicsOptionsMenu(); private: - MI_SelectField* miTopLayerField; - MI_SelectField* miFrameLimiterField; + MI_SelectFieldDyn* miTopLayerField; + MI_SelectFieldDyn* miFrameLimiterField; #ifdef _XBOX MI_Button* miScreenSettingsButton; #else - MI_SelectField* miFullscreenField; + MI_SelectFieldDyn* miFullscreenField; #endif //_XBOX MI_PacksField* miMenuGraphicsPackField; diff --git a/src/smw/menu/options/PowerupSettingsMenu.cpp b/src/smw/menu/options/PowerupSettingsMenu.cpp index ed3b308d..7ddb95f5 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.cpp +++ b/src/smw/menu/options/PowerupSettingsMenu.cpp @@ -15,69 +15,69 @@ extern CGameValues game_values; UI_PowerupSettingsMenu::UI_PowerupSettingsMenu() : UI_Menu() { - miStoredPowerupDelayField = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Item Use Speed", 500, 220); - miStoredPowerupDelayField->Add("Very Slow", 2); - miStoredPowerupDelayField->Add("Slow", 3); - miStoredPowerupDelayField->Add("Moderate", 4); - miStoredPowerupDelayField->Add("Fast", 5); - miStoredPowerupDelayField->Add("Very Fast", 6); - miStoredPowerupDelayField->SetData(&game_values.storedpowerupdelay, NULL, NULL); - miStoredPowerupDelayField->SetKey(game_values.storedpowerupdelay); - - miItemRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Item Spawn", 500, 220); - miItemRespawnField->Add("Off", 0); - miItemRespawnField->Add("5 Seconds", 310); - miItemRespawnField->Add("10 Seconds", 620); - miItemRespawnField->Add("15 Seconds", 930); - miItemRespawnField->Add("20 Seconds", 1240); - miItemRespawnField->Add("25 Seconds", 1550); - miItemRespawnField->Add("30 Seconds", 1860); - miItemRespawnField->Add("35 Seconds", 2170); - miItemRespawnField->Add("40 Seconds", 2480); - miItemRespawnField->Add("45 Seconds", 2790); - miItemRespawnField->Add("50 Seconds", 3100); - miItemRespawnField->Add("55 Seconds", 3410); - miItemRespawnField->Add("60 Seconds", 3720); - miItemRespawnField->SetData(&game_values.itemrespawntime, NULL, NULL); - miItemRespawnField->SetKey(game_values.itemrespawntime); - - miHiddenBlockRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Hidden Block Hide", 500, 220); - miHiddenBlockRespawnField->Add("Off", 0); - miHiddenBlockRespawnField->Add("5 Seconds", 310); - miHiddenBlockRespawnField->Add("10 Seconds", 620); - miHiddenBlockRespawnField->Add("15 Seconds", 930); - miHiddenBlockRespawnField->Add("20 Seconds", 1240); - miHiddenBlockRespawnField->Add("25 Seconds", 1550); - miHiddenBlockRespawnField->Add("30 Seconds", 1860); - miHiddenBlockRespawnField->Add("35 Seconds", 2170); - miHiddenBlockRespawnField->Add("40 Seconds", 2480); - miHiddenBlockRespawnField->Add("45 Seconds", 2790); - miHiddenBlockRespawnField->Add("50 Seconds", 3100); - miHiddenBlockRespawnField->Add("55 Seconds", 3410); - miHiddenBlockRespawnField->Add("60 Seconds", 3720); - miHiddenBlockRespawnField->SetData(&game_values.hiddenblockrespawn, NULL, NULL); - miHiddenBlockRespawnField->SetKey(game_values.hiddenblockrespawn); - - miSwapStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Swap Style", 500, 220); - miSwapStyleField->Add("Walk", 0); - miSwapStyleField->Add("Blink", 1); - miSwapStyleField->Add("Instant", 2); - miSwapStyleField->SetData(&game_values.swapstyle, NULL, NULL); - miSwapStyleField->SetKey(game_values.swapstyle); - - miBonusWheelField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "Bonus Wheel", 500, 220); - miBonusWheelField->Add("Off", 0); - miBonusWheelField->Add("Tournament Win", 1); - miBonusWheelField->Add("Every Game", 2); - miBonusWheelField->SetData(&game_values.bonuswheel, NULL, NULL); - miBonusWheelField->SetKey(game_values.bonuswheel); - - miKeepPowerupField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "Bonus Item", 500, 220); - miKeepPowerupField->Add("Until Next Spin", 0); - miKeepPowerupField->Add("Keep Always", 1, "", true, false); - miKeepPowerupField->SetData(NULL, NULL, &game_values.keeppowerup); - miKeepPowerupField->SetKey(game_values.keeppowerup ? 1 : 0); - miKeepPowerupField->SetAutoAdvance(true); + miStoredPowerupDelayField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Item Use Speed", 500, 220); + miStoredPowerupDelayField->add("Very Slow", 2); + miStoredPowerupDelayField->add("Slow", 3); + miStoredPowerupDelayField->add("Moderate", 4); + miStoredPowerupDelayField->add("Fast", 5); + miStoredPowerupDelayField->add("Very Fast", 6); + miStoredPowerupDelayField->setOutputPtr(&game_values.storedpowerupdelay); + miStoredPowerupDelayField->setCurrentValue(game_values.storedpowerupdelay); + + miItemRespawnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 140, "Item Spawn", 500, 220); + miItemRespawnField->add("Off", 0); + miItemRespawnField->add("5 Seconds", 310); + miItemRespawnField->add("10 Seconds", 620); + miItemRespawnField->add("15 Seconds", 930); + miItemRespawnField->add("20 Seconds", 1240); + miItemRespawnField->add("25 Seconds", 1550); + miItemRespawnField->add("30 Seconds", 1860); + miItemRespawnField->add("35 Seconds", 2170); + miItemRespawnField->add("40 Seconds", 2480); + miItemRespawnField->add("45 Seconds", 2790); + miItemRespawnField->add("50 Seconds", 3100); + miItemRespawnField->add("55 Seconds", 3410); + miItemRespawnField->add("60 Seconds", 3720); + miItemRespawnField->setOutputPtr(&game_values.itemrespawntime); + miItemRespawnField->setCurrentValue(game_values.itemrespawntime); + + miHiddenBlockRespawnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Hidden Block Hide", 500, 220); + miHiddenBlockRespawnField->add("Off", 0); + miHiddenBlockRespawnField->add("5 Seconds", 310); + miHiddenBlockRespawnField->add("10 Seconds", 620); + miHiddenBlockRespawnField->add("15 Seconds", 930); + miHiddenBlockRespawnField->add("20 Seconds", 1240); + miHiddenBlockRespawnField->add("25 Seconds", 1550); + miHiddenBlockRespawnField->add("30 Seconds", 1860); + miHiddenBlockRespawnField->add("35 Seconds", 2170); + miHiddenBlockRespawnField->add("40 Seconds", 2480); + miHiddenBlockRespawnField->add("45 Seconds", 2790); + miHiddenBlockRespawnField->add("50 Seconds", 3100); + miHiddenBlockRespawnField->add("55 Seconds", 3410); + miHiddenBlockRespawnField->add("60 Seconds", 3720); + miHiddenBlockRespawnField->setOutputPtr(&game_values.hiddenblockrespawn); + miHiddenBlockRespawnField->setCurrentValue(game_values.hiddenblockrespawn); + + miSwapStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 220, "Swap Style", 500, 220); + miSwapStyleField->add("Walk", 0); + miSwapStyleField->add("Blink", 1); + miSwapStyleField->add("Instant", 2); + miSwapStyleField->setOutputPtr(&game_values.swapstyle); + miSwapStyleField->setCurrentValue(game_values.swapstyle); + + miBonusWheelField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 260, "Bonus Wheel", 500, 220); + miBonusWheelField->add("Off", 0); + miBonusWheelField->add("Tournament Win", 1); + miBonusWheelField->add("Every Game", 2); + miBonusWheelField->setOutputPtr(&game_values.bonuswheel); + miBonusWheelField->setCurrentValue(game_values.bonuswheel); + + miKeepPowerupField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 300, "Bonus Item", 500, 220); + miKeepPowerupField->add("Until Next Spin", false); + miKeepPowerupField->add("Keep Always", true); + miKeepPowerupField->setOutputPtr(&game_values.keeppowerup); + miKeepPowerupField->setCurrentValue(game_values.keeppowerup ? 1 : 0); + miKeepPowerupField->setAutoAdvance(true); miStoredPowerupResetButton = new MI_StoredPowerupResetButton(&rm->spr_selectfield, 70, 340, "Reset Stored Items", 500); miStoredPowerupResetButton->SetCode(MENU_CODE_RESET_STORED_POWERUPS); diff --git a/src/smw/menu/options/PowerupSettingsMenu.h b/src/smw/menu/options/PowerupSettingsMenu.h index ce570bd2..58a5d71c 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.h +++ b/src/smw/menu/options/PowerupSettingsMenu.h @@ -4,9 +4,9 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_StoredPowerupResetButton; class MI_Text; +template class MI_SelectFieldDyn; /* In this menu, you can change some powerup settings, @@ -17,12 +17,12 @@ class UI_PowerupSettingsMenu : public UI_Menu { UI_PowerupSettingsMenu(); private: - MI_SelectField* miStoredPowerupDelayField = nullptr; - MI_SelectField* miItemRespawnField = nullptr; - MI_SelectField* miSwapStyleField = nullptr; - MI_SelectField* miBonusWheelField = nullptr; - MI_SelectField* miKeepPowerupField = nullptr; - MI_SelectField* miHiddenBlockRespawnField = nullptr; + MI_SelectFieldDyn* miStoredPowerupDelayField = nullptr; + MI_SelectFieldDyn* miItemRespawnField = nullptr; + MI_SelectFieldDyn* miSwapStyleField = nullptr; + MI_SelectFieldDyn* miBonusWheelField = nullptr; + MI_SelectFieldDyn* miKeepPowerupField = nullptr; + MI_SelectFieldDyn* miHiddenBlockRespawnField = nullptr; MI_StoredPowerupResetButton* miStoredPowerupResetButton = nullptr; MI_Button* miPowerupSettingsMenuBackButton = nullptr; diff --git a/src/smw/menu/options/ProjectileLimitsMenu.cpp b/src/smw/menu/options/ProjectileLimitsMenu.cpp index f1ecfe13..1c863562 100644 --- a/src/smw/menu/options/ProjectileLimitsMenu.cpp +++ b/src/smw/menu/options/ProjectileLimitsMenu.cpp @@ -14,149 +14,149 @@ extern CGameValues game_values; UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() : UI_Menu() { - miFireballLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 60, "Fireball Limit", 500, 220); - miFireballLimitField->Add("Unlimited", 0); - miFireballLimitField->Add("2", 2); - miFireballLimitField->Add("5", 5); - miFireballLimitField->Add("8", 8); - miFireballLimitField->Add("10", 10); - miFireballLimitField->Add("12", 12); - miFireballLimitField->Add("15", 15); - miFireballLimitField->Add("20", 20); - miFireballLimitField->Add("25", 25); - miFireballLimitField->Add("30", 30); - miFireballLimitField->Add("40", 40); - miFireballLimitField->Add("50", 50); - miFireballLimitField->SetData(&game_values.fireballlimit, NULL, NULL); - miFireballLimitField->SetKey(game_values.fireballlimit); - - miHammerLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Hammer Limit", 500, 220); - miHammerLimitField->Add("Unlimited", 0); - miHammerLimitField->Add("2", 2); - miHammerLimitField->Add("5", 5); - miHammerLimitField->Add("8", 8); - miHammerLimitField->Add("10", 10); - miHammerLimitField->Add("12", 12); - miHammerLimitField->Add("15", 15); - miHammerLimitField->Add("20", 20); - miHammerLimitField->Add("25", 25); - miHammerLimitField->Add("30", 30); - miHammerLimitField->Add("40", 40); - miHammerLimitField->Add("50", 50); - miHammerLimitField->SetData(&game_values.hammerlimit, NULL, NULL); - miHammerLimitField->SetKey(game_values.hammerlimit); - - miBoomerangLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Boomerang Limit", 500, 220); - miBoomerangLimitField->Add("Unlimited", 0); - miBoomerangLimitField->Add("2", 2); - miBoomerangLimitField->Add("5", 5); - miBoomerangLimitField->Add("8", 8); - miBoomerangLimitField->Add("10", 10); - miBoomerangLimitField->Add("12", 12); - miBoomerangLimitField->Add("15", 15); - miBoomerangLimitField->Add("20", 20); - miBoomerangLimitField->Add("25", 25); - miBoomerangLimitField->Add("30", 30); - miBoomerangLimitField->Add("40", 40); - miBoomerangLimitField->Add("50", 50); - miBoomerangLimitField->SetData(&game_values.boomeranglimit, NULL, NULL); - miBoomerangLimitField->SetKey(game_values.boomeranglimit); - - miFeatherLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Feather Limit", 500, 220); - miFeatherLimitField->Add("Unlimited", 0); - miFeatherLimitField->Add("2", 2); - miFeatherLimitField->Add("5", 5); - miFeatherLimitField->Add("8", 8); - miFeatherLimitField->Add("10", 10); - miFeatherLimitField->Add("12", 12); - miFeatherLimitField->Add("15", 15); - miFeatherLimitField->Add("20", 20); - miFeatherLimitField->Add("25", 25); - miFeatherLimitField->Add("30", 30); - miFeatherLimitField->Add("40", 40); - miFeatherLimitField->Add("50", 50); - miFeatherLimitField->SetData(&game_values.featherlimit, NULL, NULL); - miFeatherLimitField->SetKey(game_values.featherlimit); - - miLeafLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Leaf Limit", 500, 220); - miLeafLimitField->Add("Unlimited", 0); - miLeafLimitField->Add("2", 2); - miLeafLimitField->Add("5", 5); - miLeafLimitField->Add("8", 8); - miLeafLimitField->Add("10", 10); - miLeafLimitField->Add("12", 12); - miLeafLimitField->Add("15", 15); - miLeafLimitField->Add("20", 20); - miLeafLimitField->Add("25", 25); - miLeafLimitField->Add("30", 30); - miLeafLimitField->Add("40", 40); - miLeafLimitField->Add("50", 50); - miLeafLimitField->SetData(&game_values.leaflimit, NULL, NULL); - miLeafLimitField->SetKey(game_values.leaflimit); - - miPwingsLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "P-Wings Limit", 500, 220); - miPwingsLimitField->Add("Unlimited", 0); - miPwingsLimitField->Add("2", 2); - miPwingsLimitField->Add("5", 5); - miPwingsLimitField->Add("8", 8); - miPwingsLimitField->Add("10", 10); - miPwingsLimitField->Add("12", 12); - miPwingsLimitField->Add("15", 15); - miPwingsLimitField->Add("20", 20); - miPwingsLimitField->Add("25", 25); - miPwingsLimitField->Add("30", 30); - miPwingsLimitField->Add("40", 40); - miPwingsLimitField->Add("50", 50); - miPwingsLimitField->SetData(&game_values.pwingslimit, NULL, NULL); - miPwingsLimitField->SetKey(game_values.pwingslimit); - - miTanookiLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "Tanooki Limit", 500, 220); - miTanookiLimitField->Add("Unlimited", 0); - miTanookiLimitField->Add("2", 2); - miTanookiLimitField->Add("5", 5); - miTanookiLimitField->Add("8", 8); - miTanookiLimitField->Add("10", 10); - miTanookiLimitField->Add("12", 12); - miTanookiLimitField->Add("15", 15); - miTanookiLimitField->Add("20", 20); - miTanookiLimitField->Add("25", 25); - miTanookiLimitField->Add("30", 30); - miTanookiLimitField->Add("40", 40); - miTanookiLimitField->Add("50", 50); - miTanookiLimitField->SetData(&game_values.tanookilimit, NULL, NULL); - miTanookiLimitField->SetKey(game_values.tanookilimit); - - miBombLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 340, "Bomb Limit", 500, 220); - miBombLimitField->Add("Unlimited", 0); - miBombLimitField->Add("2", 2); - miBombLimitField->Add("5", 5); - miBombLimitField->Add("8", 8); - miBombLimitField->Add("10", 10); - miBombLimitField->Add("12", 12); - miBombLimitField->Add("15", 15); - miBombLimitField->Add("20", 20); - miBombLimitField->Add("25", 25); - miBombLimitField->Add("30", 30); - miBombLimitField->Add("40", 40); - miBombLimitField->Add("50", 50); - miBombLimitField->SetData(&game_values.bombslimit, NULL, NULL); - miBombLimitField->SetKey(game_values.bombslimit); - - miWandLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 380, "Wand Limit", 500, 220); - miWandLimitField->Add("Unlimited", 0); - miWandLimitField->Add("2", 2); - miWandLimitField->Add("5", 5); - miWandLimitField->Add("8", 8); - miWandLimitField->Add("10", 10); - miWandLimitField->Add("12", 12); - miWandLimitField->Add("15", 15); - miWandLimitField->Add("20", 20); - miWandLimitField->Add("25", 25); - miWandLimitField->Add("30", 30); - miWandLimitField->Add("40", 40); - miWandLimitField->Add("50", 50); - miWandLimitField->SetData(&game_values.wandlimit, NULL, NULL); - miWandLimitField->SetKey(game_values.wandlimit); + miFireballLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 60, "Fireball Limit", 500, 220); + miFireballLimitField->add("Unlimited", 0); + miFireballLimitField->add("2", 2); + miFireballLimitField->add("5", 5); + miFireballLimitField->add("8", 8); + miFireballLimitField->add("10", 10); + miFireballLimitField->add("12", 12); + miFireballLimitField->add("15", 15); + miFireballLimitField->add("20", 20); + miFireballLimitField->add("25", 25); + miFireballLimitField->add("30", 30); + miFireballLimitField->add("40", 40); + miFireballLimitField->add("50", 50); + miFireballLimitField->setOutputPtr(&game_values.fireballlimit); + miFireballLimitField->setCurrentValue(game_values.fireballlimit); + + miHammerLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Hammer Limit", 500, 220); + miHammerLimitField->add("Unlimited", 0); + miHammerLimitField->add("2", 2); + miHammerLimitField->add("5", 5); + miHammerLimitField->add("8", 8); + miHammerLimitField->add("10", 10); + miHammerLimitField->add("12", 12); + miHammerLimitField->add("15", 15); + miHammerLimitField->add("20", 20); + miHammerLimitField->add("25", 25); + miHammerLimitField->add("30", 30); + miHammerLimitField->add("40", 40); + miHammerLimitField->add("50", 50); + miHammerLimitField->setOutputPtr(&game_values.hammerlimit); + miHammerLimitField->setCurrentValue(game_values.hammerlimit); + + miBoomerangLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 140, "Boomerang Limit", 500, 220); + miBoomerangLimitField->add("Unlimited", 0); + miBoomerangLimitField->add("2", 2); + miBoomerangLimitField->add("5", 5); + miBoomerangLimitField->add("8", 8); + miBoomerangLimitField->add("10", 10); + miBoomerangLimitField->add("12", 12); + miBoomerangLimitField->add("15", 15); + miBoomerangLimitField->add("20", 20); + miBoomerangLimitField->add("25", 25); + miBoomerangLimitField->add("30", 30); + miBoomerangLimitField->add("40", 40); + miBoomerangLimitField->add("50", 50); + miBoomerangLimitField->setOutputPtr(&game_values.boomeranglimit); + miBoomerangLimitField->setCurrentValue(game_values.boomeranglimit); + + miFeatherLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Feather Limit", 500, 220); + miFeatherLimitField->add("Unlimited", 0); + miFeatherLimitField->add("2", 2); + miFeatherLimitField->add("5", 5); + miFeatherLimitField->add("8", 8); + miFeatherLimitField->add("10", 10); + miFeatherLimitField->add("12", 12); + miFeatherLimitField->add("15", 15); + miFeatherLimitField->add("20", 20); + miFeatherLimitField->add("25", 25); + miFeatherLimitField->add("30", 30); + miFeatherLimitField->add("40", 40); + miFeatherLimitField->add("50", 50); + miFeatherLimitField->setOutputPtr(&game_values.featherlimit); + miFeatherLimitField->setCurrentValue(game_values.featherlimit); + + miLeafLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 220, "Leaf Limit", 500, 220); + miLeafLimitField->add("Unlimited", 0); + miLeafLimitField->add("2", 2); + miLeafLimitField->add("5", 5); + miLeafLimitField->add("8", 8); + miLeafLimitField->add("10", 10); + miLeafLimitField->add("12", 12); + miLeafLimitField->add("15", 15); + miLeafLimitField->add("20", 20); + miLeafLimitField->add("25", 25); + miLeafLimitField->add("30", 30); + miLeafLimitField->add("40", 40); + miLeafLimitField->add("50", 50); + miLeafLimitField->setOutputPtr(&game_values.leaflimit); + miLeafLimitField->setCurrentValue(game_values.leaflimit); + + miPwingsLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 260, "P-Wings Limit", 500, 220); + miPwingsLimitField->add("Unlimited", 0); + miPwingsLimitField->add("2", 2); + miPwingsLimitField->add("5", 5); + miPwingsLimitField->add("8", 8); + miPwingsLimitField->add("10", 10); + miPwingsLimitField->add("12", 12); + miPwingsLimitField->add("15", 15); + miPwingsLimitField->add("20", 20); + miPwingsLimitField->add("25", 25); + miPwingsLimitField->add("30", 30); + miPwingsLimitField->add("40", 40); + miPwingsLimitField->add("50", 50); + miPwingsLimitField->setOutputPtr(&game_values.pwingslimit); + miPwingsLimitField->setCurrentValue(game_values.pwingslimit); + + miTanookiLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 300, "Tanooki Limit", 500, 220); + miTanookiLimitField->add("Unlimited", 0); + miTanookiLimitField->add("2", 2); + miTanookiLimitField->add("5", 5); + miTanookiLimitField->add("8", 8); + miTanookiLimitField->add("10", 10); + miTanookiLimitField->add("12", 12); + miTanookiLimitField->add("15", 15); + miTanookiLimitField->add("20", 20); + miTanookiLimitField->add("25", 25); + miTanookiLimitField->add("30", 30); + miTanookiLimitField->add("40", 40); + miTanookiLimitField->add("50", 50); + miTanookiLimitField->setOutputPtr(&game_values.tanookilimit); + miTanookiLimitField->setCurrentValue(game_values.tanookilimit); + + miBombLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 340, "Bomb Limit", 500, 220); + miBombLimitField->add("Unlimited", 0); + miBombLimitField->add("2", 2); + miBombLimitField->add("5", 5); + miBombLimitField->add("8", 8); + miBombLimitField->add("10", 10); + miBombLimitField->add("12", 12); + miBombLimitField->add("15", 15); + miBombLimitField->add("20", 20); + miBombLimitField->add("25", 25); + miBombLimitField->add("30", 30); + miBombLimitField->add("40", 40); + miBombLimitField->add("50", 50); + miBombLimitField->setOutputPtr(&game_values.bombslimit); + miBombLimitField->setCurrentValue(game_values.bombslimit); + + miWandLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 380, "Wand Limit", 500, 220); + miWandLimitField->add("Unlimited", 0); + miWandLimitField->add("2", 2); + miWandLimitField->add("5", 5); + miWandLimitField->add("8", 8); + miWandLimitField->add("10", 10); + miWandLimitField->add("12", 12); + miWandLimitField->add("15", 15); + miWandLimitField->add("20", 20); + miWandLimitField->add("25", 25); + miWandLimitField->add("30", 30); + miWandLimitField->add("40", 40); + miWandLimitField->add("50", 50); + miWandLimitField->setOutputPtr(&game_values.wandlimit); + miWandLimitField->setCurrentValue(game_values.wandlimit); miProjectilesLimitsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miProjectilesLimitsMenuBackButton->SetCode(MENU_CODE_BACK_TO_OPTIONS_MENU); diff --git a/src/smw/menu/options/ProjectileLimitsMenu.h b/src/smw/menu/options/ProjectileLimitsMenu.h index 5f83835b..9bfe03a1 100644 --- a/src/smw/menu/options/ProjectileLimitsMenu.h +++ b/src/smw/menu/options/ProjectileLimitsMenu.h @@ -4,8 +4,8 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; /* You can set the maximum number of uses of certain @@ -16,15 +16,15 @@ class UI_ProjectileLimitsMenu : public UI_Menu { UI_ProjectileLimitsMenu(); private: - MI_SelectField* miFireballLimitField; - MI_SelectField* miHammerLimitField; - MI_SelectField* miBoomerangLimitField; - MI_SelectField* miFeatherLimitField; - MI_SelectField* miLeafLimitField; - MI_SelectField* miPwingsLimitField; - MI_SelectField* miTanookiLimitField; - MI_SelectField* miBombLimitField; - MI_SelectField* miWandLimitField; + MI_SelectFieldDyn* miFireballLimitField; + MI_SelectFieldDyn* miHammerLimitField; + MI_SelectFieldDyn* miBoomerangLimitField; + MI_SelectFieldDyn* miFeatherLimitField; + MI_SelectFieldDyn* miLeafLimitField; + MI_SelectFieldDyn* miPwingsLimitField; + MI_SelectFieldDyn* miTanookiLimitField; + MI_SelectFieldDyn* miBombLimitField; + MI_SelectFieldDyn* miWandLimitField; MI_Button* miProjectilesLimitsMenuBackButton; diff --git a/src/smw/menu/options/ProjectileOptionsMenu.cpp b/src/smw/menu/options/ProjectileOptionsMenu.cpp index c25a5086..a533ceb3 100644 --- a/src/smw/menu/options/ProjectileOptionsMenu.cpp +++ b/src/smw/menu/options/ProjectileOptionsMenu.cpp @@ -14,179 +14,179 @@ extern CGameValues game_values; UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() : UI_Menu() { - miFireballLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 80, "Life", 305, 120); - miFireballLifeField->Add("1 Second", 62); - miFireballLifeField->Add("2 Seconds", 124); - miFireballLifeField->Add("3 Seconds", 186); - miFireballLifeField->Add("4 Seconds", 248); - miFireballLifeField->Add("5 Seconds", 310); - miFireballLifeField->Add("6 Seconds", 372); - miFireballLifeField->Add("7 Seconds", 434); - miFireballLifeField->Add("8 Seconds", 496); - miFireballLifeField->Add("9 Seconds", 558); - miFireballLifeField->Add("10 Seconds", 620); - miFireballLifeField->SetData(&game_values.fireballttl, NULL, NULL); - miFireballLifeField->SetKey(game_values.fireballttl); - - miFeatherJumpsField = new MI_SelectField(&rm->spr_selectfield, 10, 150, "Jumps", 305, 120); - miFeatherJumpsField->Add("1", 1); - miFeatherJumpsField->Add("2", 2); - miFeatherJumpsField->Add("3", 3); - miFeatherJumpsField->Add("4", 4); - miFeatherJumpsField->Add("5", 5); - miFeatherJumpsField->SetData(&game_values.featherjumps, NULL, NULL); - miFeatherJumpsField->SetKey(game_values.featherjumps); - - miBoomerangStyleField = new MI_SelectField(&rm->spr_selectfield, 10, 220, "Style", 305, 120); - miBoomerangStyleField->Add("Flat", 0); - miBoomerangStyleField->Add("SMB3", 1); - miBoomerangStyleField->Add("Zelda", 2); - miBoomerangStyleField->Add("Random", 3); - miBoomerangStyleField->SetData(&game_values.boomerangstyle, NULL, NULL); - miBoomerangStyleField->SetKey(game_values.boomerangstyle); - - miBoomerangLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 260, "Life", 305, 120); - miBoomerangLifeField->Add("1 Second", 62); - miBoomerangLifeField->Add("2 Seconds", 124); - miBoomerangLifeField->Add("3 Seconds", 186); - miBoomerangLifeField->Add("4 Seconds", 248); - miBoomerangLifeField->Add("5 Seconds", 310); - miBoomerangLifeField->Add("6 Seconds", 372); - miBoomerangLifeField->Add("7 Seconds", 434); - miBoomerangLifeField->Add("8 Seconds", 496); - miBoomerangLifeField->Add("9 Seconds", 558); - miBoomerangLifeField->Add("10 Seconds", 620); - miBoomerangLifeField->SetData(&game_values.boomeranglife, NULL, NULL); - miBoomerangLifeField->SetKey(game_values.boomeranglife); - - miHammerLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 80, "Life", 305, 120); - miHammerLifeField->Add("No Limit", 310); - miHammerLifeField->Add("0.5 Seconds", 31); - miHammerLifeField->Add("0.6 Seconds", 37); - miHammerLifeField->Add("0.7 Seconds", 43); - miHammerLifeField->Add("0.8 Seconds", 49); - miHammerLifeField->Add("0.9 Seconds", 55); - miHammerLifeField->Add("1.0 Seconds", 62); - miHammerLifeField->Add("1.1 Seconds", 68); - miHammerLifeField->Add("1.2 Seconds", 74); - miHammerLifeField->SetData(&game_values.hammerttl, NULL, NULL); - miHammerLifeField->SetKey(game_values.hammerttl); - - miHammerDelayField = new MI_SelectField(&rm->spr_selectfield, 325, 120, "Delay", 305, 120); - miHammerDelayField->Add("None", 0); - miHammerDelayField->Add("0.1 Seconds", 6); - miHammerDelayField->Add("0.2 Seconds", 12); - miHammerDelayField->Add("0.3 Seconds", 19); - miHammerDelayField->Add("0.4 Seconds", 25); - miHammerDelayField->Add("0.5 Seconds", 31); - miHammerDelayField->Add("0.6 Seconds", 37); - miHammerDelayField->Add("0.7 Seconds", 43); - miHammerDelayField->Add("0.8 Seconds", 49); - miHammerDelayField->Add("0.9 Seconds", 55); - miHammerDelayField->Add("1.0 Seconds", 62); - miHammerDelayField->SetData(&game_values.hammerdelay, NULL, NULL); - miHammerDelayField->SetKey(game_values.hammerdelay); - - miHammerOneKillField = new MI_SelectField(&rm->spr_selectfield, 325, 160, "Power", 305, 120); - miHammerOneKillField->Add("One Kill", 0, "", true, false); - miHammerOneKillField->Add("Multiple Kills", 1); - miHammerOneKillField->SetData(NULL, NULL, &game_values.hammerpower); - miHammerOneKillField->SetKey(game_values.hammerpower ? 0 : 1); - miHammerOneKillField->SetAutoAdvance(true); - - miShellLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 330, "Life", 305, 120); - miShellLifeField->Add("Unlimited", 0); - miShellLifeField->Add("1 Second", 62); - miShellLifeField->Add("2 Seconds", 124); - miShellLifeField->Add("3 Seconds", 186); - miShellLifeField->Add("4 Seconds", 248); - miShellLifeField->Add("5 Seconds", 310); - miShellLifeField->Add("6 Seconds", 372); - miShellLifeField->Add("7 Seconds", 434); - miShellLifeField->Add("8 Seconds", 496); - miShellLifeField->Add("9 Seconds", 558); - miShellLifeField->Add("10 Seconds", 620); - miShellLifeField->Add("15 Seconds", 930); - miShellLifeField->Add("20 Seconds", 1240); - miShellLifeField->Add("25 Seconds", 1550); - miShellLifeField->Add("30 Seconds", 1860); - miShellLifeField->SetData(&game_values.shellttl, NULL, NULL); - miShellLifeField->SetKey(game_values.shellttl); - - miWandFreezeTimeField = new MI_SelectField(&rm->spr_selectfield, 10, 400, "Freeze", 305, 120); - miWandFreezeTimeField->Add("1 Second", 62); - miWandFreezeTimeField->Add("2 Seconds", 124); - miWandFreezeTimeField->Add("3 Seconds", 186); - miWandFreezeTimeField->Add("4 Seconds", 248); - miWandFreezeTimeField->Add("5 Seconds", 310); - miWandFreezeTimeField->Add("6 Seconds", 372); - miWandFreezeTimeField->Add("7 Seconds", 434); - miWandFreezeTimeField->Add("8 Seconds", 496); - miWandFreezeTimeField->Add("9 Seconds", 558); - miWandFreezeTimeField->Add("10 Seconds", 620); - miWandFreezeTimeField->Add("12 Seconds", 744); - miWandFreezeTimeField->Add("15 Seconds", 930); - miWandFreezeTimeField->Add("18 Seconds", 1116); - miWandFreezeTimeField->Add("20 Seconds", 1240); - miWandFreezeTimeField->SetData(&game_values.wandfreezetime, NULL, NULL); - miWandFreezeTimeField->SetKey(game_values.wandfreezetime); - - miBlueBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 230, "Blue Life", 305, 120); - miBlueBlockLifeField->Add("Unlimited", 0); - miBlueBlockLifeField->Add("1 Second", 62); - miBlueBlockLifeField->Add("2 Seconds", 124); - miBlueBlockLifeField->Add("3 Seconds", 186); - miBlueBlockLifeField->Add("4 Seconds", 248); - miBlueBlockLifeField->Add("5 Seconds", 310); - miBlueBlockLifeField->Add("6 Seconds", 372); - miBlueBlockLifeField->Add("7 Seconds", 434); - miBlueBlockLifeField->Add("8 Seconds", 496); - miBlueBlockLifeField->Add("9 Seconds", 558); - miBlueBlockLifeField->Add("10 Seconds", 620); - miBlueBlockLifeField->Add("15 Seconds", 930); - miBlueBlockLifeField->Add("20 Seconds", 1240); - miBlueBlockLifeField->Add("25 Seconds", 1550); - miBlueBlockLifeField->Add("30 Seconds", 1860); - miBlueBlockLifeField->SetData(&game_values.blueblockttl, NULL, NULL); - miBlueBlockLifeField->SetKey(game_values.blueblockttl); - - miGrayBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 270, "Gray Life", 305, 120); - miGrayBlockLifeField->Add("Unlimited", 0); - miGrayBlockLifeField->Add("1 Second", 62); - miGrayBlockLifeField->Add("2 Seconds", 124); - miGrayBlockLifeField->Add("3 Seconds", 186); - miGrayBlockLifeField->Add("4 Seconds", 248); - miGrayBlockLifeField->Add("5 Seconds", 310); - miGrayBlockLifeField->Add("6 Seconds", 372); - miGrayBlockLifeField->Add("7 Seconds", 434); - miGrayBlockLifeField->Add("8 Seconds", 496); - miGrayBlockLifeField->Add("9 Seconds", 558); - miGrayBlockLifeField->Add("10 Seconds", 620); - miGrayBlockLifeField->Add("15 Seconds", 930); - miGrayBlockLifeField->Add("20 Seconds", 1240); - miGrayBlockLifeField->Add("25 Seconds", 1550); - miGrayBlockLifeField->Add("30 Seconds", 1860); - miGrayBlockLifeField->SetData(&game_values.grayblockttl, NULL, NULL); - miGrayBlockLifeField->SetKey(game_values.grayblockttl); - - miRedBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 310, "Red Life", 305, 120); - miRedBlockLifeField->Add("Unlimited", 0); - miRedBlockLifeField->Add("1 Second", 62); - miRedBlockLifeField->Add("2 Seconds", 124); - miRedBlockLifeField->Add("3 Seconds", 186); - miRedBlockLifeField->Add("4 Seconds", 248); - miRedBlockLifeField->Add("5 Seconds", 310); - miRedBlockLifeField->Add("6 Seconds", 372); - miRedBlockLifeField->Add("7 Seconds", 434); - miRedBlockLifeField->Add("8 Seconds", 496); - miRedBlockLifeField->Add("9 Seconds", 558); - miRedBlockLifeField->Add("10 Seconds", 620); - miRedBlockLifeField->Add("15 Seconds", 930); - miRedBlockLifeField->Add("20 Seconds", 1240); - miRedBlockLifeField->Add("25 Seconds", 1550); - miRedBlockLifeField->Add("30 Seconds", 1860); - miRedBlockLifeField->SetData(&game_values.redblockttl, NULL, NULL); - miRedBlockLifeField->SetKey(game_values.redblockttl); + miFireballLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 80, "Life", 305, 120); + miFireballLifeField->add("1 Second", 62); + miFireballLifeField->add("2 Seconds", 124); + miFireballLifeField->add("3 Seconds", 186); + miFireballLifeField->add("4 Seconds", 248); + miFireballLifeField->add("5 Seconds", 310); + miFireballLifeField->add("6 Seconds", 372); + miFireballLifeField->add("7 Seconds", 434); + miFireballLifeField->add("8 Seconds", 496); + miFireballLifeField->add("9 Seconds", 558); + miFireballLifeField->add("10 Seconds", 620); + miFireballLifeField->setOutputPtr(&game_values.fireballttl); + miFireballLifeField->setCurrentValue(game_values.fireballttl); + + miFeatherJumpsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 150, "Jumps", 305, 120); + miFeatherJumpsField->add("1", 1); + miFeatherJumpsField->add("2", 2); + miFeatherJumpsField->add("3", 3); + miFeatherJumpsField->add("4", 4); + miFeatherJumpsField->add("5", 5); + miFeatherJumpsField->setOutputPtr(&game_values.featherjumps); + miFeatherJumpsField->setCurrentValue(game_values.featherjumps); + + miBoomerangStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 220, "Style", 305, 120); + miBoomerangStyleField->add("Flat", 0); + miBoomerangStyleField->add("SMB3", 1); + miBoomerangStyleField->add("Zelda", 2); + miBoomerangStyleField->add("Random", 3); + miBoomerangStyleField->setOutputPtr(&game_values.boomerangstyle); + miBoomerangStyleField->setCurrentValue(game_values.boomerangstyle); + + miBoomerangLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 260, "Life", 305, 120); + miBoomerangLifeField->add("1 Second", 62); + miBoomerangLifeField->add("2 Seconds", 124); + miBoomerangLifeField->add("3 Seconds", 186); + miBoomerangLifeField->add("4 Seconds", 248); + miBoomerangLifeField->add("5 Seconds", 310); + miBoomerangLifeField->add("6 Seconds", 372); + miBoomerangLifeField->add("7 Seconds", 434); + miBoomerangLifeField->add("8 Seconds", 496); + miBoomerangLifeField->add("9 Seconds", 558); + miBoomerangLifeField->add("10 Seconds", 620); + miBoomerangLifeField->setOutputPtr(&game_values.boomeranglife); + miBoomerangLifeField->setCurrentValue(game_values.boomeranglife); + + miHammerLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 80, "Life", 305, 120); + miHammerLifeField->add("No Limit", 310); + miHammerLifeField->add("0.5 Seconds", 31); + miHammerLifeField->add("0.6 Seconds", 37); + miHammerLifeField->add("0.7 Seconds", 43); + miHammerLifeField->add("0.8 Seconds", 49); + miHammerLifeField->add("0.9 Seconds", 55); + miHammerLifeField->add("1.0 Seconds", 62); + miHammerLifeField->add("1.1 Seconds", 68); + miHammerLifeField->add("1.2 Seconds", 74); + miHammerLifeField->setOutputPtr(&game_values.hammerttl); + miHammerLifeField->setCurrentValue(game_values.hammerttl); + + miHammerDelayField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 120, "Delay", 305, 120); + miHammerDelayField->add("None", 0); + miHammerDelayField->add("0.1 Seconds", 6); + miHammerDelayField->add("0.2 Seconds", 12); + miHammerDelayField->add("0.3 Seconds", 19); + miHammerDelayField->add("0.4 Seconds", 25); + miHammerDelayField->add("0.5 Seconds", 31); + miHammerDelayField->add("0.6 Seconds", 37); + miHammerDelayField->add("0.7 Seconds", 43); + miHammerDelayField->add("0.8 Seconds", 49); + miHammerDelayField->add("0.9 Seconds", 55); + miHammerDelayField->add("1.0 Seconds", 62); + miHammerDelayField->setOutputPtr(&game_values.hammerdelay); + miHammerDelayField->setCurrentValue(game_values.hammerdelay); + + miHammerOneKillField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 160, "Power", 305, 120); + miHammerOneKillField->add("One Kill", true); + miHammerOneKillField->add("Multiple Kills", false); + miHammerOneKillField->setOutputPtr(&game_values.hammerpower); + miHammerOneKillField->setCurrentValue(game_values.hammerpower); + miHammerOneKillField->setAutoAdvance(true); + + miShellLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 330, "Life", 305, 120); + miShellLifeField->add("Unlimited", 0); + miShellLifeField->add("1 Second", 62); + miShellLifeField->add("2 Seconds", 124); + miShellLifeField->add("3 Seconds", 186); + miShellLifeField->add("4 Seconds", 248); + miShellLifeField->add("5 Seconds", 310); + miShellLifeField->add("6 Seconds", 372); + miShellLifeField->add("7 Seconds", 434); + miShellLifeField->add("8 Seconds", 496); + miShellLifeField->add("9 Seconds", 558); + miShellLifeField->add("10 Seconds", 620); + miShellLifeField->add("15 Seconds", 930); + miShellLifeField->add("20 Seconds", 1240); + miShellLifeField->add("25 Seconds", 1550); + miShellLifeField->add("30 Seconds", 1860); + miShellLifeField->setOutputPtr(&game_values.shellttl); + miShellLifeField->setCurrentValue(game_values.shellttl); + + miWandFreezeTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 400, "Freeze", 305, 120); + miWandFreezeTimeField->add("1 Second", 62); + miWandFreezeTimeField->add("2 Seconds", 124); + miWandFreezeTimeField->add("3 Seconds", 186); + miWandFreezeTimeField->add("4 Seconds", 248); + miWandFreezeTimeField->add("5 Seconds", 310); + miWandFreezeTimeField->add("6 Seconds", 372); + miWandFreezeTimeField->add("7 Seconds", 434); + miWandFreezeTimeField->add("8 Seconds", 496); + miWandFreezeTimeField->add("9 Seconds", 558); + miWandFreezeTimeField->add("10 Seconds", 620); + miWandFreezeTimeField->add("12 Seconds", 744); + miWandFreezeTimeField->add("15 Seconds", 930); + miWandFreezeTimeField->add("18 Seconds", 1116); + miWandFreezeTimeField->add("20 Seconds", 1240); + miWandFreezeTimeField->setOutputPtr(&game_values.wandfreezetime); + miWandFreezeTimeField->setCurrentValue(game_values.wandfreezetime); + + miBlueBlockLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 230, "Blue Life", 305, 120); + miBlueBlockLifeField->add("Unlimited", 0); + miBlueBlockLifeField->add("1 Second", 62); + miBlueBlockLifeField->add("2 Seconds", 124); + miBlueBlockLifeField->add("3 Seconds", 186); + miBlueBlockLifeField->add("4 Seconds", 248); + miBlueBlockLifeField->add("5 Seconds", 310); + miBlueBlockLifeField->add("6 Seconds", 372); + miBlueBlockLifeField->add("7 Seconds", 434); + miBlueBlockLifeField->add("8 Seconds", 496); + miBlueBlockLifeField->add("9 Seconds", 558); + miBlueBlockLifeField->add("10 Seconds", 620); + miBlueBlockLifeField->add("15 Seconds", 930); + miBlueBlockLifeField->add("20 Seconds", 1240); + miBlueBlockLifeField->add("25 Seconds", 1550); + miBlueBlockLifeField->add("30 Seconds", 1860); + miBlueBlockLifeField->setOutputPtr(&game_values.blueblockttl); + miBlueBlockLifeField->setCurrentValue(game_values.blueblockttl); + + miGrayBlockLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 270, "Gray Life", 305, 120); + miGrayBlockLifeField->add("Unlimited", 0); + miGrayBlockLifeField->add("1 Second", 62); + miGrayBlockLifeField->add("2 Seconds", 124); + miGrayBlockLifeField->add("3 Seconds", 186); + miGrayBlockLifeField->add("4 Seconds", 248); + miGrayBlockLifeField->add("5 Seconds", 310); + miGrayBlockLifeField->add("6 Seconds", 372); + miGrayBlockLifeField->add("7 Seconds", 434); + miGrayBlockLifeField->add("8 Seconds", 496); + miGrayBlockLifeField->add("9 Seconds", 558); + miGrayBlockLifeField->add("10 Seconds", 620); + miGrayBlockLifeField->add("15 Seconds", 930); + miGrayBlockLifeField->add("20 Seconds", 1240); + miGrayBlockLifeField->add("25 Seconds", 1550); + miGrayBlockLifeField->add("30 Seconds", 1860); + miGrayBlockLifeField->setOutputPtr(&game_values.grayblockttl); + miGrayBlockLifeField->setCurrentValue(game_values.grayblockttl); + + miRedBlockLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 310, "Red Life", 305, 120); + miRedBlockLifeField->add("Unlimited", 0); + miRedBlockLifeField->add("1 Second", 62); + miRedBlockLifeField->add("2 Seconds", 124); + miRedBlockLifeField->add("3 Seconds", 186); + miRedBlockLifeField->add("4 Seconds", 248); + miRedBlockLifeField->add("5 Seconds", 310); + miRedBlockLifeField->add("6 Seconds", 372); + miRedBlockLifeField->add("7 Seconds", 434); + miRedBlockLifeField->add("8 Seconds", 496); + miRedBlockLifeField->add("9 Seconds", 558); + miRedBlockLifeField->add("10 Seconds", 620); + miRedBlockLifeField->add("15 Seconds", 930); + miRedBlockLifeField->add("20 Seconds", 1240); + miRedBlockLifeField->add("25 Seconds", 1550); + miRedBlockLifeField->add("30 Seconds", 1860); + miRedBlockLifeField->setOutputPtr(&game_values.redblockttl); + miRedBlockLifeField->setCurrentValue(game_values.redblockttl); miProjectileOptionsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miProjectileOptionsMenuBackButton->SetCode(MENU_CODE_BACK_TO_OPTIONS_MENU); diff --git a/src/smw/menu/options/ProjectileOptionsMenu.h b/src/smw/menu/options/ProjectileOptionsMenu.h index ef6d44a2..e608f32d 100644 --- a/src/smw/menu/options/ProjectileOptionsMenu.h +++ b/src/smw/menu/options/ProjectileOptionsMenu.h @@ -4,8 +4,8 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; class UI_ProjectileOptionsMenu : public UI_Menu { @@ -13,19 +13,19 @@ class UI_ProjectileOptionsMenu : public UI_Menu { UI_ProjectileOptionsMenu(); private: - MI_SelectField* miFireballLifeField; - MI_SelectField* miHammerLifeField; - MI_SelectField* miHammerDelayField; - MI_SelectField* miHammerOneKillField; - MI_SelectField* miShellLifeField; - MI_SelectField* miWandFreezeTimeField; - - MI_SelectField* miBlueBlockLifeField; - MI_SelectField* miGrayBlockLifeField; - MI_SelectField* miRedBlockLifeField; - MI_SelectField* miBoomerangStyleField; - MI_SelectField* miBoomerangLifeField; - MI_SelectField* miFeatherJumpsField; + MI_SelectFieldDyn* miFireballLifeField; + MI_SelectFieldDyn* miHammerLifeField; + MI_SelectFieldDyn* miHammerDelayField; + MI_SelectFieldDyn* miHammerOneKillField; + MI_SelectFieldDyn* miShellLifeField; + MI_SelectFieldDyn* miWandFreezeTimeField; + + MI_SelectFieldDyn* miBlueBlockLifeField; + MI_SelectFieldDyn* miGrayBlockLifeField; + MI_SelectFieldDyn* miRedBlockLifeField; + MI_SelectFieldDyn* miBoomerangStyleField; + MI_SelectFieldDyn* miBoomerangLifeField; + MI_SelectFieldDyn* miFeatherJumpsField; MI_Button* miProjectileOptionsMenuBackButton; diff --git a/src/smw/menu/options/SoundOptionsMenu.cpp b/src/smw/menu/options/SoundOptionsMenu.cpp index cc198108..26891a8a 100644 --- a/src/smw/menu/options/SoundOptionsMenu.cpp +++ b/src/smw/menu/options/SoundOptionsMenu.cpp @@ -53,28 +53,28 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() miMusicVolumeField->allowWrap(false); miMusicVolumeField->setItemChangedCode(MENU_CODE_MUSIC_VOLUME_CHANGED); - miPlayNextMusicField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Next Music", 500, 220); - miPlayNextMusicField->Add("Off", 0); - miPlayNextMusicField->Add("On", 1, "", true, false); - miPlayNextMusicField->SetData(NULL, NULL, &game_values.playnextmusic); - miPlayNextMusicField->SetKey(game_values.playnextmusic ? 1 : 0); - miPlayNextMusicField->SetAutoAdvance(true); + miPlayNextMusicField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Next Music", 500, 220); + miPlayNextMusicField->add("Off", false); + miPlayNextMusicField->add("On", true); + miPlayNextMusicField->setOutputPtr(&game_values.playnextmusic); + miPlayNextMusicField->setCurrentValue(game_values.playnextmusic ? 1 : 0); + miPlayNextMusicField->setAutoAdvance(true); miAnnouncerField = new MI_AnnouncerField(&rm->spr_selectfield, 70, 220, "Announcer", 500, 220, announcerlist); miSoundPackField = new MI_PacksField(&rm->spr_selectfield, 70, 260, "Sound Pack", 500, 220, soundpacklist, MENU_CODE_SOUND_PACK_CHANGED); miPlaylistField = new MI_PlaylistField(&rm->spr_selectfield, 70, 300, "Game Music Pack", 500, 220); - miWorldMusicField = new MI_SelectField(&rm->spr_selectfield, 70, 340, "World Music Pack", 500, 220); + miWorldMusicField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 340, "World Music Pack", 500, 220); int iCurrentMusic = worldmusiclist->GetCurrentIndex(); worldmusiclist->SetCurrent(0); for (short iMusic = 0; iMusic < worldmusiclist->GetCount(); iMusic++) { - miWorldMusicField->Add(worldmusiclist->current_name(), iMusic, "", false, false); + miWorldMusicField->add(worldmusiclist->current_name(), iMusic, false); worldmusiclist->next(); } - miWorldMusicField->SetKey(iCurrentMusic); + miWorldMusicField->setCurrentValue(iCurrentMusic); worldmusiclist->SetCurrent(iCurrentMusic); - miWorldMusicField->SetItemChangedCode(MENU_CODE_WORLD_MUSIC_CHANGED); + miWorldMusicField->setItemChangedCode(MENU_CODE_WORLD_MUSIC_CHANGED); miSoundOptionsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miSoundOptionsMenuBackButton->SetCode(MENU_CODE_BACK_TO_OPTIONS_MENU); @@ -103,5 +103,5 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() short UI_SoundOptionsMenu::GetCurrentWorldMusicID() const { - return miWorldMusicField->GetShortValue(); + return miWorldMusicField->currentValue(); } diff --git a/src/smw/menu/options/SoundOptionsMenu.h b/src/smw/menu/options/SoundOptionsMenu.h index a70fe460..5c1f3225 100644 --- a/src/smw/menu/options/SoundOptionsMenu.h +++ b/src/smw/menu/options/SoundOptionsMenu.h @@ -5,11 +5,11 @@ class MI_AnnouncerField; class MI_Button; class MI_Image; -class MI_SelectField; class MI_SliderField; class MI_PacksField; class MI_PlaylistField; class MI_Text; +template class MI_SelectFieldDyn; class UI_SoundOptionsMenu : public UI_Menu { @@ -21,10 +21,10 @@ class UI_SoundOptionsMenu : public UI_Menu { private: MI_SliderField* miSoundVolumeField; MI_SliderField* miMusicVolumeField; - MI_SelectField* miPlayNextMusicField; + MI_SelectFieldDyn* miPlayNextMusicField; MI_AnnouncerField* miAnnouncerField; MI_PlaylistField* miPlaylistField; - MI_SelectField* miWorldMusicField; + MI_SelectFieldDyn* miWorldMusicField; MI_PacksField* miSoundPackField; MI_Button* miSoundOptionsMenuBackButton; diff --git a/src/smw/menu/options/TeamOptionsMenu.cpp b/src/smw/menu/options/TeamOptionsMenu.cpp index fa8cb253..2bc43cc2 100644 --- a/src/smw/menu/options/TeamOptionsMenu.cpp +++ b/src/smw/menu/options/TeamOptionsMenu.cpp @@ -14,31 +14,31 @@ extern CGameValues game_values; UI_TeamOptionsMenu::UI_TeamOptionsMenu() : UI_Menu() { - miTeamKillsField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Player Collision", 500, 220); - miTeamKillsField->Add("Off", 0); - miTeamKillsField->Add("Assist", 1); - miTeamKillsField->Add("On", 2); - miTeamKillsField->SetData(&game_values.teamcollision, NULL, NULL); - miTeamKillsField->SetKey(game_values.teamcollision); - - miTeamColorsField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Colors", 500, 220); - miTeamColorsField->Add("Individual", 0); - miTeamColorsField->Add("Team", 1, "", true, false); - miTeamColorsField->SetData(NULL, NULL, &game_values.teamcolors); - miTeamColorsField->SetKey(game_values.teamcolors ? 1 : 0); - miTeamColorsField->SetAutoAdvance(true); - - miTournamentControlField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "Tournament Control", 500, 220); - miTournamentControlField->Add("All", 0); - miTournamentControlField->Add("Game Winner", 1); - miTournamentControlField->Add("Game Loser", 2); - miTournamentControlField->Add("Leading Teams", 3); - miTournamentControlField->Add("Trailing Teams", 4); - miTournamentControlField->Add("Random", 5); - miTournamentControlField->Add("Random Loser", 6); - miTournamentControlField->Add("Round Robin", 7); - miTournamentControlField->SetData(&game_values.tournamentcontrolstyle, NULL, NULL); - miTournamentControlField->SetKey(game_values.tournamentcontrolstyle); + miTeamKillsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Player Collision", 500, 220); + miTeamKillsField->add("Off", 0); + miTeamKillsField->add("Assist", 1); + miTeamKillsField->add("On", 2); + miTeamKillsField->setOutputPtr(&game_values.teamcollision); + miTeamKillsField->setCurrentValue(game_values.teamcollision); + + miTeamColorsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 220, "Colors", 500, 220); + miTeamColorsField->add("Individual", false); + miTeamColorsField->add("Team", true); + miTeamColorsField->setOutputPtr(&game_values.teamcolors); + miTeamColorsField->setCurrentValue(game_values.teamcolors ? 1 : 0); + miTeamColorsField->setAutoAdvance(true); + + miTournamentControlField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 260, "Tournament Control", 500, 220); + miTournamentControlField->add("All", 0); + miTournamentControlField->add("Game Winner", 1); + miTournamentControlField->add("Game Loser", 2); + miTournamentControlField->add("Leading Teams", 3); + miTournamentControlField->add("Trailing Teams", 4); + miTournamentControlField->add("Random", 5); + miTournamentControlField->add("Random Loser", 6); + miTournamentControlField->add("Round Robin", 7); + miTournamentControlField->setOutputPtr(&game_values.tournamentcontrolstyle); + miTournamentControlField->setCurrentValue(game_values.tournamentcontrolstyle); miTeamOptionsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); miTeamOptionsMenuBackButton->SetCode(MENU_CODE_BACK_TO_OPTIONS_MENU); diff --git a/src/smw/menu/options/TeamOptionsMenu.h b/src/smw/menu/options/TeamOptionsMenu.h index ea475a8f..f8c26141 100644 --- a/src/smw/menu/options/TeamOptionsMenu.h +++ b/src/smw/menu/options/TeamOptionsMenu.h @@ -4,8 +4,8 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; /* In this menu, you can set team-relates preferences, @@ -16,9 +16,9 @@ class UI_TeamOptionsMenu : public UI_Menu { UI_TeamOptionsMenu(); private: - MI_SelectField* miTeamKillsField; - MI_SelectField* miTeamColorsField; - MI_SelectField* miTournamentControlField; + MI_SelectFieldDyn* miTeamKillsField; + MI_SelectFieldDyn* miTeamColorsField; + MI_SelectFieldDyn* miTournamentControlField; MI_Button* miTeamOptionsMenuBackButton; MI_Image* miTeamOptionsMenuLeftHeaderBar; From f4c4c7de4687a7c19e842e2837e58f6ae1609492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 13:56:53 +0200 Subject: [PATCH 09/14] Updated the rest of the menus to use the new select field --- src/smw/menu/GameSettingsMenu.cpp | 8 +- src/smw/menu/GameSettingsMenu.h | 4 +- src/smw/menu/MatchSelectionMenu.cpp | 86 +++++++++---------- src/smw/menu/MatchSelectionMenu.h | 12 +-- src/smw/menu/network/NetNewRoomMenu.cpp | 1 - src/smw/menu/network/NetNewRoomMenu.h | 1 - .../menu/network/NetNewRoomSettingsMenu.cpp | 2 +- src/smw/menu/network/NetNewRoomSettingsMenu.h | 4 +- src/smw/menu/options/SoundOptionsMenu.cpp | 2 +- src/smw/menu/xbox/ScreenSettingsMenu.cpp | 72 ++++++++-------- src/smw/menu/xbox/ScreenSettingsMenu.h | 8 +- 11 files changed, 99 insertions(+), 101 deletions(-) diff --git a/src/smw/menu/GameSettingsMenu.cpp b/src/smw/menu/GameSettingsMenu.cpp index 454623c2..70f0b71f 100644 --- a/src/smw/menu/GameSettingsMenu.cpp +++ b/src/smw/menu/GameSettingsMenu.cpp @@ -40,17 +40,17 @@ UI_GameSettingsMenu::UI_GameSettingsMenu() miModeField->setItemChangedCode(MENU_CODE_MODE_CHANGED); for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { - miGoalField[iGameMode] = new MI_SelectField(&rm->spr_selectfield, 70, 125, gamemodes[iGameMode]->GetGoalName().c_str(), 352, 120); + miGoalField[iGameMode] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 125, gamemodes[iGameMode]->GetGoalName().c_str(), 352, 120); // miGoalField[iGameMode]->SetKey(gamemodes[iGameMode]->goal); miGoalField[iGameMode]->Show(iGameMode == 0); for (short iGameModeOption = 0; iGameModeOption < GAMEMODE_NUM_OPTIONS; iGameModeOption++) { SModeOption* option = &gamemodes[iGameMode]->GetOptions()[iGameModeOption]; - miGoalField[iGameMode]->Add(option->szName, option->iValue, "", false, false); + miGoalField[iGameMode]->add(option->szName, option->iValue); } - miGoalField[iGameMode]->SetData(&gamemodes[iGameMode]->goal, NULL, NULL); - miGoalField[iGameMode]->SetKey(gamemodes[iGameMode]->goal); + miGoalField[iGameMode]->setOutputPtr(&gamemodes[iGameMode]->goal); + miGoalField[iGameMode]->setCurrentValue(gamemodes[iGameMode]->goal); } miModeSettingsButton = new MI_Button(&rm->spr_selectfield, 430, 125, "Settings", 140); diff --git a/src/smw/menu/GameSettingsMenu.h b/src/smw/menu/GameSettingsMenu.h index 242a9dc6..6a1c8908 100644 --- a/src/smw/menu/GameSettingsMenu.h +++ b/src/smw/menu/GameSettingsMenu.h @@ -7,8 +7,8 @@ class MI_Image; class MI_ImageSelectField; class MI_MapField; class MI_MapFilterScroll; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; class UI_GameSettingsMenu : public UI_Menu { @@ -30,7 +30,7 @@ class UI_GameSettingsMenu : public UI_Menu { MI_MapFilterScroll* miMapFilterScroll = nullptr; MI_MapField* miMapField = nullptr; - MI_SelectField* miGoalField[22]; + MI_SelectFieldDyn* miGoalField[22]; private: MI_ImageSelectField* miModeField = nullptr; diff --git a/src/smw/menu/MatchSelectionMenu.cpp b/src/smw/menu/MatchSelectionMenu.cpp index 0b788519..338cb7a1 100644 --- a/src/smw/menu/MatchSelectionMenu.cpp +++ b/src/smw/menu/MatchSelectionMenu.cpp @@ -22,58 +22,58 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miMatchSelectionStartButton = new MI_Button(&rm->spr_selectfield, 270, 420, "Start", 100); miMatchSelectionStartButton->SetCode(MENU_CODE_MATCH_SELECTION_START); - miMatchSelectionField = new MI_SelectField(&rm->spr_selectfield, 130, 340, "Match", 380, 100); - miMatchSelectionField->Add("Single Game", MATCH_TYPE_SINGLE_GAME); - miMatchSelectionField->Add("Tournament", MATCH_TYPE_TOURNAMENT); - miMatchSelectionField->Add("Tour", MATCH_TYPE_TOUR); - miMatchSelectionField->Add("World", MATCH_TYPE_WORLD); - miMatchSelectionField->Add("Minigame", MATCH_TYPE_MINIGAME); - miMatchSelectionField->SetData(&game_values.matchtype, NULL, NULL); - miMatchSelectionField->SetKey(game_values.matchtype); - miMatchSelectionField->SetItemChangedCode(MENU_CODE_MATCH_SELECTION_MATCH_CHANGED); - - miTournamentField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Wins", 380, 100); - miTournamentField->Add("2", 2); - miTournamentField->Add("3", 3); - miTournamentField->Add("4", 4); - miTournamentField->Add("5", 5); - miTournamentField->Add("6", 6); - miTournamentField->Add("7", 7); - miTournamentField->Add("8", 8); - miTournamentField->Add("9", 9); - miTournamentField->Add("10", 10); - miTournamentField->SetData(&game_values.tournamentgames, NULL, NULL); - miTournamentField->SetKey(game_values.tournamentgames); + miMatchSelectionField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 340, "Match", 380, 100); + miMatchSelectionField->add("Single Game", MATCH_TYPE_SINGLE_GAME); + miMatchSelectionField->add("Tournament", MATCH_TYPE_TOURNAMENT); + miMatchSelectionField->add("Tour", MATCH_TYPE_TOUR); + miMatchSelectionField->add("World", MATCH_TYPE_WORLD); + miMatchSelectionField->add("Minigame", MATCH_TYPE_MINIGAME); + miMatchSelectionField->setOutputPtr(&game_values.matchtype); + miMatchSelectionField->setCurrentValue(game_values.matchtype); + miMatchSelectionField->setItemChangedCode(MENU_CODE_MATCH_SELECTION_MATCH_CHANGED); + + miTournamentField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "Wins", 380, 100); + miTournamentField->add("2", 2); + miTournamentField->add("3", 3); + miTournamentField->add("4", 4); + miTournamentField->add("5", 5); + miTournamentField->add("6", 6); + miTournamentField->add("7", 7); + miTournamentField->add("8", 8); + miTournamentField->add("9", 9); + miTournamentField->add("10", 10); + miTournamentField->setOutputPtr(&game_values.tournamentgames); + miTournamentField->setCurrentValue(game_values.tournamentgames); miTournamentField->Show(false); - miTourField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Tour", 380, 100); + miTourField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "Tour", 380, 100); for (short iTour = 0; iTour < tourlist->GetCount(); iTour++) { std::string szTemp = GetNameFromFileName(tourlist->GetIndex(iTour), true); // strcat(szTemp, " Tour"); - miTourField->Add(std::move(szTemp), iTour, "", true, false); + miTourField->add(std::move(szTemp), iTour); } - miTourField->SetData(&game_values.tourindex, NULL, NULL); - miTourField->SetKey(game_values.tourindex); + miTourField->setOutputPtr(&game_values.tourindex); + miTourField->setCurrentValue(game_values.tourindex); miTourField->Show(false); - miWorldField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "World", 380, 100); + miWorldField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "World", 380, 100); for (short iWorld = 0; iWorld < worldlist->GetCount(); iWorld++) { std::string szTemp = GetNameFromFileName(worldlist->GetIndex(iWorld), true); - miWorldField->Add(std::move(szTemp), iWorld, "", true, false); + miWorldField->add(std::move(szTemp), iWorld); } - miWorldField->SetData(&game_values.worldindex, NULL, NULL); - miWorldField->SetKey(game_values.worldindex); - miWorldField->SetItemChangedCode(MENU_CODE_WORLD_MAP_CHANGED); + miWorldField->setOutputPtr(&game_values.worldindex); + miWorldField->setCurrentValue(game_values.worldindex); + miWorldField->setItemChangedCode(MENU_CODE_WORLD_MAP_CHANGED); miWorldField->Show(false); - miMinigameField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Game", 380, 100); - miMinigameField->Add("Pipe Coin Game", 0); - miMinigameField->Add("Hammer Boss Game", 1); - miMinigameField->Add("Bomb Boss Game", 2); - miMinigameField->Add("Fire Boss Game", 3); - miMinigameField->Add("Boxes Game", 4); - miMinigameField->SetData(&game_values.selectedminigame, NULL, NULL); - miMinigameField->SetKey(game_values.selectedminigame); + miMinigameField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "Game", 380, 100); + miMinigameField->add("Pipe Coin Game", 0); + miMinigameField->add("Hammer Boss Game", 1); + miMinigameField->add("Bomb Boss Game", 2); + miMinigameField->add("Fire Boss Game", 3); + miMinigameField->add("Boxes Game", 4); + miMinigameField->setOutputPtr(&game_values.selectedminigame); + miMinigameField->setCurrentValue(game_values.selectedminigame); miMinigameField->Show(false); miMatchSelectionMenuLeftHeaderBar = new MI_Image(&rm->menu_plain_field, 0, 0, 0, 0, 320, 32, 1, 1, 0); @@ -125,8 +125,8 @@ void UI_MatchSelectionMenu::WorldMapChanged() void UI_MatchSelectionMenu::ActivateMinigameField() { - miMatchSelectionField->HideItem(MATCH_TYPE_MINIGAME, false); - miMatchSelectionField->SetKey(MATCH_TYPE_MINIGAME); + miMatchSelectionField->hideItem(MATCH_TYPE_MINIGAME, false); + miMatchSelectionField->setCurrentValue(MATCH_TYPE_MINIGAME); miTournamentField->Show(false); miTourField->Show(false); @@ -140,10 +140,10 @@ void UI_MatchSelectionMenu::ActivateMinigameField() short UI_MatchSelectionMenu::GetMinigameID() { - return miMinigameField->GetShortValue(); + return miMinigameField->currentValue(); } short UI_MatchSelectionMenu::GetSelectedMatchType() { - return miMatchSelectionField->GetShortValue(); + return miMatchSelectionField->currentValue(); } diff --git a/src/smw/menu/MatchSelectionMenu.h b/src/smw/menu/MatchSelectionMenu.h index 5fc3e662..60da79c1 100644 --- a/src/smw/menu/MatchSelectionMenu.h +++ b/src/smw/menu/MatchSelectionMenu.h @@ -4,9 +4,9 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; class MI_WorldPreviewDisplay; +template class MI_SelectFieldDyn; class UI_MatchSelectionMenu : public UI_Menu { @@ -22,11 +22,11 @@ class UI_MatchSelectionMenu : public UI_Menu { private: MI_Image* miMatchSelectionDisplayImage; - MI_SelectField* miMatchSelectionField; - MI_SelectField* miTournamentField; - MI_SelectField* miTourField; - MI_SelectField* miWorldField; - MI_SelectField* miMinigameField; + MI_SelectFieldDyn* miMatchSelectionField; + MI_SelectFieldDyn* miTournamentField; + MI_SelectFieldDyn* miTourField; + MI_SelectFieldDyn* miWorldField; + MI_SelectFieldDyn* miMinigameField; MI_WorldPreviewDisplay* miWorldPreviewDisplay; MI_Button* miMatchSelectionStartButton; diff --git a/src/smw/menu/network/NetNewRoomMenu.cpp b/src/smw/menu/network/NetNewRoomMenu.cpp index 649b0874..2ff02300 100644 --- a/src/smw/menu/network/NetNewRoomMenu.cpp +++ b/src/smw/menu/network/NetNewRoomMenu.cpp @@ -4,7 +4,6 @@ #include "net.h" #include "ui/MI_Button.h" #include "ui/MI_Image.h" -#include "ui/MI_SelectField.h" #include "ui/MI_Text.h" #include "ui/MI_TextField.h" diff --git a/src/smw/menu/network/NetNewRoomMenu.h b/src/smw/menu/network/NetNewRoomMenu.h index 1bb48895..a9d4b30e 100644 --- a/src/smw/menu/network/NetNewRoomMenu.h +++ b/src/smw/menu/network/NetNewRoomMenu.h @@ -4,7 +4,6 @@ class MI_Button; class MI_Image; -class MI_SelectField; class MI_Text; class MI_TextField; diff --git a/src/smw/menu/network/NetNewRoomSettingsMenu.cpp b/src/smw/menu/network/NetNewRoomSettingsMenu.cpp index a6071f2a..33d94742 100644 --- a/src/smw/menu/network/NetNewRoomSettingsMenu.cpp +++ b/src/smw/menu/network/NetNewRoomSettingsMenu.cpp @@ -23,7 +23,7 @@ UI_NetNewRoomSettingsMenu::UI_NetNewRoomSettingsMenu(const UI_GameSettingsMenu* miModeField = new MI_ImageSelectField(*(gsm->miModeField)); for (short iGoalField = 0; iGoalField < GAMEMODE_LAST; iGoalField++) - miGoalField[iGoalField] = new MI_SelectField(*(gsm->miGoalField[iGoalField])); + miGoalField[iGoalField] = new MI_SelectFieldDyn(*(gsm->miGoalField[iGoalField])); miMapField = new MI_MapField(&rm->spr_selectfield, 70, 165, "Map", 400, 120, true); netplay.mapfilepath = getCurrentMapPath(); diff --git a/src/smw/menu/network/NetNewRoomSettingsMenu.h b/src/smw/menu/network/NetNewRoomSettingsMenu.h index 1446e9ee..cf7483dc 100644 --- a/src/smw/menu/network/NetNewRoomSettingsMenu.h +++ b/src/smw/menu/network/NetNewRoomSettingsMenu.h @@ -8,9 +8,9 @@ class MI_Button; class MI_Image; class MI_ImageSelectField; class MI_MapField; -class MI_SelectField; class MI_Text; class UI_GameSettingsMenu; +template class MI_SelectFieldDyn; class UI_NetNewRoomSettingsMenu : public UI_Menu { @@ -24,7 +24,7 @@ class UI_NetNewRoomSettingsMenu : public UI_Menu { private: MI_ImageSelectField* miModeField; - MI_SelectField* miGoalField[22]; + MI_SelectFieldDyn* miGoalField[22]; MI_Button* miModeSettingsButton; MI_MapField* miMapField; MI_Button* miContinueButton; diff --git a/src/smw/menu/options/SoundOptionsMenu.cpp b/src/smw/menu/options/SoundOptionsMenu.cpp index 26891a8a..40d4916d 100644 --- a/src/smw/menu/options/SoundOptionsMenu.cpp +++ b/src/smw/menu/options/SoundOptionsMenu.cpp @@ -69,7 +69,7 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() int iCurrentMusic = worldmusiclist->GetCurrentIndex(); worldmusiclist->SetCurrent(0); for (short iMusic = 0; iMusic < worldmusiclist->GetCount(); iMusic++) { - miWorldMusicField->add(worldmusiclist->current_name(), iMusic, false); + miWorldMusicField->add(worldmusiclist->current_name(), iMusic); worldmusiclist->next(); } miWorldMusicField->setCurrentValue(iCurrentMusic); diff --git a/src/smw/menu/xbox/ScreenSettingsMenu.cpp b/src/smw/menu/xbox/ScreenSettingsMenu.cpp index 527cc6d1..496cc878 100644 --- a/src/smw/menu/xbox/ScreenSettingsMenu.cpp +++ b/src/smw/menu/xbox/ScreenSettingsMenu.cpp @@ -10,46 +10,46 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() miScreenResizeButton = new MI_Button(&rm->spr_selectfield, 70, 160, "Resize Screen", 500, 0); miScreenResizeButton->SetCode(MENU_CODE_TO_SCREEN_RESIZE); - miScreenHardwareFilterField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Filter", 500, 220); - //miScreenHardwareFilterField->Add("None", 0); - miScreenHardwareFilterField->Add("Point", 1); - miScreenHardwareFilterField->Add("Bilinear", 2); - miScreenHardwareFilterField->Add("Trilinear", 3); - miScreenHardwareFilterField->Add("Anisotrpoic", 4); - miScreenHardwareFilterField->Add("Quincunx", 5); - miScreenHardwareFilterField->Add("Gaussian Cubic", 6); - miScreenHardwareFilterField->SetData(&game_values.hardwarefilter, NULL, NULL); - miScreenHardwareFilterField->SetKey(game_values.hardwarefilter); - miScreenHardwareFilterField->SetItemChangedCode(MENU_CODE_SCREEN_FILTER_CHANGED); + miScreenHardwareFilterField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Screen Filter", 500, 220); + //miScreenHardwareFilterField->add("None", 0); + miScreenHardwareFilterField->add("Point", 1); + miScreenHardwareFilterField->add("Bilinear", 2); + miScreenHardwareFilterField->add("Trilinear", 3); + miScreenHardwareFilterField->add("Anisotrpoic", 4); + miScreenHardwareFilterField->add("Quincunx", 5); + miScreenHardwareFilterField->add("Gaussian Cubic", 6); + miScreenHardwareFilterField->setOutputPtr(&game_values.hardwarefilter); + miScreenHardwareFilterField->setCurrenzValue(game_values.hardwarefilter); + miScreenHardwareFilterField->setItemChangedCode(MENU_CODE_SCREEN_FILTER_CHANGED); - miScreenFlickerFilterField = new MI_SliderField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 240, "Flicker Filter", 500, 220, 380); - miScreenFlickerFilterField->Add("0", 0); - miScreenFlickerFilterField->Add("1", 1); - miScreenFlickerFilterField->Add("2", 2); - miScreenFlickerFilterField->Add("3", 3); - miScreenFlickerFilterField->Add("4", 4); - miScreenFlickerFilterField->Add("5", 5); - miScreenFlickerFilterField->SetData(&game_values.flickerfilter, NULL, NULL); - miScreenFlickerFilterField->SetKey(game_values.flickerfilter); - miScreenFlickerFilterField->SetNoWrap(true); - miScreenFlickerFilterField->SetItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); + miScreenFlickerFilterField = new MI_SelectFieldDyn(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 240, "Flicker Filter", 500, 220, 380); + miScreenFlickerFilterField->add("0", 0); + miScreenFlickerFilterField->add("1", 1); + miScreenFlickerFilterField->add("2", 2); + miScreenFlickerFilterField->add("3", 3); + miScreenFlickerFilterField->add("4", 4); + miScreenFlickerFilterField->add("5", 5); + miScreenFlickerFilterField->setOutputPtr(&game_values.flickerfilter); + miScreenFlickerFilterField->setCurrenzValue(game_values.flickerfilter); + miScreenFlickerFilterField->allowWrap(false); + miScreenFlickerFilterField->setItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); - miScreenSoftFilterField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Soften Filter", 500, 220); - miScreenSoftFilterField->Add("Off", 0); - miScreenSoftFilterField->Add("On", 1, "", true, false); - miScreenSoftFilterField->SetData(&game_values.softfilter, NULL, NULL); - miScreenSoftFilterField->SetKey(game_values.softfilter); - miScreenSoftFilterField->SetAutoAdvance(true); - miScreenSoftFilterField->SetItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); + miScreenSoftFilterField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Soften Filter", 500, 220); + miScreenSoftFilterField->add("Off", false); + miScreenSoftFilterField->add("On", true); + miScreenSoftFilterField->setOutputPtr(&game_values.softfilter); + miScreenSoftFilterField->setCurrenzValue(game_values.softfilter); + miScreenSoftFilterField->setAutoAdvance(true); + miScreenSoftFilterField->setItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); /* - miScreenAspectRatioField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "10x11 Aspect", 500, 220); - miScreenAspectRatioField->Add("Off", 0); - miScreenAspectRatioField->Add("On", 1, "", true, false); - miScreenAspectRatioField->SetData(NULL, NULL, &game_values.aspectratio10x11); - miScreenAspectRatioField->SetKey(game_values.aspectratio10x11 ? 1 : 0); - miScreenAspectRatioField->SetAutoAdvance(true); - miScreenAspectRatioField->SetItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); + miScreenAspectRatioField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 300, "10x11 Aspect", 500, 220); + miScreenAspectRatioField->add("Off", false); + miScreenAspectRatioField->add("On", true); + miScreenAspectRatioField->setOutputPtr(&game_values.aspectratio10x11); + miScreenAspectRatioField->setCurrenzValue(game_values.aspectratio10x11); + miScreenAspectRatioField->setAutoAdvance(true); + miScreenAspectRatioField->setItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); */ miScreenSettingsMenuBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, 1); diff --git a/src/smw/menu/xbox/ScreenSettingsMenu.h b/src/smw/menu/xbox/ScreenSettingsMenu.h index 30e86f6e..b4cf1837 100644 --- a/src/smw/menu/xbox/ScreenSettingsMenu.h +++ b/src/smw/menu/xbox/ScreenSettingsMenu.h @@ -16,10 +16,10 @@ class UI_ScreenSettingsMenu : public UI_Menu private: MI_Button * miScreenResizeButton; - MI_SelectField * miScreenHardwareFilterField; - MI_SelectField * miScreenFlickerFilterField; - MI_SelectField * miScreenSoftFilterField; - //MI_SelectField * miScreenAspectRatioField; + MI_SelectFieldDyn* miScreenHardwareFilterField; + MI_SelectFieldDyn* miScreenFlickerFilterField; + MI_SelectFieldDyn* miScreenSoftFilterField; + //MI_SelectFieldDyn* miScreenAspectRatioField; MI_Button * miScreenSettingsMenuBackButton; From 6cd94c63623a5b8bad1eb7a2c47e84f82012652a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 13:57:36 +0200 Subject: [PATCH 10/14] Updated the rest of the main game UI elements --- src/smw/GSMenu.cpp | 6 +-- src/smw/ui/MI_FrenzyModeOptions.cpp | 60 ++++++++++++------------- src/smw/ui/MI_FrenzyModeOptions.h | 4 +- src/smw/ui/MI_InputControlContainer.cpp | 24 +++++----- src/smw/ui/MI_InputControlContainer.h | 4 +- src/smw/ui/MI_PowerupSelection.cpp | 56 +++++++++++------------ src/smw/ui/MI_PowerupSelection.h | 6 +-- src/smw/ui/MI_TourStop.cpp | 22 ++++----- src/smw/ui/MI_TourStop.h | 8 ++-- 9 files changed, 95 insertions(+), 95 deletions(-) diff --git a/src/smw/GSMenu.cpp b/src/smw/GSMenu.cpp index f0036ba3..54558678 100644 --- a/src/smw/GSMenu.cpp +++ b/src/smw/GSMenu.cpp @@ -517,7 +517,7 @@ void MenuState::update() short iRandOption = (RANDOM_INT(6)) + 1; game_values.gamemode->goal = options[iRandOption].iValue; - mGameSettingsMenu->miGoalField[currentgamemode]->SetKey(gamemodes[currentgamemode]->goal); + mGameSettingsMenu->miGoalField[currentgamemode]->setCurrentValue(gamemodes[currentgamemode]->goal); mModeOptionsMenu->SetRandomGameModeSettings(game_values.gamemode->gamemode); @@ -796,7 +796,7 @@ void MenuState::update() game_values.gamemode = gamemodes[mGameSettingsMenu->GetCurrentGameModeID()]; for (short iMode = 0; iMode < GAMEMODE_LAST; iMode++) { - gamemodes[iMode]->goal = mGameSettingsMenu->miGoalField[iMode]->GetShortValue(); + gamemodes[iMode]->goal = mGameSettingsMenu->miGoalField[iMode]->currentValue(); } if (mGameSettingsMenu->GetCurrentGameModeID() == game_mode_owned) @@ -822,7 +822,7 @@ void MenuState::update() //Setup items on next menu for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { - mGameSettingsMenu->miGoalField[iGameMode]->HideItem(-1, game_values.matchtype == MATCH_TYPE_TOURNAMENT); + mGameSettingsMenu->miGoalField[iGameMode]->hideItem(-1, game_values.matchtype == MATCH_TYPE_TOURNAMENT); } if (game_values.matchtype == MATCH_TYPE_WORLD) diff --git a/src/smw/ui/MI_FrenzyModeOptions.cpp b/src/smw/ui/MI_FrenzyModeOptions.cpp index bb3dc95f..0e984f87 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.cpp +++ b/src/smw/ui/MI_FrenzyModeOptions.cpp @@ -29,34 +29,34 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short mMenu = new UI_Menu(); - miQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 40, "Limit", 400, 180); - miQuantityField->Add("Single Powerup", 0); - miQuantityField->Add("1 Powerup", 1); - miQuantityField->Add("2 Powerups", 2); - miQuantityField->Add("3 Powerups", 3); - miQuantityField->Add("4 Powerups", 4); - miQuantityField->Add("5 Powerups", 5); - miQuantityField->Add("# Players - 1", 6); - miQuantityField->Add("# Players", 7); - miQuantityField->Add("# Players + 1", 8, false, false); - miQuantityField->Add("# Players + 2", 9, false, false); - miQuantityField->Add("# Players + 3", 10, false, false); - miQuantityField->SetData(&game_values.gamemodemenusettings.frenzy.quantity, NULL, NULL); - miQuantityField->SetKey(game_values.gamemodemenusettings.frenzy.quantity); - - miRateField = new MI_SelectField(&rm->spr_selectfield, 120, 80, "Rate", 400, 180); - miRateField->Add("Instant", 0); - miRateField->Add("1 Second", 62); - miRateField->Add("2 Seconds", 124); - miRateField->Add("3 Seconds", 186); - miRateField->Add("5 Seconds", 310); - miRateField->Add("10 Seconds", 620, false, false); - miRateField->Add("15 Seconds", 930, false, false); - miRateField->Add("20 Seconds", 1240, false, false); - miRateField->Add("25 Seconds", 1550, false, false); - miRateField->Add("30 Seconds", 1860, false, false); - miRateField->SetData(&game_values.gamemodemenusettings.frenzy.rate, NULL, NULL); - miRateField->SetKey(game_values.gamemodemenusettings.frenzy.rate); + miQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 40, "Limit", 400, 180); + miQuantityField->add("Single Powerup", 0); + miQuantityField->add("1 Powerup", 1); + miQuantityField->add("2 Powerups", 2); + miQuantityField->add("3 Powerups", 3); + miQuantityField->add("4 Powerups", 4); + miQuantityField->add("5 Powerups", 5); + miQuantityField->add("# Players - 1", 6); + miQuantityField->add("# Players", 7); + miQuantityField->add("# Players + 1", 8, false); + miQuantityField->add("# Players + 2", 9, false); + miQuantityField->add("# Players + 3", 10, false); + miQuantityField->setOutputPtr(&game_values.gamemodemenusettings.frenzy.quantity); + miQuantityField->setCurrentValue(game_values.gamemodemenusettings.frenzy.quantity); + + miRateField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 80, "Rate", 400, 180); + miRateField->add("Instant", 0); + miRateField->add("1 Second", 62); + miRateField->add("2 Seconds", 124); + miRateField->add("3 Seconds", 186); + miRateField->add("5 Seconds", 310); + miRateField->add("10 Seconds", 620, false); + miRateField->add("15 Seconds", 930, false); + miRateField->add("20 Seconds", 1240, false); + miRateField->add("25 Seconds", 1550, false); + miRateField->add("30 Seconds", 1860, false); + miRateField->setOutputPtr(&game_values.gamemodemenusettings.frenzy.rate); + miRateField->setCurrentValue(game_values.gamemodemenusettings.frenzy.rate); miStoredShellsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 120, "Store Shells", 400, 180); miStoredShellsField->add("Off", false); @@ -238,8 +238,8 @@ void MI_FrenzyModeOptions::MovePrev() void MI_FrenzyModeOptions::SetRandomGameModeSettings() { - game_values.gamemodesettings.frenzy.quantity = miQuantityField->GetRandomShortValue(); - game_values.gamemodesettings.frenzy.rate = miRateField->GetRandomShortValue(); + game_values.gamemodesettings.frenzy.quantity = miQuantityField->randomValue(); + game_values.gamemodesettings.frenzy.rate = miRateField->randomValue(); game_values.gamemodesettings.frenzy.storedshells = miStoredShellsField->randomValue(); for (short iPowerup = 0; iPowerup < NUMFRENZYCARDS; iPowerup++) diff --git a/src/smw/ui/MI_FrenzyModeOptions.h b/src/smw/ui/MI_FrenzyModeOptions.h index a50954ef..b8fd5f95 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.h +++ b/src/smw/ui/MI_FrenzyModeOptions.h @@ -42,8 +42,8 @@ class MI_FrenzyModeOptions : public UI_Control UI_Menu * mMenu; - MI_SelectField * miQuantityField; - MI_SelectField * miRateField; + MI_SelectFieldDyn * miQuantityField; + MI_SelectFieldDyn * miRateField; MI_SelectFieldDyn* miStoredShellsField; MI_PowerupSlider * miPowerupSlider[NUMFRENZYCARDS]; MI_Button * miBackButton; diff --git a/src/smw/ui/MI_InputControlContainer.cpp b/src/smw/ui/MI_InputControlContainer.cpp index b74296ee..23623a2d 100644 --- a/src/smw/ui/MI_InputControlContainer.cpp +++ b/src/smw/ui/MI_InputControlContainer.cpp @@ -392,9 +392,9 @@ MI_InputControlContainer::MI_InputControlContainer(gfxSprite * spr_button, short miImage[0] = new MI_Image(spr_button, 0, 0, 0, 0, 320, 32, 1, 1, 0); miImage[1] = new MI_Image(spr_button, 320, 0, 192, 0, 320, 32, 1, 1, 0); - miDeviceSelectField = new MI_SelectField(spr_button, x + 16, y + 38, "Device", 420, 150); - miDeviceSelectField->SetItemChangedCode(MENU_CODE_INPUT_DEVICE_CHANGED); - miDeviceSelectField->Add("Keyboard", -1); + miDeviceSelectField = new MI_SelectFieldDyn(spr_button, x + 16, y + 38, "Device", 420, 150); + miDeviceSelectField->setItemChangedCode(MENU_CODE_INPUT_DEVICE_CHANGED); + miDeviceSelectField->add("Keyboard", -1); #ifdef _XBOX miDeviceSelectField->Disable(true); @@ -407,17 +407,17 @@ MI_InputControlContainer::MI_InputControlContainer(gfxSprite * spr_button, short #else for (short iJoystick = 0; iJoystick < joystickcount; iJoystick++) { #ifdef USE_SDL2 - miDeviceSelectField->Add(SDL_JoystickNameForIndex(iJoystick), iJoystick, "", false, false); + miDeviceSelectField->add(SDL_JoystickNameForIndex(iJoystick), iJoystick, false); #else - miDeviceSelectField->Add(SDL_JoystickName(iJoystick), iJoystick, "", false, false); + miDeviceSelectField->add(SDL_JoystickName(iJoystick), iJoystick, false); #endif } #endif //If the device is not found, default to the keyboard - if (!miDeviceSelectField->SetKey(iDevice)) { + if (!miDeviceSelectField->setCurrentValue(iDevice)) { iDevice = DEVICE_KEYBOARD; - miDeviceSelectField->SetKey(iDevice); + miDeviceSelectField->setCurrentValue(iDevice); } miInputTypeButton = new MI_Button(spr_button, x + 336, y + 84, "Game", 100, TextAlign::CENTER); @@ -521,7 +521,7 @@ MenuCodeEnum MI_InputControlContainer::SendInput(CPlayerInput * playerInput) //Need to handle case where reading in and using a device that is no longer //an option will crash the system (joystick unplugged or something) - UpdateDeviceKeys(miDeviceSelectField->GetShortValue()); + UpdateDeviceKeys(miDeviceSelectField->currentValue()); playerInput->ResetKeys(); return MENU_CODE_NONE; @@ -538,7 +538,7 @@ MenuCodeEnum MI_InputControlContainer::Modify(bool modify) void MI_InputControlContainer::SetVisibleInputFields() { - int selDevice = miDeviceSelectField->GetShortValue(); + int selDevice = miDeviceSelectField->currentValue(); for (int iKey = 0; iKey < NUM_KEYS; iKey++) { miGameInputControlFields[iKey]->Show(0 == iSelectedInputType && (iKey < 6 || DEVICE_KEYBOARD != selDevice || iPlayerID == 0)); @@ -552,19 +552,19 @@ void MI_InputControlContainer::SetVisibleInputFields() void MI_InputControlContainer::SetPlayer(short playerID) { //Hide input options that other players are using - miDeviceSelectField->HideAllItems(false); + miDeviceSelectField->hideAllItems(false); for (short iPlayer = 0; iPlayer < 4; iPlayer++) { if (iPlayer == playerID) continue; if (game_values.playerInput.inputControls[iPlayer]->iDevice > -1) - miDeviceSelectField->HideItem(game_values.playerInput.inputControls[iPlayer]->iDevice, true); + miDeviceSelectField->hideItem(game_values.playerInput.inputControls[iPlayer]->iDevice, true); } iPlayerID = playerID; iDevice = game_values.playerInput.inputControls[iPlayerID]->iDevice; - miDeviceSelectField->SetKey(iDevice); + miDeviceSelectField->setCurrentValue(iDevice); for (int iKey = 0; iKey < NUM_KEYS; iKey++) { miGameInputControlFields[iKey]->SetDevice(iDevice); diff --git a/src/smw/ui/MI_InputControlContainer.h b/src/smw/ui/MI_InputControlContainer.h index 4edcd11e..80ac910e 100644 --- a/src/smw/ui/MI_InputControlContainer.h +++ b/src/smw/ui/MI_InputControlContainer.h @@ -6,8 +6,8 @@ class gfxSprite; class MI_Image; class MI_Text; -class MI_SelectField; class MI_Button; +template class MI_SelectFieldDyn; class MI_InputControlField : public UI_Control { @@ -86,7 +86,7 @@ class MI_InputControlContainer : public UI_Control MI_Image * miImage[2]; MI_Text * miText; - MI_SelectField * miDeviceSelectField; + MI_SelectFieldDyn* miDeviceSelectField; MI_Button * miInputTypeButton; MI_InputControlField * miGameInputControlFields[NUM_KEYS]; MI_InputControlField * miMenuInputControlFields[NUM_KEYS]; diff --git a/src/smw/ui/MI_PowerupSelection.cpp b/src/smw/ui/MI_PowerupSelection.cpp index f8d6d51b..943f7497 100644 --- a/src/smw/ui/MI_PowerupSelection.cpp +++ b/src/smw/ui/MI_PowerupSelection.cpp @@ -75,36 +75,36 @@ MI_PowerupSelection::MI_PowerupSelection(short x, short y, short width, short nu { mMenu = std::make_unique(); - miOverride = new MI_SelectField(&rm->spr_selectfield, 70, iy, "Use Settings From", 500, 250); - miOverride->Add("Map Only", 0); - miOverride->Add("Game Only", 1); - miOverride->Add("Basic Average", 2); - miOverride->Add("Weighted Average", 3); - miOverride->SetData(&game_values.overridepowerupsettings, NULL, NULL); - miOverride->SetKey(game_values.overridepowerupsettings); + miOverride = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, iy, "Use Settings From", 500, 250); + miOverride->add("Map Only", 0); + miOverride->add("Game Only", 1); + miOverride->add("Basic Average", 2); + miOverride->add("Weighted Average", 3); + miOverride->setOutputPtr(&game_values.overridepowerupsettings); + miOverride->setCurrentValue(game_values.overridepowerupsettings); //miOverride->SetItemChangedCode(MENU_CODE_POWERUP_OVERRIDE_CHANGED); - miPreset = new MI_SelectField(&rm->spr_selectfield, 70, iy + 40, "Item Set", 500, 250); - miPreset->Add("Custom Set 1", 0); - miPreset->Add("Custom Set 2", 1); - miPreset->Add("Custom Set 3", 2); - miPreset->Add("Custom Set 4", 3); - miPreset->Add("Custom Set 5", 4); - miPreset->Add("Balanced Set", 5); - miPreset->Add("Weapons Only", 6); - miPreset->Add("Koopa Bros Weapons", 7); - miPreset->Add("Support Items", 8); - miPreset->Add("Booms and Shakes", 9); - miPreset->Add("Fly and Glide", 10); - miPreset->Add("Shells Only", 11); - miPreset->Add("Mushrooms Only", 12); - miPreset->Add("Super Mario Bros 1", 13); - miPreset->Add("Super Mario Bros 2", 14); - miPreset->Add("Super Mario Bros 3", 15); - miPreset->Add("Super Mario World", 16); - miPreset->SetData(&game_values.poweruppreset, NULL, NULL); - miPreset->SetKey(game_values.poweruppreset); - miPreset->SetItemChangedCode(MENU_CODE_POWERUP_PRESET_CHANGED); + miPreset = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, iy + 40, "Item Set", 500, 250); + miPreset->add("Custom Set 1", 0); + miPreset->add("Custom Set 2", 1); + miPreset->add("Custom Set 3", 2); + miPreset->add("Custom Set 4", 3); + miPreset->add("Custom Set 5", 4); + miPreset->add("Balanced Set", 5); + miPreset->add("Weapons Only", 6); + miPreset->add("Koopa Bros Weapons", 7); + miPreset->add("Support Items", 8); + miPreset->add("Booms and Shakes", 9); + miPreset->add("Fly and Glide", 10); + miPreset->add("Shells Only", 11); + miPreset->add("Mushrooms Only", 12); + miPreset->add("Super Mario Bros 1", 13); + miPreset->add("Super Mario Bros 2", 14); + miPreset->add("Super Mario Bros 3", 15); + miPreset->add("Super Mario World", 16); + miPreset->setOutputPtr(&game_values.poweruppreset); + miPreset->setCurrentValue(game_values.poweruppreset); + miPreset->setItemChangedCode(MENU_CODE_POWERUP_PRESET_CHANGED); for (short iPowerup = 0; iPowerup < NUM_POWERUPS; iPowerup++) { miPowerupSlider[iPowerup] = new MI_PowerupSlider(&rm->spr_selectfield, &rm->menu_slider_bar, &rm->spr_storedpoweruplarge, 0, 0, 245, iPowerupPositionMap[iPowerup]); diff --git a/src/smw/ui/MI_PowerupSelection.h b/src/smw/ui/MI_PowerupSelection.h index f8f395c5..f970ef7b 100644 --- a/src/smw/ui/MI_PowerupSelection.h +++ b/src/smw/ui/MI_PowerupSelection.h @@ -9,9 +9,9 @@ class MI_Button; class MI_Image; class MI_PowerupSlider; -class MI_SelectField; class MI_Text; class UI_Menu; +template class MI_SelectFieldDyn; class MI_PowerupSelection : public UI_Control { @@ -42,8 +42,8 @@ class MI_PowerupSelection : public UI_Control { // TODO: Ownership of most members gets passed to this menu std::unique_ptr mMenu; - MI_SelectField* miOverride = nullptr; - MI_SelectField* miPreset = nullptr; + MI_SelectFieldDyn* miOverride = nullptr; + MI_SelectFieldDyn* miPreset = nullptr; std::array miPowerupSlider; diff --git a/src/smw/ui/MI_TourStop.cpp b/src/smw/ui/MI_TourStop.cpp index 28e60e8e..001a1f41 100644 --- a/src/smw/ui/MI_TourStop.cpp +++ b/src/smw/ui/MI_TourStop.cpp @@ -28,10 +28,10 @@ MI_TourStop::MI_TourStop(short x, short y, bool fWorld) { if (fIsWorld) { miModeField = std::make_unique(&rm->spr_selectfielddisabled, &rm->menu_mode_small, 70, 85, "Mode", 305, 90, 16, 16); - miGoalField = std::make_unique(&rm->spr_selectfielddisabled, 380, 85, "Goal", 190, 90); - miPointsField = std::make_unique(&rm->spr_selectfielddisabled, 380, 125, "Score", 190, 90); + miGoalField = std::make_unique>(&rm->spr_selectfielddisabled, 380, 85, "Goal", 190, 90); + miPointsField = std::make_unique>(&rm->spr_selectfielddisabled, 380, 125, "Score", 190, 90); - miBonusField = std::make_unique(&rm->spr_selectfielddisabled, 70, 125, "Bonus", 305, 90); + miBonusField = std::make_unique>(&rm->spr_selectfielddisabled, 70, 125, "Bonus", 305, 90); miBonusField->Disable(true); miEndStageImage[0] = std::make_unique(&rm->spr_worlditemsplace, 54, 201, 0, 20, 80, 248, 1, 1, 0); @@ -49,8 +49,8 @@ MI_TourStop::MI_TourStop(short x, short y, bool fWorld) } } else { miModeField = std::make_unique(&rm->spr_selectfielddisabled, &rm->menu_mode_small, 70, 85, "Mode", 500, 120, 16, 16); - miGoalField = std::make_unique(&rm->spr_selectfielddisabled, 70, 125, "Goal", 246, 120); - miPointsField = std::make_unique(&rm->spr_selectfielddisabled, 70 + 254, 125, "Score", 246, 120); + miGoalField = std::make_unique>(&rm->spr_selectfielddisabled, 70, 125, "Goal", 246, 120); + miPointsField = std::make_unique>(&rm->spr_selectfielddisabled, 70 + 254, 125, "Score", 246, 120); miBonusField = 0; } @@ -151,15 +151,15 @@ void MI_TourStop::Refresh(short iTourStop) miModeField->add(gamemode->GetModeName(), tourstopicon); - miGoalField->Clear(); + miGoalField->clear(); char szTemp[16]; sprintf(szTemp, "%d", tourstop->iGoal); - miGoalField->Add(szTemp, 0, "", false, false); - miGoalField->SetTitle(gamemode->GetGoalName()); + miGoalField->add(szTemp, 0, false); + miGoalField->setTitle(gamemode->GetGoalName()); - miPointsField->Clear(); + miPointsField->clear(); sprintf(szTemp, "%d", tourstop->iPoints); - miPointsField->Add(szTemp, 0, "", false, false); + miPointsField->add(szTemp, 0, false); if (tourstop->iMode == game_mode_pipe_minigame) { bool fFound = miMapField->SetMap(tourstop->pszMapFile, true); @@ -190,7 +190,7 @@ void MI_TourStop::Refresh(short iTourStop) miTourStopMenuHeaderText->SetText(tourstop->szName); if (fIsWorld) { - miBonusField->Clear(); + miBonusField->clear(); miEndStageImage[0]->Show(tourstop->fEndStage); miEndStageImage[1]->Show(tourstop->fEndStage); diff --git a/src/smw/ui/MI_TourStop.h b/src/smw/ui/MI_TourStop.h index 4c3ddad7..ffdae671 100644 --- a/src/smw/ui/MI_TourStop.h +++ b/src/smw/ui/MI_TourStop.h @@ -8,8 +8,8 @@ class MI_Button; class MI_Image; class MI_ImageSelectField; class MI_MapField; -class MI_SelectField; class MI_Text; +template class MI_SelectFieldDyn; class MI_TourStop : public UI_Control { @@ -24,12 +24,12 @@ class MI_TourStop : public UI_Control { private: std::unique_ptr miModeField; - std::unique_ptr miGoalField; - std::unique_ptr miPointsField; + std::unique_ptr> miGoalField; + std::unique_ptr> miPointsField; std::unique_ptr miMapField; std::unique_ptr miStartButton; - std::unique_ptr miBonusField; + std::unique_ptr> miBonusField; std::array, 2> miEndStageImage; std::array, 10> miBonusIcon; From ce3cd395ab9f55b2a8b74300a02459d4a82e1252 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 13:59:13 +0200 Subject: [PATCH 11/14] Updated the world editor to use the new select field --- src/common/ui/MI_SelectField.h | 3 +- src/worldeditor/worldeditor.cpp | 176 ++++++++++++++++---------------- 2 files changed, 90 insertions(+), 89 deletions(-) diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index af60cd30..17050832 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -242,6 +242,8 @@ class MI_SelectFieldDyn : public UI_Control { void hideItem(T value, bool hide); //! Hides all items void hideAllItems(bool hide); + //! Updates the value pointed by the output pointer, if it's set + void updateOutput() const; public: void Update() override; //! Updates animations or other events every frame @@ -273,7 +275,6 @@ class MI_SelectFieldDyn : public UI_Control { size_t m_index = 0; T* m_outputPtr = nullptr; - void updateOutput() const; bool moveNext(); bool movePrev(); bool moveRandom(); diff --git a/src/worldeditor/worldeditor.cpp b/src/worldeditor/worldeditor.cpp index 62a645f5..70925ea7 100644 --- a/src/worldeditor/worldeditor.cpp +++ b/src/worldeditor/worldeditor.cpp @@ -357,16 +357,16 @@ UI_Menu mStageSettingsMenu; UI_Menu mBonusItemPicker; MI_ImageSelectField * miModeField; -MI_SelectField * miGoalField[GAMEMODE_LAST]; +MI_SelectFieldDyn * miGoalField[GAMEMODE_LAST]; MI_Button * miModeSettingsButton; MI_Button * miBonusItemsButton; -MI_SelectField * miSpecialGoalField[3]; +MI_SelectFieldDyn * miSpecialGoalField[3]; -MI_SelectField * miFinalStageField; -MI_SelectField * miPointsField; +MI_SelectFieldDyn * miFinalStageField; +MI_SelectFieldDyn * miPointsField; MI_TextField * miNameField; -MI_SelectField * miBonusType; +MI_SelectFieldDyn * miBonusType; MI_TextField * miBonusTextField[5]; MI_MapField * miMapField; @@ -383,11 +383,11 @@ MI_Button * miDeleteStageDialogNoButton; UI_Menu mVehicleMenu; MI_ImageSelectField * miVehicleSpriteField; MI_ImageSelectField * miVehicleStageField; -MI_SelectField * miVehicleMinMovesField; -MI_SelectField * miVehicleMaxMovesField; -MI_SelectField * miVehiclePacesField; -MI_SelectField * miVehicleDirectionField; -MI_SelectField * miVehicleBoundaryField; +MI_SelectFieldDyn * miVehicleMinMovesField; +MI_SelectFieldDyn * miVehicleMaxMovesField; +MI_SelectFieldDyn * miVehiclePacesField; +MI_SelectFieldDyn * miVehicleDirectionField; +MI_SelectFieldDyn * miVehicleBoundaryField; MI_Button * miVehicleCreateButton; MI_Text * miTitleText; @@ -655,12 +655,12 @@ int main(int argc, char *argv[]) for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { miModeField->add(stagemodes[iGameMode].szName, iGameMode); - miGoalField[iGameMode] = new MI_SelectField(&rm->spr_selectfield, 70, 100, stagemodes[iGameMode].szGoal, 352, 120); + miGoalField[iGameMode] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, stagemodes[iGameMode].szGoal, 352, 120); miGoalField[iGameMode]->Show(iGameMode == 0); for (short iGameModeOption = 0; iGameModeOption < GAMEMODE_NUM_OPTIONS - 1; iGameModeOption++) { StageModeOption * option = &stagemodes[iGameMode].options[iGameModeOption]; - miGoalField[iGameMode]->Add(option->szName, option->iValue); + miGoalField[iGameMode]->add(option->szName, option->iValue); } //miGoalField[iGameMode]->SetData(&gamemodes[iGameMode]->goal, NULL, NULL); @@ -673,34 +673,34 @@ int main(int argc, char *argv[]) miModeField->add("Boxes Minigame", 27); //Create goal field for pipe game - miSpecialGoalField[0] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Points", 352, 120); + miSpecialGoalField[0] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Points", 352, 120); miSpecialGoalField[0]->Show(false); for (short iGameModeOption = 0; iGameModeOption < GAMEMODE_NUM_OPTIONS - 1; iGameModeOption++) { short iValue = 10 + iGameModeOption * 10; char szName[16]; sprintf(szName, "%d", iValue); - miSpecialGoalField[0]->Add(szName, iValue, "", false, false); + miSpecialGoalField[0]->add(szName, iValue); } //Create goal field for boss game - miSpecialGoalField[1] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); + miSpecialGoalField[1] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); miSpecialGoalField[1]->Show(false); for (short iGameLives = 1; iGameLives <= 30; iGameLives++) { char szName[16]; sprintf(szName, "%d", iGameLives); - miSpecialGoalField[1]->Add(szName, iGameLives, "", false, false); + miSpecialGoalField[1]->add(szName, iGameLives); } //Create goal field for boxes game - miSpecialGoalField[2] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); + miSpecialGoalField[2] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); miSpecialGoalField[2]->Show(false); for (short iGameLives = 1; iGameLives <= 30; iGameLives++) { char szName[16]; sprintf(szName, "%d", iGameLives); - miSpecialGoalField[2]->Add(szName, iGameLives, "", false, false); + miSpecialGoalField[2]->add(szName, iGameLives); } //Mode Settings Button @@ -708,18 +708,18 @@ int main(int argc, char *argv[]) miModeSettingsButton->SetCode(MENU_CODE_TO_MODE_SETTINGS_MENU); //Points Field - miPointsField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Points", 245, 120); + miPointsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 140, "Points", 245, 120); for (short iPoints = 0; iPoints <= 20; iPoints++) { char szPoints[8]; sprintf(szPoints, "%d", iPoints); - miPointsField->Add(szPoints, iPoints, "", false, false); + miPointsField->add(szPoints, iPoints); } //Final Stage Field - miFinalStageField = new MI_SelectField(&rm->spr_selectfield, 325, 140, "End Stage", 245, 120); - miFinalStageField->Add("No", 0); - miFinalStageField->Add("Yes", 1, "", true, false); - miFinalStageField->SetAutoAdvance(true); + miFinalStageField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 140, "End Stage", 245, 120); + miFinalStageField->add("No", false); + miFinalStageField->add("Yes", true); + miFinalStageField->setAutoAdvance(true); //Map Select Field miMapField = new MI_MapField(&rm->spr_selectfield, 70, 180, "Map", 500, 120, true); @@ -729,10 +729,10 @@ int main(int argc, char *argv[]) miBonusItemsButton->SetCode(MENU_CODE_TO_BONUS_PICKER_MENU); //Bonus Type - miBonusType = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Type", 500, 120); - miBonusType->Add("Fixed", 0); - miBonusType->Add("Random", 1, "", true, false); - miBonusType->SetAutoAdvance(true); + miBonusType = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Type", 500, 120); + miBonusType->add("Fixed", false); + miBonusType->add("Random", true); + miBonusType->setAutoAdvance(true); //Bonus House Text * 5 miBonusTextField[0] = new MI_TextField(&rm->spr_selectfield, 70, 140, "Text", 500, 120); @@ -853,60 +853,60 @@ int main(int argc, char *argv[]) miVehicleStageField = new MI_ImageSelectField(&rm->spr_selectfield, &rm->menu_mode_small, 70, 120, "Stage", 500, 150, 16, 16); miVehicleStageField->setOutputPtr(&g_wvVehicleStamp.iActionId); - miVehicleMinMovesField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Min Moves", 500, 150); + miVehicleMinMovesField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Min Moves", 500, 150); for (short iMinMoves = 0; iMinMoves <= 100; iMinMoves++) { char szMinMoves[8]; sprintf(szMinMoves, "%d", iMinMoves); - miVehicleMinMovesField->Add(szMinMoves, iMinMoves, "", false, false); + miVehicleMinMovesField->add(szMinMoves, iMinMoves); } - miVehicleMinMovesField->SetData(&g_wvVehicleStamp.iMinMoves, NULL, NULL); - miVehicleMinMovesField->SetKey(g_wvVehicleStamp.iMinMoves); - miVehicleMinMovesField->SetItemChangedCode(MENU_CODE_VEHICLE_MIN_MOVES_CHANGED); - miVehicleMinMovesField->SetNoWrap(true); - miVehicleMinMovesField->AllowFastScroll(true); + miVehicleMinMovesField->setOutputPtr(&g_wvVehicleStamp.iMinMoves); + miVehicleMinMovesField->setCurrentValue(g_wvVehicleStamp.iMinMoves); + miVehicleMinMovesField->setItemChangedCode(MENU_CODE_VEHICLE_MIN_MOVES_CHANGED); + miVehicleMinMovesField->allowWrap(false); + miVehicleMinMovesField->allowFastScroll(true); - miVehicleMaxMovesField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Max Moves", 500, 150); + miVehicleMaxMovesField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Max Moves", 500, 150); for (short iMaxMoves = 0; iMaxMoves <= 100; iMaxMoves++) { char szMaxMoves[8]; sprintf(szMaxMoves, "%d", iMaxMoves); - miVehicleMaxMovesField->Add(szMaxMoves, iMaxMoves, "", false, false); + miVehicleMaxMovesField->add(szMaxMoves, iMaxMoves); } - miVehicleMaxMovesField->SetData(&g_wvVehicleStamp.iMaxMoves, NULL, NULL); - miVehicleMaxMovesField->SetKey(g_wvVehicleStamp.iMaxMoves); - miVehicleMaxMovesField->SetItemChangedCode(MENU_CODE_VEHICLE_MAX_MOVES_CHANGED); - miVehicleMaxMovesField->SetNoWrap(true); - miVehicleMaxMovesField->AllowFastScroll(true); - - miVehiclePacesField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Paces", 500, 150); - miVehiclePacesField->Add("No", 0); - miVehiclePacesField->Add("Yes", 1, "", true, false); - miVehiclePacesField->SetData(NULL, NULL, &g_wvVehicleStamp.fSpritePaces); - miVehiclePacesField->SetKey(g_wvVehicleStamp.fSpritePaces ? 1 : 0); - miVehiclePacesField->SetAutoAdvance(true); - - miVehicleDirectionField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Direction", 500, 150); - miVehicleDirectionField->Add("Left", 0); - miVehicleDirectionField->Add("Right", 1, "", true, false); - miVehiclePacesField->SetData(&g_wvVehicleStamp.iDrawDirection, NULL, NULL); - miVehiclePacesField->SetKey(g_wvVehicleStamp.iDrawDirection); - miVehicleDirectionField->SetAutoAdvance(true); - - miVehicleBoundaryField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Boundary", 500, 150); - miVehicleBoundaryField->Add("No Boundary", 0); + miVehicleMaxMovesField->setOutputPtr(&g_wvVehicleStamp.iMaxMoves); + miVehicleMaxMovesField->setCurrentValue(g_wvVehicleStamp.iMaxMoves); + miVehicleMaxMovesField->setItemChangedCode(MENU_CODE_VEHICLE_MAX_MOVES_CHANGED); + miVehicleMaxMovesField->allowWrap(false); + miVehicleMaxMovesField->allowFastScroll(true); + + miVehiclePacesField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 240, "Paces", 500, 150); + miVehiclePacesField->add("No", false); + miVehiclePacesField->add("Yes", true); + miVehiclePacesField->setOutputPtr(&g_wvVehicleStamp.fSpritePaces); + miVehiclePacesField->setCurrentValue(g_wvVehicleStamp.fSpritePaces ? 1 : 0); + miVehiclePacesField->setAutoAdvance(true); + + miVehicleDirectionField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Direction", 500, 150); + miVehicleDirectionField->add("Left", false); + miVehicleDirectionField->add("Right", true); + miVehicleDirectionField->setOutputPtr(&g_wvVehicleStamp.iDrawDirection); + miVehicleDirectionField->setCurrentValue(g_wvVehicleStamp.iDrawDirection); + miVehicleDirectionField->setAutoAdvance(true); + + miVehicleBoundaryField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 320, "Boundary", 500, 150); + miVehicleBoundaryField->add("No Boundary", 0); for (short iBoundary = 1; iBoundary <= 100; iBoundary++) { char szBoundary[8]; sprintf(szBoundary, "%d", iBoundary); - miVehicleBoundaryField->Add(szBoundary, iBoundary, "", false, false); + miVehicleBoundaryField->add(szBoundary, iBoundary); } - miVehicleBoundaryField->SetData(&g_wvVehicleStamp.iBoundary, NULL, NULL); - miVehicleBoundaryField->SetKey(g_wvVehicleStamp.iBoundary); - miVehicleBoundaryField->AllowFastScroll(true); + miVehicleBoundaryField->setOutputPtr(&g_wvVehicleStamp.iBoundary); + miVehicleBoundaryField->setCurrentValue(g_wvVehicleStamp.iBoundary); + miVehicleBoundaryField->allowFastScroll(true); miVehicleCreateButton = new MI_Button(&rm->spr_selectfield, 430, 360, "OK", 140, TextAlign::CENTER); miVehicleCreateButton->SetCode(MENU_CODE_CREATE_VEHICLE); @@ -1197,11 +1197,11 @@ int editor_edit() miVehicleSpriteField->setCurrentValue(g_wvVehicleStamp.iDrawSprite); miVehicleStageField->setCurrentValue(g_wvVehicleStamp.iActionId); - miVehicleMinMovesField->SetKey(g_wvVehicleStamp.iMinMoves); - miVehicleMaxMovesField->SetKey(g_wvVehicleStamp.iMaxMoves); - miVehiclePacesField->SetKey(g_wvVehicleStamp.fSpritePaces ? 1 : 0); - miVehicleDirectionField->SetKey(g_wvVehicleStamp.iDrawDirection); - miVehicleBoundaryField->SetKey(g_wvVehicleStamp.iBoundary); + miVehicleMinMovesField->setCurrentValue(g_wvVehicleStamp.iMinMoves); + miVehicleMaxMovesField->setCurrentValue(g_wvVehicleStamp.iMaxMoves); + miVehiclePacesField->setCurrentValue(g_wvVehicleStamp.fSpritePaces ? 1 : 0); + miVehicleDirectionField->setCurrentValue(g_wvVehicleStamp.iDrawDirection); + miVehicleBoundaryField->setCurrentValue(g_wvVehicleStamp.iBoundary); return EDITOR_VEHICLES; } @@ -3365,14 +3365,14 @@ int editor_vehicles() game_values.playerInput.ResetKeys(); return EDITOR_EDIT; } else if (MENU_CODE_VEHICLE_MIN_MOVES_CHANGED == code) { - short iMaxMoves = miVehicleMaxMovesField->GetShortValue(); - if (miVehicleMinMovesField->GetShortValue() > iMaxMoves) { - miVehicleMinMovesField->SetKey(iMaxMoves); + short iMaxMoves = miVehicleMaxMovesField->currentValue(); + if (miVehicleMinMovesField->currentValue() > iMaxMoves) { + miVehicleMinMovesField->setCurrentValue(iMaxMoves); } } else if (MENU_CODE_VEHICLE_MAX_MOVES_CHANGED == code) { - short iMinMoves = miVehicleMinMovesField->GetShortValue(); - if (miVehicleMaxMovesField->GetShortValue() < iMinMoves) { - miVehicleMaxMovesField->SetKey(iMinMoves); + short iMinMoves = miVehicleMinMovesField->currentValue(); + if (miVehicleMaxMovesField->currentValue() < iMinMoves) { + miVehicleMaxMovesField->setCurrentValue(iMinMoves); } } else if (MENU_CODE_CREATE_VEHICLE == code) { edit_mode = 5; @@ -3710,15 +3710,15 @@ void EditStage(short iEditStage) miModeField->setOutputPtr(&ts->iMode); miNameField->SetData(ts->szName, 128); - miPointsField->SetData(&ts->iPoints, NULL, NULL); - miFinalStageField->SetData(NULL, NULL, &ts->fEndStage); + miPointsField->setOutputPtr(&ts->iPoints); + miFinalStageField->setOutputPtr(&ts->fEndStage); if (!ts->pszMapFile) ts->pszMapFile = maplist->currentShortmapname(); miMapField->SetMap(ts->pszMapFile, false); - miBonusType->SetData(&ts->iBonusType, NULL, NULL); + miBonusType->setOutputPtr(&ts->iBonusType); miBonusTextField[0]->SetData(ts->szBonusText[0], 128); miBonusTextField[1]->SetData(ts->szBonusText[1], 128); miBonusTextField[2]->SetData(ts->szBonusText[2], 128); @@ -3760,10 +3760,10 @@ void EditStage(short iEditStage) miGoalField[iGameMode]->Show(iMode == iGameMode); } - miGoalField[iMode]->SetData(&game_values.tourstops[iEditStage]->iGoal, NULL, NULL); - miGoalField[iMode]->SetKey(game_values.tourstops[iEditStage]->iGoal); - miPointsField->SetKey(game_values.tourstops[iEditStage]->iPoints); - miFinalStageField->SetKey(game_values.tourstops[iEditStage]->fEndStage ? 1 : 0); + miGoalField[iMode]->setOutputPtr(&game_values.tourstops[iEditStage]->iGoal); + miGoalField[iMode]->setCurrentValue(game_values.tourstops[iEditStage]->iGoal); + miPointsField->setCurrentValue(game_values.tourstops[iEditStage]->iPoints); + miFinalStageField->setCurrentValue(game_values.tourstops[iEditStage]->fEndStage ? 1 : 0); game_values.tourstops[iEditStage]->fUseSettings = true; game_values.tourstops[iEditStage]->iNumUsedSettings = g_iNumGameModeSettings[iMode]; @@ -3779,12 +3779,12 @@ void EditStage(short iEditStage) miModeField->setCurrentValue(24); } else if (iMode >= 1000 && iMode <= 1002) { //Pipe, Boss and Boxes Game miModeField->setCurrentValue(iMode - 975); - miSpecialGoalField[iMode-1000]->SetData(&game_values.tourstops[iEditStage]->iGoal, NULL, NULL); - miSpecialGoalField[iMode-1000]->SetKey(game_values.tourstops[iEditStage]->iGoal); - miPointsField->SetKey(game_values.tourstops[iEditStage]->iPoints); - miFinalStageField->SetKey(game_values.tourstops[iEditStage]->fEndStage ? 1 : 0); + miSpecialGoalField[iMode-1000]->setOutputPtr(&game_values.tourstops[iEditStage]->iGoal); + miSpecialGoalField[iMode-1000]->setCurrentValue(game_values.tourstops[iEditStage]->iGoal); + miPointsField->setCurrentValue(game_values.tourstops[iEditStage]->iPoints); + miFinalStageField->setCurrentValue(game_values.tourstops[iEditStage]->fEndStage ? 1 : 0); - //Have to set this back again since the SetKey() above will set it to 25 + //Have to set this back again since the setCurrentValue() above will set it to 25 game_values.tourstops[iEditStage]->iMode = iMode; } } @@ -4093,8 +4093,8 @@ int editor_stage() miGoalField[iGameMode]->Show(iMode == iGameMode); } - miGoalField[iMode]->SetData(&game_values.tourstops[iEditStage]->iGoal, NULL, NULL); - miGoalField[iMode]->SetValues(); + miGoalField[iMode]->setOutputPtr(&game_values.tourstops[iEditStage]->iGoal); + miGoalField[iMode]->updateOutput(); game_values.tourstops[iEditStage]->iStageType = 0; From d0df013d2a4f1287e2a051b71b482bd931d291d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 14:09:00 +0200 Subject: [PATCH 12/14] Removed the old select field code --- src/common/ui/MI_SelectField.cpp | 477 +------------------------------ src/common/ui/MI_SelectField.h | 159 +---------- src/smw/ui/MI_PowerupSlider.cpp | 1 + 3 files changed, 5 insertions(+), 632 deletions(-) diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index b6bbd888..27109db9 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -1,486 +1,13 @@ #include "MI_SelectField.h" #include "input.h" +#include "RandomNumberGenerator.h" #include "ResourceManager.h" +#include "gfx/gfxSprite.h" #include "ui/MI_Image.h" extern CResourceManager* rm; -#include - -/************************************** - * MI_SelectField Class - **************************************/ - -MI_SelectField::MI_SelectField(gfxSprite * nspr, short x, short y, std::string name, short width, short indent) - : UI_Control(x, y) - , spr(nspr) - , szName(std::move(name)) - , iWidth(width) - , iIndent(indent) - , iAdjustmentY(width > 256 ? 0 : 128) -{ - miModifyImageLeft = std::make_unique(nspr, ix + indent - 26, iy + 4, 32, 64, 26, 24, 4, 1, 8); - miModifyImageLeft->Show(false); - - miModifyImageRight = std::make_unique(nspr, ix + iWidth - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); - miModifyImageRight->Show(false); -} - -MI_SelectField::MI_SelectField(const MI_SelectField& other) - : UI_Control(other) -{ - spr = other.spr; - szName = other.szName; - - SetData(other.iValue, other.sValue, other.fValue); - - for (unsigned i = 0; i < other.items.size(); i++) - items.push_back(new SF_ListItem(*other.items[i])); - - SetIndex(other.iIndex); // sets current and index - - for (unsigned i = 0; i < other.goodRandomItems.size(); i++) - goodRandomItems.push_back(new SF_ListItem(*other.goodRandomItems[i])); - - iWidth = other.iWidth; - iIndent = other.iIndent; - - miModifyImageLeft = std::make_unique(spr, ix + iIndent - 26, iy + 4, 32, 64, 26, 24, 4, 1, 8); - miModifyImageLeft->Show(false); - - miModifyImageRight = std::make_unique(spr, ix + iWidth - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); - miModifyImageRight->Show(false); - - mcItemChangedCode = other.mcItemChangedCode; - mcControlSelectedCode = other.mcControlSelectedCode; - - fAutoAdvance = other.fAutoAdvance; - fNoWrap = other.fNoWrap; - iAdjustmentY = other.iAdjustmentY; - fFastScroll = other.fFastScroll; -} - -MI_SelectField::~MI_SelectField() -{ - for (SF_ListItem* item : items) { - delete item; - } -} - -void MI_SelectField::SetTitle(std::string name) -{ - szName = std::move(name); -} - -//Sets current selected item based on the items int value -bool MI_SelectField::SetKey(short iID) -{ - if (items.empty()) - return false; - - std::vector::iterator search = items.begin(); - - iIndex = 0; - while (search != items.end()) { - if ((*search)->iValue == iID) { - current = search; - SetValues(); - return true; - } - - ++search; - ++iIndex; - } - - return false; -} - -bool MI_SelectField::SetIndex(unsigned short index) -{ - if (index >= items.size()) - return false; - - current = items.begin(); - - for (unsigned int iSearch = 0; iSearch < index; iSearch++) { - ++current; - } - - iIndex = index; - - SetValues(); - - return true; -} - -void MI_SelectField::Add(std::string name, short ivalue) -{ - Add(std::move(name), ivalue, false); -} - -void MI_SelectField::Add(std::string name, short ivalue, bool fhidden, bool fGoodRandom, short iIconOverride) -{ - SF_ListItem * item = new SF_ListItem(name, ivalue, fhidden, iIconOverride); - items.push_back(item); - - if (fGoodRandom) - goodRandomItems.push_back(item); - - if (items.size() >= 1) { - current = items.begin(); - iIndex = 0; - } -} - -bool MI_SelectField::HideItem(short iID, bool fhide) -{ - if (items.empty()) - return false; - - std::vector::iterator search = items.begin(), lim = items.end(); - - while (search != lim) { - if ((*search)->iValue == iID) { - if (current == search && fhide) { - if (!MoveNext()) - MovePrev(); - } - - (*search)->fHidden = fhide; - return true; - } - - ++search; - } - - return false; -} - -void MI_SelectField::HideAllItems(bool fHide) -{ - if (items.empty()) - return; - - std::vector::iterator itr = items.begin(); - - while (itr != items.end()) { - (*itr)->fHidden = fHide; - ++itr; - } -} - -MenuCodeEnum MI_SelectField::Modify(bool modify) -{ - if (fDisable) - return MENU_CODE_UNSELECT_ITEM; - - if (fAutoAdvance && modify) { - if (!items.empty()) { - if (current == --items.end()) { - current = items.begin(); - iIndex = 0; - } else { - ++current; - ++iIndex; - } - - //Saves the values to the pointed to values - SetValues(); - } - - return mcItemChangedCode; - } - - if (MENU_CODE_NONE != mcControlSelectedCode) - return mcControlSelectedCode; - - miModifyImageLeft->Show(modify); - miModifyImageRight->Show(modify); - fModifying = modify; - return MENU_CODE_MODIFY_ACCEPTED; -} - -MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) -{ - for (int iPlayer = 0; iPlayer < 4; iPlayer++) { - short iNumMoves = 1; - if (fFastScroll && playerInput->outputControls[iPlayer].menu_scrollfast.fDown) - iNumMoves = 10; - - if (playerInput->outputControls[iPlayer].menu_right.fPressed || playerInput->outputControls[iPlayer].menu_down.fPressed) { - bool fMoved = false; - - for (short iMove = 0; iMove < iNumMoves; iMove++) - fMoved |= MoveNext(); - - if (fMoved) - return mcItemChangedCode; - } - - if (playerInput->outputControls[iPlayer].menu_left.fPressed || playerInput->outputControls[iPlayer].menu_up.fPressed) { - bool fMoved = false; - - for (short iMove = 0; iMove < iNumMoves; iMove++) - fMoved |= MovePrev(); - - if (fMoved) - return mcItemChangedCode; - } - - if (playerInput->outputControls[iPlayer].menu_random.fPressed) { - if (MoveRandom()) - return mcItemChangedCode; - } - - if (playerInput->outputControls[iPlayer].menu_select.fPressed || playerInput->outputControls[iPlayer].menu_cancel.fPressed) { - miModifyImageLeft->Show(false); - miModifyImageRight->Show(false); - - fModifying = false; - - SetValues(); - - return MENU_CODE_UNSELECT_ITEM; - } - } - - return MENU_CODE_NONE; -} - - -void MI_SelectField::Update() -{ - miModifyImageRight->Update(); - miModifyImageLeft->Update(); -} - -void MI_SelectField::Draw() -{ - if (!fShow) - return; - - if (iIndent == 0) { - short iHalfWidth = iWidth >> 1; - spr->draw(ix, iy, 0, (fSelected ? 32 : 0) + iAdjustmentY, iHalfWidth, 32); - spr->draw(ix + iHalfWidth, iy, 512 - iHalfWidth, (fSelected ? 32 : 0) + iAdjustmentY, iWidth - iHalfWidth, 32); - } else { - spr->draw(ix, iy, 0, (fSelected ? 32 : 0) + iAdjustmentY, iIndent - 16, 32); - spr->draw(ix + iIndent - 16, iy, 0, (fSelected ? 96 : 64), 32, 32); - spr->draw(ix + iIndent + 16, iy, 528 - iWidth + iIndent, (fSelected ? 32 : 0) + iAdjustmentY, iWidth - iIndent - 16, 32); - } - - if (iIndent> 0) - rm->menu_font_large.drawChopRight(ix + 16, iy + 5, iIndent - 8, szName.c_str()); - - // RFC - if (!items.empty()) { - if (iIndent > 0) - rm->menu_font_large.drawChopRight(ix + iIndent + 8, iy + 5, iWidth - iIndent - 24, (*current)->sName.c_str()); - else - rm->menu_font_large.drawChopRight(ix + 16, iy + 5, iWidth - 32, (*current)->sName.c_str()); - } - - //TODO: invert order - bool drawLeft = true; - - if ((items.begin() != items.end() && current == items.begin())) - drawLeft = false; - - if (!fNoWrap || drawLeft) - miModifyImageLeft->Draw(); - - //TODO: invert order - - bool drawRight = true; - - if (items.end() != items.begin()) { - - if (items.begin() != --items.end()) { - - if (current == --items.end()) - drawRight = false; - } - } - - if (drawRight || !fNoWrap) - miModifyImageRight->Draw(); -} - -void MI_SelectField::SetValues() -{ - if (iValue) - *iValue = (*current)->iValue; -} - -bool MI_SelectField::MoveNext() -{ - if (items.empty()) - return false; - - std::vector::iterator findNext = current; - short iFindIndex = iIndex; - - while (true) { - if (findNext == --items.end()) { - if (fNoWrap) { - return false; - } else { - findNext = items.begin(); - iFindIndex = 0; - } - } else { - findNext++; - iFindIndex++; - } - - if (findNext == current) - return false; - - if (!(*findNext)->fHidden) { - current = findNext; - iIndex = iFindIndex; - SetValues(); - return true; - } - } - - return false; -} - -bool MI_SelectField::MovePrev() -{ - if (items.empty()) - return false; - - std::vector::iterator findPrev = current; - short iFindIndex = iIndex; - - while (true) { - if (findPrev == items.begin()) { - if (fNoWrap) { - return false; - } else { - findPrev = --items.end(); - iFindIndex = (signed short)items.size() - 1; - } - } else { - findPrev--; - iFindIndex--; - } - - if (findPrev == current) - return false; - - if (!(*findPrev)->fHidden) { - current = findPrev; - iIndex = iFindIndex; - SetValues(); - return true; - } - } - - return false; -} - -bool MI_SelectField::MoveRandom() -{ - //Can't pick a random item from a list of 1 - if (items.size() <= 1) - return false; - - std::vector::iterator searchHidden = items.begin(); - - short iHiddenCount = 0; - while (searchHidden != items.end()) { - if ((*searchHidden)->fHidden) { - iHiddenCount++; - } - - ++searchHidden; - } - - //Can't pick a random item from a list containing only 1 non-hidden item - if (items.size() - iHiddenCount <= 1) - return false; - - std::vector::iterator findRandom = current; - short iFindIndex = iIndex; - - while (true) { - int index = RANDOM_INT(items.size()); - - for (int k = 0; k < index; k++) { - if (findRandom == --items.end()) { - findRandom = items.begin(); - iFindIndex = 0; - } else { - ++findRandom; - ++iFindIndex; - } - } - - if (findRandom != current && !(*findRandom)->fHidden) { - current = findRandom; - iIndex = iFindIndex; - SetValues(); - return true; - } - } - - SetValues(); - return true; -} - -MenuCodeEnum MI_SelectField::MouseClick(short iMouseX, short iMouseY) -{ - if (fDisable) - return MENU_CODE_NONE; - - //If we are modifying this control, see if we clicked on a next/prev button - if (fModifying) { - short x, y, w, h; - miModifyImageLeft->GetPositionAndSize(x, y, w, h); - - if (iMouseX >= x && iMouseX < x + w && - iMouseY >= y && iMouseY < y + h) { - if (MovePrev()) { - if (mcItemChangedCode == MENU_CODE_NONE) - return MENU_CODE_CLICKED; - - return mcItemChangedCode; - } - } - - miModifyImageRight->GetPositionAndSize(x, y, w, h); - - if (iMouseX >= x && iMouseX < x + w && - iMouseY >= y && iMouseY < y + h) { - if (MoveNext()) { - if (mcItemChangedCode == MENU_CODE_NONE) - return MENU_CODE_CLICKED; - - return mcItemChangedCode; - } - } - } - - //Otherwise just check to see if we clicked on the whole control - if (iMouseX >= ix && iMouseX < ix + iWidth && iMouseY >= iy && iMouseY < iy + 32) - return MENU_CODE_CLICKED; - - //Otherwise this control wasn't clicked at all - return MENU_CODE_NONE; -} - -void MI_SelectField::Refresh() -{ - if (iValue) - SetKey(*iValue); - else if (fValue) - SetKey(*fValue ? 1 : 0); -} - template MI_SelectFieldDyn::MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std::string name, short width, short indent) diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 17050832..1f2bb590 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -1,8 +1,6 @@ -#ifndef UI_SELECT_FIELD_H -#define UI_SELECT_FIELD_H +#pragma once #include "uicontrol.h" -#include "gfx/gfxSprite.h" #include "RandomNumberGenerator.h" #include @@ -11,159 +9,9 @@ #include +class gfxSprite; class MI_Image; -class SF_ListItem -{ -public: - SF_ListItem() { - sName = ""; - iValue = 0; - fHidden = false; - iIconOverride = -1; - } - - SF_ListItem(std::string sname, short ivalue, bool fhidden, short iiconoverride) { - sName = sname; - iValue = ivalue; - fHidden = fhidden; - iIconOverride = iiconoverride; - } - - SF_ListItem(const SF_ListItem& other) { - sName = other.sName; - iValue = other.iValue; - fHidden = other.fHidden; - iIconOverride = other.iIconOverride; - } - - ~SF_ListItem() {} - - std::string sName; //Display name - short iValue; //int data - bool fHidden; - short iIconOverride; -}; - -class MI_SelectField : public UI_Control -{ -public: - - MI_SelectField(gfxSprite * nspr, short x, short y, std::string name, short width, short indent); - MI_SelectField(const MI_SelectField&); - virtual ~MI_SelectField(); - - void SetTitle(std::string name); - - //When this control is selected, advance the value one instead of modifying the control - void SetAutoAdvance(bool advance) { - fAutoAdvance = advance; - } - void SetNoWrap(bool nowrap) { - fNoWrap = nowrap; - } - - //Gets the values of the currently selected item - short GetShortValue() { - return (*current)->iValue; - } - - //Gets a random value, but does not set the control to that value - short GetRandomShortValue() { - return goodRandomItems[RANDOM_INT(goodRandomItems.size())]->iValue; - } - - //sets the currently selected item - bool SetKey(short iID); - bool SetIndex(unsigned short iPosition); - - //Gets the currently selected item - SF_ListItem GetValue() { - return **current; - } - - //Called when user selects this control to change it's value - MenuCodeEnum Modify(bool modify); - - //Adds an item to the list - void Add(std::string name, short ivalue); - void Add(std::string name, short ivalue, bool fhidden, bool fGoodRandom = true, short iIconOverride = -1); - void Clear() { - items.clear(); - } - - bool HideItem(short iID, bool fhide); - void HideAllItems(bool fHide); - - //Updates animations or other events every frame - void Update(); - - //Draws every frame - virtual void Draw(); - - //Sends player input to control on every frame - virtual MenuCodeEnum SendInput(CPlayerInput * playerInput); - - //When the item is changed, this code will be returned from SendInput() - void SetItemChangedCode(MenuCodeEnum code) { - mcItemChangedCode = code; - } - void SetControlSelectedCode(MenuCodeEnum code) { - mcControlSelectedCode = code; - } - - //Set where the data of this control is written to (some member of game_values probably) - void SetData(short * ivalue, std::string * svalue, bool * fvalue) { - iValue = ivalue; - sValue = svalue; - fValue = fvalue; - } - - MenuCodeEnum MouseClick(short iMouseX, short iMouseY); - - void Refresh(); - - void SetValues(); - - void AllowFastScroll(bool fastscroll) { - fFastScroll = fastscroll; - } - -protected: - bool MoveNext(); - bool MovePrev(); - bool MoveRandom(); - - gfxSprite* spr = nullptr; - std::string szName; - - short* iValue = nullptr; - std::string* sValue = nullptr; - bool* fValue = nullptr; - - std::vector items; - std::vector::iterator current; - - std::vector goodRandomItems; - - short iIndex = 0; - short iWidth = 0; - short iIndent = 0; - - std::unique_ptr miModifyImageLeft; - std::unique_ptr miModifyImageRight; - - MenuCodeEnum mcItemChangedCode = MENU_CODE_NONE; - MenuCodeEnum mcControlSelectedCode = MENU_CODE_NONE; - - bool fAutoAdvance = false; - bool fNoWrap = false; - - short iAdjustmentY = 0; - - bool fFastScroll = false; -}; - template struct SF_ListItemDyn { @@ -279,6 +127,3 @@ class MI_SelectFieldDyn : public UI_Control { bool movePrev(); bool moveRandom(); }; - - -#endif // UI_SELECT_FIELD_H diff --git a/src/smw/ui/MI_PowerupSlider.cpp b/src/smw/ui/MI_PowerupSlider.cpp index 89fd43a5..c907e72b 100644 --- a/src/smw/ui/MI_PowerupSlider.cpp +++ b/src/smw/ui/MI_PowerupSlider.cpp @@ -1,5 +1,6 @@ #include "MI_PowerupSlider.h" +#include "gfx/gfxSprite.h" #include "ui/MI_Image.h" From fdd68e83e9576311dec1dd491026abbef6812c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 14:09:36 +0200 Subject: [PATCH 13/14] Minor refactoring --- src/common/ui/MI_SelectField.cpp | 8 ++++++++ src/common/ui/MI_SelectField.h | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index 27109db9..b23a224b 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -210,6 +210,14 @@ void MI_SelectFieldDyn::Refresh() } +template +T MI_SelectFieldDyn::randomValue() const +{ + const size_t idx = m_goodRandomIndices.at(RANDOM_INT(m_goodRandomIndices.size())); + return m_items.at(idx).value; +} + + template bool MI_SelectFieldDyn::setCurrentValue(T value) { diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 1f2bb590..3a7010a0 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -1,7 +1,6 @@ #pragma once #include "uicontrol.h" -#include "RandomNumberGenerator.h" #include #include @@ -73,10 +72,7 @@ class MI_SelectFieldDyn : public UI_Control { return currentItem().value; } //! Gets a random value, but does not set the control to that value - T randomValue() const { - const size_t idx = m_goodRandomIndices.at(RANDOM_INT(m_goodRandomIndices.size())); - return m_items.at(idx).value; - } + T randomValue() const; //! Set the current selected item based on its value bool setCurrentValue(T value); From 05825636d207e7178f47f5165a545ecd7c924351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ty=C3=A1s=20Mustoha?= Date: Sun, 31 Mar 2024 14:15:27 +0200 Subject: [PATCH 14/14] Renamed the new select field class to match the old one's name --- src/common/ui/MI_ImageSelectField.cpp | 2 +- src/common/ui/MI_ImageSelectField.h | 2 +- src/common/ui/MI_SelectField.cpp | 42 +++---- src/common/ui/MI_SelectField.h | 14 +-- src/common/ui/MI_SliderField.cpp | 6 +- src/common/ui/MI_SliderField.h | 2 +- src/smw/menu/GameSettingsMenu.cpp | 2 +- src/smw/menu/GameSettingsMenu.h | 4 +- src/smw/menu/MatchSelectionMenu.cpp | 10 +- src/smw/menu/MatchSelectionMenu.h | 12 +- src/smw/menu/ModeOptionsMenu.cpp | 106 ++++++++--------- src/smw/menu/ModeOptionsMenu.h | 108 +++++++++--------- .../menu/network/NetNewRoomSettingsMenu.cpp | 2 +- src/smw/menu/network/NetNewRoomSettingsMenu.h | 4 +- src/smw/menu/options/EyeCandyOptionsMenu.cpp | 16 +-- src/smw/menu/options/EyeCandyOptionsMenu.h | 18 +-- src/smw/menu/options/GameplayOptionsMenu.cpp | 20 ++-- src/smw/menu/options/GameplayOptionsMenu.h | 22 ++-- src/smw/menu/options/GraphicsOptionsMenu.cpp | 6 +- src/smw/menu/options/GraphicsOptionsMenu.h | 8 +- src/smw/menu/options/PowerupSettingsMenu.cpp | 12 +- src/smw/menu/options/PowerupSettingsMenu.h | 14 +-- src/smw/menu/options/ProjectileLimitsMenu.cpp | 18 +-- src/smw/menu/options/ProjectileLimitsMenu.h | 20 ++-- .../menu/options/ProjectileOptionsMenu.cpp | 24 ++-- src/smw/menu/options/ProjectileOptionsMenu.h | 28 ++--- src/smw/menu/options/SoundOptionsMenu.cpp | 4 +- src/smw/menu/options/SoundOptionsMenu.h | 6 +- src/smw/menu/options/TeamOptionsMenu.cpp | 6 +- src/smw/menu/options/TeamOptionsMenu.h | 8 +- src/smw/menu/xbox/ScreenSettingsMenu.cpp | 8 +- src/smw/menu/xbox/ScreenSettingsMenu.h | 8 +- src/smw/ui/MI_FrenzyModeOptions.cpp | 6 +- src/smw/ui/MI_FrenzyModeOptions.h | 6 +- src/smw/ui/MI_InputControlContainer.cpp | 2 +- src/smw/ui/MI_InputControlContainer.h | 4 +- src/smw/ui/MI_PowerupSelection.cpp | 4 +- src/smw/ui/MI_PowerupSelection.h | 6 +- src/smw/ui/MI_TourStop.cpp | 10 +- src/smw/ui/MI_TourStop.h | 8 +- src/worldeditor/worldeditor.cpp | 46 ++++---- 41 files changed, 327 insertions(+), 327 deletions(-) diff --git a/src/common/ui/MI_ImageSelectField.cpp b/src/common/ui/MI_ImageSelectField.cpp index a237b79c..5dbaf7cc 100644 --- a/src/common/ui/MI_ImageSelectField.cpp +++ b/src/common/ui/MI_ImageSelectField.cpp @@ -15,7 +15,7 @@ MI_ImageSelectField::MI_ImageSelectField( std::string name, short width, short indent, short imageHeight, short imageWidth) - : MI_SelectFieldDyn(nspr, x, y, std::move(name), width, indent) + : MI_SelectField(nspr, x, y, std::move(name), width, indent) , spr_image(nspr_image) , iImageWidth(imageWidth) , iImageHeight(imageHeight) diff --git a/src/common/ui/MI_ImageSelectField.h b/src/common/ui/MI_ImageSelectField.h index 92ca6f8a..343f5831 100644 --- a/src/common/ui/MI_ImageSelectField.h +++ b/src/common/ui/MI_ImageSelectField.h @@ -3,7 +3,7 @@ #include "ui/MI_SelectField.h" -class MI_ImageSelectField : public MI_SelectFieldDyn { +class MI_ImageSelectField : public MI_SelectField { public: MI_ImageSelectField( gfxSprite* nspr, gfxSprite* nspr_image, diff --git a/src/common/ui/MI_SelectField.cpp b/src/common/ui/MI_SelectField.cpp index b23a224b..4f0115ea 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -10,7 +10,7 @@ extern CResourceManager* rm; template -MI_SelectFieldDyn::MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std::string name, short width, short indent) +MI_SelectField::MI_SelectField(gfxSprite* nspr, short x, short y, std::string name, short width, short indent) : UI_Control(x, y) , m_spr(nspr) , m_name(std::move(name)) @@ -27,7 +27,7 @@ MI_SelectFieldDyn::MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std:: template -MI_SelectFieldDyn::MI_SelectFieldDyn(const MI_SelectFieldDyn& other) +MI_SelectField::MI_SelectField(const MI_SelectField& other) : UI_Control(other) , m_spr(other.m_spr) , m_name(other.m_name) @@ -54,7 +54,7 @@ MI_SelectFieldDyn::MI_SelectFieldDyn(const MI_SelectFieldDyn& other) template -void MI_SelectFieldDyn::Update() +void MI_SelectField::Update() { miModifyImageRight->Update(); miModifyImageLeft->Update(); @@ -62,7 +62,7 @@ void MI_SelectFieldDyn::Update() template -void MI_SelectFieldDyn::Draw() +void MI_SelectField::Draw() { if (!fShow) return; @@ -96,7 +96,7 @@ void MI_SelectFieldDyn::Draw() template -MenuCodeEnum MI_SelectFieldDyn::Modify(bool modify) +MenuCodeEnum MI_SelectField::Modify(bool modify) { if (fDisable) return MENU_CODE_UNSELECT_ITEM; @@ -117,7 +117,7 @@ MenuCodeEnum MI_SelectFieldDyn::Modify(bool modify) template -MenuCodeEnum MI_SelectFieldDyn::SendInput(CPlayerInput * playerInput) +MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) { for (int iPlayer = 0; iPlayer < 4; iPlayer++) { short iNumMoves = 1; @@ -166,7 +166,7 @@ MenuCodeEnum MI_SelectFieldDyn::SendInput(CPlayerInput * playerInput) template -MenuCodeEnum MI_SelectFieldDyn::MouseClick(short iMouseX, short iMouseY) { +MenuCodeEnum MI_SelectField::MouseClick(short iMouseX, short iMouseY) { if (fDisable) return MENU_CODE_NONE; @@ -203,7 +203,7 @@ MenuCodeEnum MI_SelectFieldDyn::MouseClick(short iMouseX, short iMouseY) { template -void MI_SelectFieldDyn::Refresh() +void MI_SelectField::Refresh() { if (m_outputPtr) setCurrentValue(*m_outputPtr); @@ -211,7 +211,7 @@ void MI_SelectFieldDyn::Refresh() template -T MI_SelectFieldDyn::randomValue() const +T MI_SelectField::randomValue() const { const size_t idx = m_goodRandomIndices.at(RANDOM_INT(m_goodRandomIndices.size())); return m_items.at(idx).value; @@ -219,7 +219,7 @@ T MI_SelectFieldDyn::randomValue() const template -bool MI_SelectFieldDyn::setCurrentValue(T value) +bool MI_SelectField::setCurrentValue(T value) { for (m_index = 0; m_index < m_items.size(); m_index++) { if (m_items[m_index].value == value) { @@ -232,7 +232,7 @@ bool MI_SelectFieldDyn::setCurrentValue(T value) template -bool MI_SelectFieldDyn::setCurrentIndex(size_t index) +bool MI_SelectField::setCurrentIndex(size_t index) { if (m_index < m_items.size()) { m_index = index; @@ -244,7 +244,7 @@ bool MI_SelectFieldDyn::setCurrentIndex(size_t index) template -void MI_SelectFieldDyn::updateOutput() const +void MI_SelectField::updateOutput() const { if (m_outputPtr) *m_outputPtr = currentValue(); @@ -252,7 +252,7 @@ void MI_SelectFieldDyn::updateOutput() const template -SF_ListItemDyn& MI_SelectFieldDyn::add(std::string name, T value, bool goodRandom) +SF_ListItem& MI_SelectField::add(std::string name, T value, bool goodRandom) { size_t new_idx = m_items.size(); m_items.emplace_back(std::move(name), std::move(value)); @@ -266,7 +266,7 @@ SF_ListItemDyn& MI_SelectFieldDyn::add(std::string name, T value, bool goo template -void MI_SelectFieldDyn::clear() +void MI_SelectField::clear() { m_items.clear(); m_goodRandomIndices.clear(); @@ -274,7 +274,7 @@ void MI_SelectFieldDyn::clear() template -void MI_SelectFieldDyn::hideItem(T value, bool hide) +void MI_SelectField::hideItem(T value, bool hide) { for (Item& item : m_items) { if (item.value == value) @@ -286,7 +286,7 @@ void MI_SelectFieldDyn::hideItem(T value, bool hide) template -void MI_SelectFieldDyn::hideAllItems(bool hide) +void MI_SelectField::hideAllItems(bool hide) { for (Item& item : m_items) { item.hidden = hide; @@ -295,7 +295,7 @@ void MI_SelectFieldDyn::hideAllItems(bool hide) template -bool MI_SelectFieldDyn::moveNext() +bool MI_SelectField::moveNext() { if (m_items.empty()) return false; @@ -318,7 +318,7 @@ bool MI_SelectFieldDyn::moveNext() template -bool MI_SelectFieldDyn::movePrev() +bool MI_SelectField::movePrev() { if (m_items.empty()) return false; @@ -341,7 +341,7 @@ bool MI_SelectFieldDyn::movePrev() template -bool MI_SelectFieldDyn::moveRandom() +bool MI_SelectField::moveRandom() { std::vector valid_indices; valid_indices.reserve(m_items.size()); @@ -360,5 +360,5 @@ bool MI_SelectFieldDyn::moveRandom() // Actual typed classes -template class MI_SelectFieldDyn; -template class MI_SelectFieldDyn; +template class MI_SelectField; +template class MI_SelectField; diff --git a/src/common/ui/MI_SelectField.h b/src/common/ui/MI_SelectField.h index 3a7010a0..2f49ed83 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -13,8 +13,8 @@ class MI_Image; template -struct SF_ListItemDyn { - SF_ListItemDyn(std::string&& name, T value) +struct SF_ListItem { + SF_ListItem(std::string&& name, T value) : name(std::move(name)) , value(value) { @@ -29,13 +29,13 @@ struct SF_ListItemDyn { template -class MI_SelectFieldDyn : public UI_Control { - using Item = SF_ListItemDyn; +class MI_SelectField : public UI_Control { + using Item = SF_ListItem; public: - MI_SelectFieldDyn(gfxSprite* nspr, short x, short y, std::string name, short width, short indent); - MI_SelectFieldDyn(const MI_SelectFieldDyn&); - virtual ~MI_SelectFieldDyn() = default; + MI_SelectField(gfxSprite* nspr, short x, short y, std::string name, short width, short indent); + MI_SelectField(const MI_SelectField&); + virtual ~MI_SelectField() = default; //! Set the displayed name. void setTitle(std::string name) { diff --git a/src/common/ui/MI_SliderField.cpp b/src/common/ui/MI_SliderField.cpp index 856a7393..d498ea2f 100644 --- a/src/common/ui/MI_SliderField.cpp +++ b/src/common/ui/MI_SliderField.cpp @@ -11,7 +11,7 @@ extern CResourceManager* rm; **************************************/ MI_SliderField::MI_SliderField(gfxSprite * nspr, gfxSprite * nsprSlider, short x, short y, const char * name, short width, short indent1, short indent2) - : MI_SelectFieldDyn(nspr, x, y, name, width, indent1) + : MI_SelectField(nspr, x, y, name, width, indent1) { m_indent2 = indent2; m_sprSlider = nsprSlider; @@ -24,7 +24,7 @@ MI_SliderField::~MI_SliderField() void MI_SliderField::SetPosition(short x, short y) { - MI_SelectFieldDyn::SetPosition(x, y); + MI_SelectField::SetPosition(x, y); miModifyImageLeft->SetPosition(ix + m_indent - 26, iy + 4); miModifyImageRight->SetPosition(ix + m_width - 16, iy + 4); } @@ -80,5 +80,5 @@ MenuCodeEnum MI_SliderField::SendInput(CPlayerInput * playerInput) } } - return MI_SelectFieldDyn::SendInput(playerInput); + return MI_SelectField::SendInput(playerInput); } diff --git a/src/common/ui/MI_SliderField.h b/src/common/ui/MI_SliderField.h index 652d401b..a2226da4 100644 --- a/src/common/ui/MI_SliderField.h +++ b/src/common/ui/MI_SliderField.h @@ -3,7 +3,7 @@ #include "ui/MI_SelectField.h" -class MI_SliderField : public MI_SelectFieldDyn { +class MI_SliderField : public MI_SelectField { public: MI_SliderField(gfxSprite * nspr, gfxSprite * nsprSlider, short x, short y, const char * name, short width, short indent1, short indent2); virtual ~MI_SliderField(); diff --git a/src/smw/menu/GameSettingsMenu.cpp b/src/smw/menu/GameSettingsMenu.cpp index 70f0b71f..d18d0d37 100644 --- a/src/smw/menu/GameSettingsMenu.cpp +++ b/src/smw/menu/GameSettingsMenu.cpp @@ -40,7 +40,7 @@ UI_GameSettingsMenu::UI_GameSettingsMenu() miModeField->setItemChangedCode(MENU_CODE_MODE_CHANGED); for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { - miGoalField[iGameMode] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 125, gamemodes[iGameMode]->GetGoalName().c_str(), 352, 120); + miGoalField[iGameMode] = new MI_SelectField(&rm->spr_selectfield, 70, 125, gamemodes[iGameMode]->GetGoalName().c_str(), 352, 120); // miGoalField[iGameMode]->SetKey(gamemodes[iGameMode]->goal); miGoalField[iGameMode]->Show(iGameMode == 0); diff --git a/src/smw/menu/GameSettingsMenu.h b/src/smw/menu/GameSettingsMenu.h index 6a1c8908..8610ff69 100644 --- a/src/smw/menu/GameSettingsMenu.h +++ b/src/smw/menu/GameSettingsMenu.h @@ -8,7 +8,7 @@ class MI_ImageSelectField; class MI_MapField; class MI_MapFilterScroll; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_GameSettingsMenu : public UI_Menu { @@ -30,7 +30,7 @@ class UI_GameSettingsMenu : public UI_Menu { MI_MapFilterScroll* miMapFilterScroll = nullptr; MI_MapField* miMapField = nullptr; - MI_SelectFieldDyn* miGoalField[22]; + MI_SelectField* miGoalField[22]; private: MI_ImageSelectField* miModeField = nullptr; diff --git a/src/smw/menu/MatchSelectionMenu.cpp b/src/smw/menu/MatchSelectionMenu.cpp index 338cb7a1..8dd663e6 100644 --- a/src/smw/menu/MatchSelectionMenu.cpp +++ b/src/smw/menu/MatchSelectionMenu.cpp @@ -22,7 +22,7 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miMatchSelectionStartButton = new MI_Button(&rm->spr_selectfield, 270, 420, "Start", 100); miMatchSelectionStartButton->SetCode(MENU_CODE_MATCH_SELECTION_START); - miMatchSelectionField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 340, "Match", 380, 100); + miMatchSelectionField = new MI_SelectField(&rm->spr_selectfield, 130, 340, "Match", 380, 100); miMatchSelectionField->add("Single Game", MATCH_TYPE_SINGLE_GAME); miMatchSelectionField->add("Tournament", MATCH_TYPE_TOURNAMENT); miMatchSelectionField->add("Tour", MATCH_TYPE_TOUR); @@ -32,7 +32,7 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miMatchSelectionField->setCurrentValue(game_values.matchtype); miMatchSelectionField->setItemChangedCode(MENU_CODE_MATCH_SELECTION_MATCH_CHANGED); - miTournamentField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "Wins", 380, 100); + miTournamentField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Wins", 380, 100); miTournamentField->add("2", 2); miTournamentField->add("3", 3); miTournamentField->add("4", 4); @@ -46,7 +46,7 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miTournamentField->setCurrentValue(game_values.tournamentgames); miTournamentField->Show(false); - miTourField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "Tour", 380, 100); + miTourField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Tour", 380, 100); for (short iTour = 0; iTour < tourlist->GetCount(); iTour++) { std::string szTemp = GetNameFromFileName(tourlist->GetIndex(iTour), true); // strcat(szTemp, " Tour"); @@ -56,7 +56,7 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miTourField->setCurrentValue(game_values.tourindex); miTourField->Show(false); - miWorldField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "World", 380, 100); + miWorldField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "World", 380, 100); for (short iWorld = 0; iWorld < worldlist->GetCount(); iWorld++) { std::string szTemp = GetNameFromFileName(worldlist->GetIndex(iWorld), true); miWorldField->add(std::move(szTemp), iWorld); @@ -66,7 +66,7 @@ UI_MatchSelectionMenu::UI_MatchSelectionMenu() miWorldField->setItemChangedCode(MENU_CODE_WORLD_MAP_CHANGED); miWorldField->Show(false); - miMinigameField = new MI_SelectFieldDyn(&rm->spr_selectfield, 130, 380, "Game", 380, 100); + miMinigameField = new MI_SelectField(&rm->spr_selectfield, 130, 380, "Game", 380, 100); miMinigameField->add("Pipe Coin Game", 0); miMinigameField->add("Hammer Boss Game", 1); miMinigameField->add("Bomb Boss Game", 2); diff --git a/src/smw/menu/MatchSelectionMenu.h b/src/smw/menu/MatchSelectionMenu.h index 60da79c1..ff137e56 100644 --- a/src/smw/menu/MatchSelectionMenu.h +++ b/src/smw/menu/MatchSelectionMenu.h @@ -6,7 +6,7 @@ class MI_Button; class MI_Image; class MI_Text; class MI_WorldPreviewDisplay; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_MatchSelectionMenu : public UI_Menu { @@ -22,11 +22,11 @@ class UI_MatchSelectionMenu : public UI_Menu { private: MI_Image* miMatchSelectionDisplayImage; - MI_SelectFieldDyn* miMatchSelectionField; - MI_SelectFieldDyn* miTournamentField; - MI_SelectFieldDyn* miTourField; - MI_SelectFieldDyn* miWorldField; - MI_SelectFieldDyn* miMinigameField; + MI_SelectField* miMatchSelectionField; + MI_SelectField* miTournamentField; + MI_SelectField* miTourField; + MI_SelectField* miWorldField; + MI_SelectField* miMinigameField; MI_WorldPreviewDisplay* miWorldPreviewDisplay; MI_Button* miMatchSelectionStartButton; diff --git a/src/smw/menu/ModeOptionsMenu.cpp b/src/smw/menu/ModeOptionsMenu.cpp index a9186c04..5b0e7ffe 100644 --- a/src/smw/menu/ModeOptionsMenu.cpp +++ b/src/smw/menu/ModeOptionsMenu.cpp @@ -21,13 +21,13 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Classic Mode Settings //*********************** - miClassicModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); + miClassicModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); miClassicModeStyleField->add("Respawn", 0); miClassicModeStyleField->add("Shield", 1); miClassicModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.classic.style); miClassicModeStyleField->setCurrentValue(game_values.gamemodemenusettings.classic.style); - miClassicModeScoringField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); + miClassicModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); miClassicModeScoringField->add("All Kills", 0); miClassicModeScoringField->add("Push Kills Only", 1, false); miClassicModeScoringField->setOutputPtr(&game_values.gamemodemenusettings.classic.scoring); @@ -56,13 +56,13 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Frag Mode Settings //*********************** - miFragModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); + miFragModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "On Kill", 400, 180); miFragModeStyleField->add("Respawn", 0); miFragModeStyleField->add("Shield", 1); miFragModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.frag.style); miFragModeStyleField->setCurrentValue(game_values.gamemodemenusettings.frag.style); - miFragModeScoringField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); + miFragModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Scoring", 400, 180); miFragModeScoringField->add("All Kills", 0); miFragModeScoringField->add("Push Kills Only", 1, false); miFragModeScoringField->setOutputPtr(&game_values.gamemodemenusettings.frag.scoring); @@ -91,13 +91,13 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Time Limit Mode Settings //*********************** - miTimeLimitModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "On Kill", 400, 150); + miTimeLimitModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "On Kill", 400, 150); miTimeLimitModeStyleField->add("Respawn", 0); miTimeLimitModeStyleField->add("Shield", 1); miTimeLimitModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.time.style); miTimeLimitModeStyleField->setCurrentValue(game_values.gamemodemenusettings.time.style); - miTimeLimitModeScoringField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Scoring", 400, 150); + miTimeLimitModeScoringField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Scoring", 400, 150); miTimeLimitModeScoringField->add("All Kills", 0); miTimeLimitModeScoringField->add("Push Kills Only", 1, false); miTimeLimitModeScoringField->setOutputPtr(&game_values.gamemodemenusettings.time.scoring); @@ -153,14 +153,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Jail Mode Settings //*********************** - miJailModeStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Style", 400, 150); + miJailModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Style", 400, 150); miJailModeStyleField->add("Classic", 0); miJailModeStyleField->add("Owned", 1, false); miJailModeStyleField->add("Free For All", 2, false); miJailModeStyleField->setOutputPtr(&game_values.gamemodemenusettings.jail.style); miJailModeStyleField->setCurrentValue(game_values.gamemodemenusettings.jail.style); - miJailModeTimeFreeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Free Timer", 400, 150); + miJailModeTimeFreeField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Free Timer", 400, 150); miJailModeTimeFreeField->add("None", 1); miJailModeTimeFreeField->add("5 Seconds", 310, false); miJailModeTimeFreeField->add("10 Seconds", 620); @@ -177,7 +177,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miJailModeTimeFreeField->setOutputPtr(&game_values.gamemodemenusettings.jail.timetofree); miJailModeTimeFreeField->setCurrentValue(game_values.gamemodemenusettings.jail.timetofree); - miJailModeTagFreeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Tag Free", 400, 150); + miJailModeTagFreeField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Tag Free", 400, 150); miJailModeTagFreeField->add("Off", false); miJailModeTagFreeField->add("On", true); miJailModeTagFreeField->setOutputPtr(&game_values.gamemodemenusettings.jail.tagfree); @@ -235,14 +235,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Coins Mode Settings //*********************** - miCoinModePenaltyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Penalty", 400, 150); + miCoinModePenaltyField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Penalty", 400, 150); miCoinModePenaltyField->add("Off", false); miCoinModePenaltyField->add("On", true); miCoinModePenaltyField->setOutputPtr(&game_values.gamemodemenusettings.coins.penalty); miCoinModePenaltyField->setCurrentValue(game_values.gamemodemenusettings.coins.penalty ? 1 : 0); miCoinModePenaltyField->setAutoAdvance(true); - miCoinModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Quantity", 400, 150); + miCoinModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Quantity", 400, 150); miCoinModeQuantityField->add("1", 1); miCoinModeQuantityField->add("2", 2); miCoinModeQuantityField->add("3", 3); @@ -306,7 +306,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Stomp Mode Settings //*********************** - miStompModeRateField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 40, "Rate", 400, 180); + miStompModeRateField = new MI_SelectField(&rm->spr_selectfield, 120, 40, "Rate", 400, 180); miStompModeRateField->add("Very Slow", 150, false); miStompModeRateField->add("Slow", 120); miStompModeRateField->add("Moderate", 90); @@ -393,7 +393,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miEggModeYoshiQuantityField[iYoshiField]->allowWrap(false); } - miEggModeExplosionTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 380, "Explosion Timer", 400, 180); + miEggModeExplosionTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 380, "Explosion Timer", 400, 180); miEggModeExplosionTimeField->add("Off", 0); miEggModeExplosionTimeField->add("3 Seconds", 3, false); miEggModeExplosionTimeField->add("5 Seconds", 5); @@ -451,21 +451,21 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.flag.speed); miFlagModeSpeedField->allowWrap(false); - miFlagModeTouchReturnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Touch Return", 400, 180); + miFlagModeTouchReturnField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Touch Return", 400, 180); miFlagModeTouchReturnField->add("Off", false); miFlagModeTouchReturnField->add("On", true); miFlagModeTouchReturnField->setOutputPtr(&game_values.gamemodemenusettings.flag.touchreturn); miFlagModeTouchReturnField->setCurrentValue(game_values.gamemodemenusettings.flag.touchreturn ? 1 : 0); miFlagModeTouchReturnField->setAutoAdvance(true); - miFlagModePointMoveField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Point Move", 400, 180); + miFlagModePointMoveField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Point Move", 400, 180); miFlagModePointMoveField->add("Off", false); miFlagModePointMoveField->add("On", true); miFlagModePointMoveField->setOutputPtr(&game_values.gamemodemenusettings.flag.pointmove); miFlagModePointMoveField->setCurrentValue(game_values.gamemodemenusettings.flag.pointmove ? 1 : 0); miFlagModePointMoveField->setAutoAdvance(true); - miFlagModeAutoReturnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Auto Return", 400, 180); + miFlagModeAutoReturnField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Auto Return", 400, 180); miFlagModeAutoReturnField->add("None", 0); miFlagModeAutoReturnField->add("5 Seconds", 310, false); miFlagModeAutoReturnField->add("10 Seconds", 620); @@ -482,14 +482,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miFlagModeAutoReturnField->setOutputPtr(&game_values.gamemodemenusettings.flag.autoreturn); miFlagModeAutoReturnField->setCurrentValue(game_values.gamemodemenusettings.flag.autoreturn); - miFlagModeHomeScoreField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Need Home", 400, 180); + miFlagModeHomeScoreField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Need Home", 400, 180); miFlagModeHomeScoreField->add("Off", false); miFlagModeHomeScoreField->add("On", true); miFlagModeHomeScoreField->setOutputPtr(&game_values.gamemodemenusettings.flag.homescore); miFlagModeHomeScoreField->setCurrentValue(game_values.gamemodemenusettings.flag.homescore ? 1 : 0); miFlagModeHomeScoreField->setAutoAdvance(true); - miFlagModeCenterFlagField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Center Flag", 400, 180); + miFlagModeCenterFlagField = new MI_SelectField(&rm->spr_selectfield, 120, 320, "Center Flag", 400, 180); miFlagModeCenterFlagField->add("Off", false); miFlagModeCenterFlagField->add("On", true); miFlagModeCenterFlagField->setOutputPtr(&game_values.gamemodemenusettings.flag.centerflag); @@ -524,14 +524,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Chicken Mode Settings //*********************** - miChickenModeShowTargetField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Show Target", 400, 180); + miChickenModeShowTargetField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Show Target", 400, 180); miChickenModeShowTargetField->add("Off", false); miChickenModeShowTargetField->add("On", true); miChickenModeShowTargetField->setOutputPtr(&game_values.gamemodemenusettings.chicken.usetarget); miChickenModeShowTargetField->setCurrentValue(game_values.gamemodemenusettings.chicken.usetarget ? 1 : 0); miChickenModeShowTargetField->setAutoAdvance(true); - miChickenModeGlideField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Chicken Glide", 400, 180); + miChickenModeGlideField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Chicken Glide", 400, 180); miChickenModeGlideField->add("Off", false); miChickenModeGlideField->add("On", true); miChickenModeGlideField->setOutputPtr(&game_values.gamemodemenusettings.chicken.glide); @@ -562,7 +562,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Tag Mode Settings //*********************** - miTagModeTagOnTouchField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Touch Tag", 400, 180); + miTagModeTagOnTouchField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Touch Tag", 400, 180); miTagModeTagOnTouchField->add("Off", false); miTagModeTagOnTouchField->add("On", true); miTagModeTagOnTouchField->setOutputPtr(&game_values.gamemodemenusettings.tag.tagontouch); @@ -592,7 +592,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Star Mode Settings //*********************** - miStarModeTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Time", 400, 150); + miStarModeTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Time", 400, 150); miStarModeTimeField->add("5 Seconds", 5, false); miStarModeTimeField->add("10 Seconds", 10, false); miStarModeTimeField->add("15 Seconds", 15); @@ -608,7 +608,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miStarModeTimeField->setOutputPtr(&game_values.gamemodemenusettings.star.time); miStarModeTimeField->setCurrentValue(game_values.gamemodemenusettings.star.time); - miStarModeShineField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Star Type", 400, 150); + miStarModeShineField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Star Type", 400, 150); miStarModeShineField->add("Ztar", 0); miStarModeShineField->add("Shine", 1); miStarModeShineField->add("Multi Star", 2); @@ -666,7 +666,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Domination Mode Settings //*********************** - miDominationModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 120, "Quantity", 400, 180); + miDominationModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 120, "Quantity", 400, 180); miDominationModeQuantityField->add("1 Base", 1, false); miDominationModeQuantityField->add("2 Bases", 2, false); miDominationModeQuantityField->add("3 Bases", 3); @@ -694,7 +694,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miDominationModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.domination.quantity); miDominationModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.domination.quantity); - miDominationModeRelocateFrequencyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Relocate", 400, 180); + miDominationModeRelocateFrequencyField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Relocate", 400, 180); miDominationModeRelocateFrequencyField->add("Never", 0); miDominationModeRelocateFrequencyField->add("5 Seconds", 310, false); miDominationModeRelocateFrequencyField->add("10 Seconds", 620); @@ -712,21 +712,21 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miDominationModeDeathText = new MI_Text("On Death", 120, 210, 0, true, TextAlign::LEFT); - miDominationModeLoseOnDeathField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Lose Bases", 400, 180); + miDominationModeLoseOnDeathField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Lose Bases", 400, 180); miDominationModeLoseOnDeathField->add("Off", false); miDominationModeLoseOnDeathField->add("On", true); miDominationModeLoseOnDeathField->setOutputPtr(&game_values.gamemodemenusettings.domination.loseondeath); miDominationModeLoseOnDeathField->setCurrentValue(game_values.gamemodemenusettings.domination.loseondeath ? 1 : 0); miDominationModeLoseOnDeathField->setAutoAdvance(true); - miDominationModeRelocateOnDeathField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Move Bases", 400, 180); + miDominationModeRelocateOnDeathField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Move Bases", 400, 180); miDominationModeRelocateOnDeathField->add("Off", false); miDominationModeRelocateOnDeathField->add("On", true); miDominationModeRelocateOnDeathField->setOutputPtr(&game_values.gamemodemenusettings.domination.relocateondeath); miDominationModeRelocateOnDeathField->setCurrentValue(game_values.gamemodemenusettings.domination.relocateondeath ? 1 : 0); miDominationModeRelocateOnDeathField->setAutoAdvance(true); - miDominationModeStealOnDeathField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Steal Bases", 400, 180); + miDominationModeStealOnDeathField = new MI_SelectField(&rm->spr_selectfield, 120, 320, "Steal Bases", 400, 180); miDominationModeStealOnDeathField->add("Off", false); miDominationModeStealOnDeathField->add("On", true); miDominationModeStealOnDeathField->setOutputPtr(&game_values.gamemodemenusettings.domination.stealondeath); @@ -762,7 +762,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // King of the Hill Mode Settings //*********************** - miKingOfTheHillModeSizeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Size", 400, 180); + miKingOfTheHillModeSizeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Size", 400, 180); miKingOfTheHillModeSizeField->add("2 x 2", 2); miKingOfTheHillModeSizeField->add("3 x 3", 3); miKingOfTheHillModeSizeField->add("4 x 4", 4); @@ -772,7 +772,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miKingOfTheHillModeSizeField->setOutputPtr(&game_values.gamemodemenusettings.kingofthehill.areasize); miKingOfTheHillModeSizeField->setCurrentValue(game_values.gamemodemenusettings.kingofthehill.areasize); - miKingOfTheHillModeRelocateFrequencyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Relocate", 400, 180); + miKingOfTheHillModeRelocateFrequencyField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Relocate", 400, 180); miKingOfTheHillModeRelocateFrequencyField->add("Never", 0); miKingOfTheHillModeRelocateFrequencyField->add("5 Seconds", 310, false); miKingOfTheHillModeRelocateFrequencyField->add("10 Seconds", 620); @@ -788,7 +788,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miKingOfTheHillModeRelocateFrequencyField->setOutputPtr(&game_values.gamemodemenusettings.kingofthehill.relocationfrequency); miKingOfTheHillModeRelocateFrequencyField->setCurrentValue(game_values.gamemodemenusettings.kingofthehill.relocationfrequency); - miKingOfTheHillModeMultiplierField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Max Multiplier", 400, 180); + miKingOfTheHillModeMultiplierField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Max Multiplier", 400, 180); miKingOfTheHillModeMultiplierField->add("None", 1); miKingOfTheHillModeMultiplierField->add("2", 2); miKingOfTheHillModeMultiplierField->add("3", 3); @@ -822,7 +822,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Race Mode Settings //*********************** - miRaceModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Quantity", 400, 180); + miRaceModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Quantity", 400, 180); miRaceModeQuantityField->add("2", 2, false); miRaceModeQuantityField->add("3", 3); miRaceModeQuantityField->add("4", 4); @@ -833,7 +833,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miRaceModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.race.quantity); miRaceModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.race.quantity); - miRaceModeSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Speed", 400, 180); + miRaceModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Speed", 400, 180); miRaceModeSpeedField->add("Stationary", 0); miRaceModeSpeedField->add("Very Slow", 2); miRaceModeSpeedField->add("Slow", 3); @@ -845,7 +845,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miRaceModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.race.speed); miRaceModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.race.speed); - miRaceModePenaltyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Penalty", 400, 180); + miRaceModePenaltyField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Penalty", 400, 180); miRaceModePenaltyField->add("None", 0); miRaceModePenaltyField->add("One Goal", 1); miRaceModePenaltyField->add("All Goals", 2); @@ -916,7 +916,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miSurvivalModeEnemySlider[iEnemy]->setCurrentValue(game_values.gamemodemenusettings.survival.enemyweight[iEnemy]); } - miSurvivalModeDensityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Density", 400, 180); + miSurvivalModeDensityField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Density", 400, 180); miSurvivalModeDensityField->add("Very Low", 40, false); miSurvivalModeDensityField->add("Low", 30); miSurvivalModeDensityField->add("Medium", 20); @@ -927,7 +927,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miSurvivalModeDensityField->setOutputPtr(&game_values.gamemodemenusettings.survival.density); miSurvivalModeDensityField->setCurrentValue(game_values.gamemodemenusettings.survival.density); - miSurvivalModeSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Speed", 400, 180); + miSurvivalModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Speed", 400, 180); miSurvivalModeSpeedField->add("Very Slow", 2, false); miSurvivalModeSpeedField->add("Slow", 3); miSurvivalModeSpeedField->add("Moderate", 4); @@ -938,7 +938,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miSurvivalModeSpeedField->setOutputPtr(&game_values.gamemodemenusettings.survival.speed); miSurvivalModeSpeedField->setCurrentValue(game_values.gamemodemenusettings.survival.speed); - miSurvivalModeShieldField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 320, "Shield", 400, 180); + miSurvivalModeShieldField = new MI_SelectField(&rm->spr_selectfield, 120, 320, "Shield", 400, 180); miSurvivalModeShieldField->add("Off", false); miSurvivalModeShieldField->add("On", true); miSurvivalModeShieldField->setOutputPtr(&game_values.gamemodemenusettings.survival.shield); @@ -971,7 +971,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** // Greed Mode Settings //*********************** - miGreedModeCoinLife = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Coin Life", 400, 150); + miGreedModeCoinLife = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Coin Life", 400, 150); miGreedModeCoinLife->add("1 Second", 62, false); miGreedModeCoinLife->add("2 Seconds", 124, false); miGreedModeCoinLife->add("3 Seconds", 186); @@ -991,14 +991,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miGreedModeCoinLife->setOutputPtr(&game_values.gamemodemenusettings.greed.coinlife); miGreedModeCoinLife->setCurrentValue(game_values.gamemodemenusettings.greed.coinlife); - miGreedModeOwnCoins = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Own Coins", 400, 150); + miGreedModeOwnCoins = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Own Coins", 400, 150); miGreedModeOwnCoins->add("Yes", true); miGreedModeOwnCoins->add("No", false); miGreedModeOwnCoins->setOutputPtr(&game_values.gamemodemenusettings.greed.owncoins); miGreedModeOwnCoins->setCurrentValue(game_values.gamemodemenusettings.greed.owncoins); miGreedModeOwnCoins->setAutoAdvance(true); - miGreedModeMultiplier = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Multipler", 400, 150); + miGreedModeMultiplier = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Multipler", 400, 150); miGreedModeMultiplier->add("0.5", 1, false); miGreedModeMultiplier->add("1", 2); miGreedModeMultiplier->add("1.5", 3); @@ -1059,7 +1059,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() //*********************** // Health Mode Settings //*********************** - miHealthModeStartLife = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Start Life", 400, 150); + miHealthModeStartLife = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Start Life", 400, 150); miHealthModeStartLife->add("2", 2, false); miHealthModeStartLife->add("3", 3, false); miHealthModeStartLife->add("4", 4); @@ -1074,7 +1074,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miHealthModeStartLife->allowWrap(false); miHealthModeStartLife->setItemChangedCode(MENU_CODE_HEALTH_MODE_START_LIFE_CHANGED); - miHealthModeMaxLife = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Max Life", 400, 150); + miHealthModeMaxLife = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Max Life", 400, 150); miHealthModeMaxLife->add("2", 2, false); miHealthModeMaxLife->add("3", 3, false); miHealthModeMaxLife->add("4", 4, false); @@ -1139,7 +1139,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Card Collection Mode Settings //*********************** - miCollectionModeQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Limit", 400, 180); + miCollectionModeQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Limit", 400, 180); miCollectionModeQuantityField->add("1 Card", 1); miCollectionModeQuantityField->add("2 Cards", 2); miCollectionModeQuantityField->add("3 Cards", 3); @@ -1153,7 +1153,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCollectionModeQuantityField->setOutputPtr(&game_values.gamemodemenusettings.collection.quantity); miCollectionModeQuantityField->setCurrentValue(game_values.gamemodemenusettings.collection.quantity); - miCollectionModeRateField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 200, "Rate", 400, 180); + miCollectionModeRateField = new MI_SelectField(&rm->spr_selectfield, 120, 200, "Rate", 400, 180); miCollectionModeRateField->add("Instant", 0); miCollectionModeRateField->add("1 Second", 62); miCollectionModeRateField->add("2 Seconds", 124); @@ -1167,7 +1167,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCollectionModeRateField->setOutputPtr(&game_values.gamemodemenusettings.collection.rate); miCollectionModeRateField->setCurrentValue(game_values.gamemodemenusettings.collection.rate); - miCollectionModeBankTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 240, "Bank Time", 400, 180); + miCollectionModeBankTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 240, "Bank Time", 400, 180); miCollectionModeBankTimeField->add("Instant", 0, false); miCollectionModeBankTimeField->add("1 Second", 62, false); miCollectionModeBankTimeField->add("2 Seconds", 124); @@ -1182,7 +1182,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miCollectionModeBankTimeField->setOutputPtr(&game_values.gamemodemenusettings.collection.banktime); miCollectionModeBankTimeField->setCurrentValue(game_values.gamemodemenusettings.collection.banktime); - miCollectionModeCardLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 280, "Card Life", 400, 180); + miCollectionModeCardLifeField = new MI_SelectField(&rm->spr_selectfield, 120, 280, "Card Life", 400, 180); miCollectionModeCardLifeField->add("1 Second", 62, false); miCollectionModeCardLifeField->add("2 Seconds", 124, false); miCollectionModeCardLifeField->add("3 Seconds", 186); @@ -1226,7 +1226,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Chase Mode Settings //*********************** - miChaseModeSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 160, "Speed", 400, 180); + miChaseModeSpeedField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Speed", 400, 180); miChaseModeSpeedField->add("Very Slow", 3, false); miChaseModeSpeedField->add("Slow", 4); miChaseModeSpeedField->add("Moderate", 5); @@ -1277,21 +1277,21 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Shyguy Tag Mode Settings //*********************** - miShyGuyTagModeTagOnSuicideField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Suicide Tag", 400, 180); + miShyGuyTagModeTagOnSuicideField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Suicide Tag", 400, 180); miShyGuyTagModeTagOnSuicideField->add("Off", false); miShyGuyTagModeTagOnSuicideField->add("On", true); miShyGuyTagModeTagOnSuicideField->setOutputPtr(&game_values.gamemodemenusettings.shyguytag.tagonsuicide); miShyGuyTagModeTagOnSuicideField->setCurrentValue(game_values.gamemodemenusettings.shyguytag.tagonsuicide ? 1 : 0); miShyGuyTagModeTagOnSuicideField->setAutoAdvance(true); - miShyGuyTagModeTagOnStompField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Tag Transfer", 400, 180); + miShyGuyTagModeTagOnStompField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Tag Transfer", 400, 180); miShyGuyTagModeTagOnStompField->add("Touch Only", 0); miShyGuyTagModeTagOnStompField->add("Kills Only", 1); miShyGuyTagModeTagOnStompField->add("Touch and Kills", 2); miShyGuyTagModeTagOnStompField->setOutputPtr(&game_values.gamemodemenusettings.shyguytag.tagtransfer); miShyGuyTagModeTagOnStompField->setCurrentValue(game_values.gamemodemenusettings.shyguytag.tagtransfer); - miShyGuyTagModeFreeTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Free Time", 400, 180); + miShyGuyTagModeFreeTimeField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Free Time", 400, 180); miShyGuyTagModeFreeTimeField->add("Instant", 0); miShyGuyTagModeFreeTimeField->add("1 Second", 1); miShyGuyTagModeFreeTimeField->add("2 Seconds", 2); @@ -1330,14 +1330,14 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Boss Mode Settings //*********************** - miBossModeTypeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 180, "Type", 400, 180); + miBossModeTypeField = new MI_SelectField(&rm->spr_selectfield, 120, 180, "Type", 400, 180); miBossModeTypeField->add("Hammer", 0); miBossModeTypeField->add("Bomb", 1); miBossModeTypeField->add("Fire", 2); miBossModeTypeField->setOutputPtr(&game_values.gamemodemenusettings.boss.bosstype); miBossModeTypeField->setCurrentValue(game_values.gamemodemenusettings.boss.bosstype); - miBossModeDifficultyField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 220, "Difficulty", 400, 180); + miBossModeDifficultyField = new MI_SelectField(&rm->spr_selectfield, 120, 220, "Difficulty", 400, 180); miBossModeDifficultyField->add("Very Easy", 0, false); miBossModeDifficultyField->add("Easy", 1); miBossModeDifficultyField->add("Moderate", 2); @@ -1346,7 +1346,7 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() miBossModeDifficultyField->setOutputPtr(&game_values.gamemodemenusettings.boss.difficulty); miBossModeDifficultyField->setCurrentValue(game_values.gamemodemenusettings.boss.difficulty); - miBossModeHitPointsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 260, "Health", 400, 180); + miBossModeHitPointsField = new MI_SelectField(&rm->spr_selectfield, 120, 260, "Health", 400, 180); miBossModeHitPointsField->add("1", 1, false); miBossModeHitPointsField->add("2", 2, false); miBossModeHitPointsField->add("3", 3); diff --git a/src/smw/menu/ModeOptionsMenu.h b/src/smw/menu/ModeOptionsMenu.h index 38dcd034..c2d2304d 100644 --- a/src/smw/menu/ModeOptionsMenu.h +++ b/src/smw/menu/ModeOptionsMenu.h @@ -8,7 +8,7 @@ class MI_FrenzyModeOptions; class MI_PowerupSlider; class MI_SliderField; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_ModeOptionsMenu : public UI_Menu { @@ -37,8 +37,8 @@ class UI_ModeOptionsMenu : public UI_Menu { UI_Menu mBossSettingsMenu; // Classic - MI_SelectFieldDyn* miClassicModeStyleField; - MI_SelectFieldDyn* miClassicModeScoringField; + MI_SelectField* miClassicModeStyleField; + MI_SelectField* miClassicModeScoringField; MI_Button* miClassicModeBackButton; MI_Image* miClassicModeLeftHeaderBar; @@ -46,8 +46,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miClassicModeHeaderText; // Frag - MI_SelectFieldDyn* miFragModeStyleField; - MI_SelectFieldDyn* miFragModeScoringField; + MI_SelectField* miFragModeStyleField; + MI_SelectField* miFragModeScoringField; MI_Button* miFragModeBackButton; MI_Image* miFragModeLeftHeaderBar; @@ -55,8 +55,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miFragModeHeaderText; // Time Limit - MI_SelectFieldDyn* miTimeLimitModeStyleField; - MI_SelectFieldDyn* miTimeLimitModeScoringField; + MI_SelectField* miTimeLimitModeStyleField; + MI_SelectField* miTimeLimitModeScoringField; MI_SliderField* miTimeLimitModePercentExtraTime; MI_Button* miTimeLimitModeBackButton; @@ -65,9 +65,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miTimeLimitModeHeaderText; // Jail - MI_SelectFieldDyn* miJailModeStyleField; - MI_SelectFieldDyn* miJailModeTagFreeField; - MI_SelectFieldDyn* miJailModeTimeFreeField; + MI_SelectField* miJailModeStyleField; + MI_SelectField* miJailModeTagFreeField; + MI_SelectField* miJailModeTimeFreeField; MI_SliderField* miJailModeJailKeyField; MI_Button* miJailModeBackButton; @@ -76,8 +76,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miJailModeHeaderText; // Coins - MI_SelectFieldDyn* miCoinModePenaltyField; - MI_SelectFieldDyn* miCoinModeQuantityField; + MI_SelectField* miCoinModePenaltyField; + MI_SelectField* miCoinModeQuantityField; MI_SliderField* miCoinModePercentExtraCoin; MI_Button* miCoinModeBackButton; @@ -88,7 +88,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Yoshi's Eggs MI_PowerupSlider* miEggModeEggQuantityField[4]; MI_PowerupSlider* miEggModeYoshiQuantityField[4]; - MI_SelectFieldDyn* miEggModeExplosionTimeField; + MI_SelectField* miEggModeExplosionTimeField; MI_Button* miEggModeBackButton; MI_Image* miEggModeLeftHeaderBar; @@ -97,11 +97,11 @@ class UI_ModeOptionsMenu : public UI_Menu { // Capture The Flag MI_SliderField* miFlagModeSpeedField; - MI_SelectFieldDyn* miFlagModeTouchReturnField; - MI_SelectFieldDyn* miFlagModePointMoveField; - MI_SelectFieldDyn* miFlagModeAutoReturnField; - MI_SelectFieldDyn* miFlagModeHomeScoreField; - MI_SelectFieldDyn* miFlagModeCenterFlagField; + MI_SelectField* miFlagModeTouchReturnField; + MI_SelectField* miFlagModePointMoveField; + MI_SelectField* miFlagModeAutoReturnField; + MI_SelectField* miFlagModeHomeScoreField; + MI_SelectField* miFlagModeCenterFlagField; MI_Button* miFlagModeBackButton; MI_Image* miFlagModeLeftHeaderBar; @@ -109,8 +109,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miFlagModeHeaderText; // Chicken - MI_SelectFieldDyn* miChickenModeShowTargetField; - MI_SelectFieldDyn* miChickenModeGlideField; + MI_SelectField* miChickenModeShowTargetField; + MI_SelectField* miChickenModeGlideField; MI_Button* miChickenModeBackButton; MI_Image* miChickenModeLeftHeaderBar; @@ -118,7 +118,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miChickenModeHeaderText; // Tag - MI_SelectFieldDyn* miTagModeTagOnTouchField; + MI_SelectField* miTagModeTagOnTouchField; MI_Button* miTagModeBackButton; MI_Image* miTagModeLeftHeaderBar; @@ -126,8 +126,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miTagModeHeaderText; // Star - MI_SelectFieldDyn* miStarModeTimeField; - MI_SelectFieldDyn* miStarModeShineField; + MI_SelectField* miStarModeTimeField; + MI_SelectField* miStarModeShineField; MI_SliderField* miStarModePercentExtraTime; MI_Button* miStarModeBackButton; @@ -136,11 +136,11 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miStarModeHeaderText; // Domination - MI_SelectFieldDyn* miDominationModeQuantityField; - MI_SelectFieldDyn* miDominationModeLoseOnDeathField; - MI_SelectFieldDyn* miDominationModeRelocateOnDeathField; - MI_SelectFieldDyn* miDominationModeStealOnDeathField; - MI_SelectFieldDyn* miDominationModeRelocateFrequencyField; + MI_SelectField* miDominationModeQuantityField; + MI_SelectField* miDominationModeLoseOnDeathField; + MI_SelectField* miDominationModeRelocateOnDeathField; + MI_SelectField* miDominationModeStealOnDeathField; + MI_SelectField* miDominationModeRelocateFrequencyField; MI_Text* miDominationModeDeathText; @@ -151,9 +151,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miDominationModeHeaderText; // King of the Hill - MI_SelectFieldDyn* miKingOfTheHillModeSizeField; - MI_SelectFieldDyn* miKingOfTheHillModeRelocateFrequencyField; - MI_SelectFieldDyn* miKingOfTheHillModeMultiplierField; + MI_SelectField* miKingOfTheHillModeSizeField; + MI_SelectField* miKingOfTheHillModeRelocateFrequencyField; + MI_SelectField* miKingOfTheHillModeMultiplierField; MI_Button* miKingOfTheHillModeBackButton; @@ -162,9 +162,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miKingOfTheHillModeHeaderText; // Race - MI_SelectFieldDyn* miRaceModeQuantityField; - MI_SelectFieldDyn* miRaceModeSpeedField; - MI_SelectFieldDyn* miRaceModePenaltyField; + MI_SelectField* miRaceModeQuantityField; + MI_SelectField* miRaceModeSpeedField; + MI_SelectField* miRaceModePenaltyField; MI_Button* miRaceModeBackButton; MI_Image* miRaceModeLeftHeaderBar; @@ -172,7 +172,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miRaceModeHeaderText; // Stomp - MI_SelectFieldDyn* miStompModeRateField; + MI_SelectField* miStompModeRateField; MI_PowerupSlider* miStompModeEnemySlider[NUMSTOMPENEMIES]; MI_Button* miStompModeBackButton; @@ -189,9 +189,9 @@ class UI_ModeOptionsMenu : public UI_Menu { // Survival MI_PowerupSlider* miSurvivalModeEnemySlider[NUMSURVIVALENEMIES]; - MI_SelectFieldDyn* miSurvivalModeDensityField; - MI_SelectFieldDyn* miSurvivalModeSpeedField; - MI_SelectFieldDyn* miSurvivalModeShieldField; + MI_SelectField* miSurvivalModeDensityField; + MI_SelectField* miSurvivalModeSpeedField; + MI_SelectField* miSurvivalModeShieldField; MI_Button* miSurvivalModeBackButton; MI_Image* miSurvivalModeLeftHeaderBar; @@ -199,9 +199,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miSurvivalModeHeaderText; // Greed - MI_SelectFieldDyn* miGreedModeCoinLife; - MI_SelectFieldDyn* miGreedModeOwnCoins; - MI_SelectFieldDyn* miGreedModeMultiplier; + MI_SelectField* miGreedModeCoinLife; + MI_SelectField* miGreedModeOwnCoins; + MI_SelectField* miGreedModeMultiplier; MI_SliderField* miGreedModePercentExtraCoin; MI_Button* miGreedModeBackButton; @@ -210,8 +210,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miGreedModeHeaderText; // Health - MI_SelectFieldDyn* miHealthModeStartLife; - MI_SelectFieldDyn* miHealthModeMaxLife; + MI_SelectField* miHealthModeStartLife; + MI_SelectField* miHealthModeMaxLife; MI_SliderField* miHealthModePercentExtraLife; MI_Button* miHealthModeBackButton; @@ -220,10 +220,10 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miHealthModeHeaderText; // Card Collection - MI_SelectFieldDyn* miCollectionModeQuantityField; - MI_SelectFieldDyn* miCollectionModeRateField; - MI_SelectFieldDyn* miCollectionModeBankTimeField; - MI_SelectFieldDyn* miCollectionModeCardLifeField; + MI_SelectField* miCollectionModeQuantityField; + MI_SelectField* miCollectionModeRateField; + MI_SelectField* miCollectionModeBankTimeField; + MI_SelectField* miCollectionModeCardLifeField; MI_Button* miCollectionModeBackButton; MI_Image* miCollectionModeLeftHeaderBar; @@ -231,7 +231,7 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miCollectionModeHeaderText; // Phanto Chase - MI_SelectFieldDyn* miChaseModeSpeedField; + MI_SelectField* miChaseModeSpeedField; MI_PowerupSlider* miChaseModeQuantitySlider[3]; MI_Button* miChaseModeBackButton; @@ -240,9 +240,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miChaseModeHeaderText; // Shyguy Tag - MI_SelectFieldDyn* miShyGuyTagModeTagOnSuicideField; - MI_SelectFieldDyn* miShyGuyTagModeTagOnStompField; - MI_SelectFieldDyn* miShyGuyTagModeFreeTimeField; + MI_SelectField* miShyGuyTagModeTagOnSuicideField; + MI_SelectField* miShyGuyTagModeTagOnStompField; + MI_SelectField* miShyGuyTagModeFreeTimeField; MI_Button* miShyGuyTagModeBackButton; MI_Image* miShyGuyTagModeLeftHeaderBar; @@ -250,9 +250,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miShyGuyTagModeHeaderText; // Boss - MI_SelectFieldDyn* miBossModeTypeField; - MI_SelectFieldDyn* miBossModeDifficultyField; - MI_SelectFieldDyn* miBossModeHitPointsField; + MI_SelectField* miBossModeTypeField; + MI_SelectField* miBossModeDifficultyField; + MI_SelectField* miBossModeHitPointsField; MI_Button* miBossModeBackButton; MI_Image* miBossModeLeftHeaderBar; diff --git a/src/smw/menu/network/NetNewRoomSettingsMenu.cpp b/src/smw/menu/network/NetNewRoomSettingsMenu.cpp index 33d94742..5c3d61b6 100644 --- a/src/smw/menu/network/NetNewRoomSettingsMenu.cpp +++ b/src/smw/menu/network/NetNewRoomSettingsMenu.cpp @@ -23,7 +23,7 @@ UI_NetNewRoomSettingsMenu::UI_NetNewRoomSettingsMenu(const UI_GameSettingsMenu* miModeField = new MI_ImageSelectField(*(gsm->miModeField)); for (short iGoalField = 0; iGoalField < GAMEMODE_LAST; iGoalField++) - miGoalField[iGoalField] = new MI_SelectFieldDyn(*(gsm->miGoalField[iGoalField])); + miGoalField[iGoalField] = new MI_SelectField(*(gsm->miGoalField[iGoalField])); miMapField = new MI_MapField(&rm->spr_selectfield, 70, 165, "Map", 400, 120, true); netplay.mapfilepath = getCurrentMapPath(); diff --git a/src/smw/menu/network/NetNewRoomSettingsMenu.h b/src/smw/menu/network/NetNewRoomSettingsMenu.h index cf7483dc..83c5fc57 100644 --- a/src/smw/menu/network/NetNewRoomSettingsMenu.h +++ b/src/smw/menu/network/NetNewRoomSettingsMenu.h @@ -10,7 +10,7 @@ class MI_ImageSelectField; class MI_MapField; class MI_Text; class UI_GameSettingsMenu; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_NetNewRoomSettingsMenu : public UI_Menu { @@ -24,7 +24,7 @@ class UI_NetNewRoomSettingsMenu : public UI_Menu { private: MI_ImageSelectField* miModeField; - MI_SelectFieldDyn* miGoalField[22]; + MI_SelectField* miGoalField[22]; MI_Button* miModeSettingsButton; MI_MapField* miMapField; MI_Button* miContinueButton; diff --git a/src/smw/menu/options/EyeCandyOptionsMenu.cpp b/src/smw/menu/options/EyeCandyOptionsMenu.cpp index f13e7683..cad0116d 100644 --- a/src/smw/menu/options/EyeCandyOptionsMenu.cpp +++ b/src/smw/menu/options/EyeCandyOptionsMenu.cpp @@ -14,14 +14,14 @@ extern CGameValues game_values; UI_EyeCandyOptionsMenu::UI_EyeCandyOptionsMenu() : UI_Menu() { - miSpawnStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 80, "Spawn Style", 500, 220); + miSpawnStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 80, "Spawn Style", 500, 220); miSpawnStyleField->add("Instant", 0); miSpawnStyleField->add("Door", 1); miSpawnStyleField->add("Swirl", 2); miSpawnStyleField->setOutputPtr(&game_values.spawnstyle); miSpawnStyleField->setCurrentValue(game_values.spawnstyle); - miAwardStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 120, "Award Style", 500, 220); + miAwardStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Award Style", 500, 220); miAwardStyleField->add("None", 0); miAwardStyleField->add("Fireworks", 1); miAwardStyleField->add("Spiral", 2); @@ -31,42 +31,42 @@ UI_EyeCandyOptionsMenu::UI_EyeCandyOptionsMenu() miAwardStyleField->setOutputPtr(&game_values.awardstyle); miAwardStyleField->setCurrentValue(game_values.awardstyle); - miScoreStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Score Location", 500, 220); + miScoreStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Score Location", 500, 220); miScoreStyleField->add("Top", 0); miScoreStyleField->add("Bottom", 1); miScoreStyleField->add("Corners", 2); miScoreStyleField->setOutputPtr(&game_values.scoreboardstyle); miScoreStyleField->setCurrentValue(game_values.scoreboardstyle); - miCrunchField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Screen Crunch", 500, 220); + miCrunchField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Crunch", 500, 220); miCrunchField->add("Off", false); miCrunchField->add("On", true); miCrunchField->setOutputPtr(&game_values.screencrunch); miCrunchField->setCurrentValue(game_values.screencrunch ? 1 : 0); miCrunchField->setAutoAdvance(true); - miWinningCrownField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 240, "Leader Crown", 500, 220); + miWinningCrownField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Leader Crown", 500, 220); miWinningCrownField->add("Off", false); miWinningCrownField->add("On", true); miWinningCrownField->setOutputPtr(&game_values.showwinningcrown); miWinningCrownField->setCurrentValue(game_values.showwinningcrown ? 1 : 0); miWinningCrownField->setAutoAdvance(true); - miStartCountDownField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Start Countdown", 500, 220); + miStartCountDownField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Start Countdown", 500, 220); miStartCountDownField->add("Off", false); miStartCountDownField->add("On", true); miStartCountDownField->setOutputPtr(&game_values.startgamecountdown); miStartCountDownField->setCurrentValue(game_values.startgamecountdown ? 1 : 0); miStartCountDownField->setAutoAdvance(true); - miStartModeDisplayField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 320, "Show Mode", 500, 220); + miStartModeDisplayField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Show Mode", 500, 220); miStartModeDisplayField->add("Off", false); miStartModeDisplayField->add("On", true); miStartModeDisplayField->setOutputPtr(&game_values.startmodedisplay); miStartModeDisplayField->setCurrentValue(game_values.startmodedisplay ? 1 : 0); miStartModeDisplayField->setAutoAdvance(true); - miDeadTeamNoticeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 360, "Dead Team Notice", 500, 220); + miDeadTeamNoticeField = new MI_SelectField(&rm->spr_selectfield, 70, 360, "Dead Team Notice", 500, 220); miDeadTeamNoticeField->add("Off", false); miDeadTeamNoticeField->add("On", true); miDeadTeamNoticeField->setOutputPtr(&game_values.deadteamnotice); diff --git a/src/smw/menu/options/EyeCandyOptionsMenu.h b/src/smw/menu/options/EyeCandyOptionsMenu.h index 90d5e5e5..62e8d69f 100644 --- a/src/smw/menu/options/EyeCandyOptionsMenu.h +++ b/src/smw/menu/options/EyeCandyOptionsMenu.h @@ -5,7 +5,7 @@ class MI_Button; class MI_Image; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_EyeCandyOptionsMenu : public UI_Menu { @@ -13,14 +13,14 @@ class UI_EyeCandyOptionsMenu : public UI_Menu { UI_EyeCandyOptionsMenu(); private: - MI_SelectFieldDyn* miSpawnStyleField; - MI_SelectFieldDyn* miAwardStyleField; - MI_SelectFieldDyn* miScoreStyleField; - MI_SelectFieldDyn* miCrunchField; - MI_SelectFieldDyn* miWinningCrownField; - MI_SelectFieldDyn* miStartCountDownField; - MI_SelectFieldDyn* miStartModeDisplayField; - MI_SelectFieldDyn* miDeadTeamNoticeField; + MI_SelectField* miSpawnStyleField; + MI_SelectField* miAwardStyleField; + MI_SelectField* miScoreStyleField; + MI_SelectField* miCrunchField; + MI_SelectField* miWinningCrownField; + MI_SelectField* miStartCountDownField; + MI_SelectField* miStartModeDisplayField; + MI_SelectField* miDeadTeamNoticeField; MI_Button* miEyeCandyOptionsMenuBackButton; diff --git a/src/smw/menu/options/GameplayOptionsMenu.cpp b/src/smw/menu/options/GameplayOptionsMenu.cpp index fcc6faf5..d3a13ca1 100644 --- a/src/smw/menu/options/GameplayOptionsMenu.cpp +++ b/src/smw/menu/options/GameplayOptionsMenu.cpp @@ -14,7 +14,7 @@ extern CGameValues game_values; UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() : UI_Menu() { - miRespawnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 40, "Respawn Time", 500, 220); + miRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 40, "Respawn Time", 500, 220); miRespawnField->add("Instant", 0); miRespawnField->add("0.5 Seconds", 1); miRespawnField->add("1.0 Seconds", 2); @@ -39,7 +39,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miRespawnField->setOutputPtr(&game_values.respawn); miRespawnField->setCurrentValue(game_values.respawn); - miShieldStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 80, "Shield Style", 500, 220); + miShieldStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 80, "Shield Style", 500, 220); miShieldStyleField->add("No Shield", 0); miShieldStyleField->add("Soft", 1); miShieldStyleField->add("Soft with Stomp", 2); @@ -47,7 +47,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miShieldStyleField->setOutputPtr(&game_values.shieldstyle); miShieldStyleField->setCurrentValue(game_values.shieldstyle); - miShieldTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 120, "Shield Time", 500, 220); + miShieldTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Shield Time", 500, 220); miShieldTimeField->add("0.5 Seconds", 31); miShieldTimeField->add("1.0 Seconds", 62); miShieldTimeField->add("1.5 Seconds", 93); @@ -61,7 +61,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miShieldTimeField->setOutputPtr(&game_values.shieldtime); miShieldTimeField->setCurrentValue(game_values.shieldtime); - miBoundsTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Bounds Time", 500, 220); + miBoundsTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Bounds Time", 500, 220); miBoundsTimeField->add("Infinite", 0); miBoundsTimeField->add("1 Second", 1); miBoundsTimeField->add("2 Seconds", 2); @@ -76,7 +76,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miBoundsTimeField->setOutputPtr(&game_values.outofboundstime); miBoundsTimeField->setCurrentValue(game_values.outofboundstime); - miSuicideTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Suicide Time", 500, 220); + miSuicideTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Suicide Time", 500, 220); miSuicideTimeField->add("Off", 0); miSuicideTimeField->add("3 Seconds", 186); miSuicideTimeField->add("5 Seconds", 310); @@ -87,7 +87,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miSuicideTimeField->setOutputPtr(&game_values.suicidetime); miSuicideTimeField->setCurrentValue(game_values.suicidetime); - miWarpLockStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 240, "Warp Lock Style", 500, 220); + miWarpLockStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Warp Lock Style", 500, 220); miWarpLockStyleField->add("Entrance Only", 0); miWarpLockStyleField->add("Exit Only", 1); miWarpLockStyleField->add("Entrance and Exit", 2); @@ -96,7 +96,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miWarpLockStyleField->setOutputPtr(&game_values.warplockstyle); miWarpLockStyleField->setCurrentValue(game_values.warplockstyle); - miWarpLockTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Warp Lock Time", 500, 220); + miWarpLockTimeField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Warp Lock Time", 500, 220); miWarpLockTimeField->add("Off", 0); miWarpLockTimeField->add("1 Second", 62); miWarpLockTimeField->add("2 Seconds", 124); @@ -111,7 +111,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miWarpLockTimeField->setOutputPtr(&game_values.warplocktime); miWarpLockTimeField->setCurrentValue(game_values.warplocktime); - miBotsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 320, "Bot Difficulty", 500, 220); + miBotsField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Bot Difficulty", 500, 220); miBotsField->add("Very Easy", 0); miBotsField->add("Easy", 1); miBotsField->add("Moderate", 2); @@ -120,7 +120,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miBotsField->setOutputPtr(&game_values.cpudifficulty); miBotsField->setCurrentValue(game_values.cpudifficulty); - miPointSpeedField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 360, "Point Speed", 500, 220); + miPointSpeedField = new MI_SelectField(&rm->spr_selectfield, 70, 360, "Point Speed", 500, 220); miPointSpeedField->add("Very Slow", 60); miPointSpeedField->add("Slow", 40); miPointSpeedField->add("Moderate", 20); @@ -129,7 +129,7 @@ UI_GameplayOptionsMenu::UI_GameplayOptionsMenu() miPointSpeedField->setOutputPtr(&game_values.pointspeed); miPointSpeedField->setCurrentValue(game_values.pointspeed); - miSecretsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 400, "Secrets", 500, 220); + miSecretsField = new MI_SelectField(&rm->spr_selectfield, 70, 400, "Secrets", 500, 220); miSecretsField->add("Off", false); miSecretsField->add("On", true); miSecretsField->setOutputPtr(&game_values.secretsenabled); diff --git a/src/smw/menu/options/GameplayOptionsMenu.h b/src/smw/menu/options/GameplayOptionsMenu.h index 527b1c4e..c86f4146 100644 --- a/src/smw/menu/options/GameplayOptionsMenu.h +++ b/src/smw/menu/options/GameplayOptionsMenu.h @@ -5,7 +5,7 @@ class MI_Button; class MI_Image; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; /* This menu is where you can change various gameplay-related @@ -16,16 +16,16 @@ class UI_GameplayOptionsMenu : public UI_Menu { UI_GameplayOptionsMenu(); private: - MI_SelectFieldDyn* miRespawnField; - MI_SelectFieldDyn* miShieldStyleField; - MI_SelectFieldDyn* miShieldTimeField; - MI_SelectFieldDyn* miBoundsTimeField; - MI_SelectFieldDyn* miSuicideTimeField; - MI_SelectFieldDyn* miWarpLockStyleField; - MI_SelectFieldDyn* miWarpLockTimeField; - MI_SelectFieldDyn* miBotsField; - MI_SelectFieldDyn* miPointSpeedField; - MI_SelectFieldDyn* miSecretsField; + MI_SelectField* miRespawnField; + MI_SelectField* miShieldStyleField; + MI_SelectField* miShieldTimeField; + MI_SelectField* miBoundsTimeField; + MI_SelectField* miSuicideTimeField; + MI_SelectField* miWarpLockStyleField; + MI_SelectField* miWarpLockTimeField; + MI_SelectField* miBotsField; + MI_SelectField* miPointSpeedField; + MI_SelectField* miSecretsField; MI_Button* miGameplayOptionsMenuBackButton; MI_Image* miGameplayOptionsMenuLeftHeaderBar; diff --git a/src/smw/menu/options/GraphicsOptionsMenu.cpp b/src/smw/menu/options/GraphicsOptionsMenu.cpp index a7a82780..fd13d6ed 100644 --- a/src/smw/menu/options/GraphicsOptionsMenu.cpp +++ b/src/smw/menu/options/GraphicsOptionsMenu.cpp @@ -19,14 +19,14 @@ extern GraphicsList* gamegraphicspacklist; UI_GraphicsOptionsMenu::UI_GraphicsOptionsMenu() : UI_Menu() { - miTopLayerField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 120, "Draw Top Layer", 500, 220); + miTopLayerField = new MI_SelectField(&rm->spr_selectfield, 70, 120, "Draw Top Layer", 500, 220); miTopLayerField->add("Background", false); miTopLayerField->add("Foreground", true); miTopLayerField->setOutputPtr(&game_values.toplayer); miTopLayerField->setCurrentValue(game_values.toplayer ? 1 : 0); miTopLayerField->setAutoAdvance(true); - miFrameLimiterField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Frame Limit", 500, 220); + miFrameLimiterField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Frame Limit", 500, 220); miFrameLimiterField->add("10 FPS", 100); miFrameLimiterField->add("15 FPS", 67); miFrameLimiterField->add("20 FPS", 50); @@ -60,7 +60,7 @@ UI_GraphicsOptionsMenu::UI_GraphicsOptionsMenu() miScreenSettingsButton = new MI_Button(&rm->spr_selectfield, 70, 200, "Screen Settings", 500, 0); miScreenSettingsButton->SetCode(MENU_CODE_TO_SCREEN_SETTINGS); #else - miFullscreenField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Screen Size", 500, 220); + miFullscreenField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Size", 500, 220); miFullscreenField->add("Windowed", false); miFullscreenField->add("Fullscreen", true); miFullscreenField->setOutputPtr(&game_values.fullscreen); diff --git a/src/smw/menu/options/GraphicsOptionsMenu.h b/src/smw/menu/options/GraphicsOptionsMenu.h index 7ba98948..cb20e225 100644 --- a/src/smw/menu/options/GraphicsOptionsMenu.h +++ b/src/smw/menu/options/GraphicsOptionsMenu.h @@ -6,7 +6,7 @@ class MI_Button; class MI_Image; class MI_PacksField; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; /* @@ -18,13 +18,13 @@ class UI_GraphicsOptionsMenu : public UI_Menu { UI_GraphicsOptionsMenu(); private: - MI_SelectFieldDyn* miTopLayerField; - MI_SelectFieldDyn* miFrameLimiterField; + MI_SelectField* miTopLayerField; + MI_SelectField* miFrameLimiterField; #ifdef _XBOX MI_Button* miScreenSettingsButton; #else - MI_SelectFieldDyn* miFullscreenField; + MI_SelectField* miFullscreenField; #endif //_XBOX MI_PacksField* miMenuGraphicsPackField; diff --git a/src/smw/menu/options/PowerupSettingsMenu.cpp b/src/smw/menu/options/PowerupSettingsMenu.cpp index 7ddb95f5..fac2f80e 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.cpp +++ b/src/smw/menu/options/PowerupSettingsMenu.cpp @@ -15,7 +15,7 @@ extern CGameValues game_values; UI_PowerupSettingsMenu::UI_PowerupSettingsMenu() : UI_Menu() { - miStoredPowerupDelayField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Item Use Speed", 500, 220); + miStoredPowerupDelayField = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Item Use Speed", 500, 220); miStoredPowerupDelayField->add("Very Slow", 2); miStoredPowerupDelayField->add("Slow", 3); miStoredPowerupDelayField->add("Moderate", 4); @@ -24,7 +24,7 @@ UI_PowerupSettingsMenu::UI_PowerupSettingsMenu() miStoredPowerupDelayField->setOutputPtr(&game_values.storedpowerupdelay); miStoredPowerupDelayField->setCurrentValue(game_values.storedpowerupdelay); - miItemRespawnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 140, "Item Spawn", 500, 220); + miItemRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Item Spawn", 500, 220); miItemRespawnField->add("Off", 0); miItemRespawnField->add("5 Seconds", 310); miItemRespawnField->add("10 Seconds", 620); @@ -41,7 +41,7 @@ UI_PowerupSettingsMenu::UI_PowerupSettingsMenu() miItemRespawnField->setOutputPtr(&game_values.itemrespawntime); miItemRespawnField->setCurrentValue(game_values.itemrespawntime); - miHiddenBlockRespawnField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Hidden Block Hide", 500, 220); + miHiddenBlockRespawnField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Hidden Block Hide", 500, 220); miHiddenBlockRespawnField->add("Off", 0); miHiddenBlockRespawnField->add("5 Seconds", 310); miHiddenBlockRespawnField->add("10 Seconds", 620); @@ -58,21 +58,21 @@ UI_PowerupSettingsMenu::UI_PowerupSettingsMenu() miHiddenBlockRespawnField->setOutputPtr(&game_values.hiddenblockrespawn); miHiddenBlockRespawnField->setCurrentValue(game_values.hiddenblockrespawn); - miSwapStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 220, "Swap Style", 500, 220); + miSwapStyleField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Swap Style", 500, 220); miSwapStyleField->add("Walk", 0); miSwapStyleField->add("Blink", 1); miSwapStyleField->add("Instant", 2); miSwapStyleField->setOutputPtr(&game_values.swapstyle); miSwapStyleField->setCurrentValue(game_values.swapstyle); - miBonusWheelField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 260, "Bonus Wheel", 500, 220); + miBonusWheelField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "Bonus Wheel", 500, 220); miBonusWheelField->add("Off", 0); miBonusWheelField->add("Tournament Win", 1); miBonusWheelField->add("Every Game", 2); miBonusWheelField->setOutputPtr(&game_values.bonuswheel); miBonusWheelField->setCurrentValue(game_values.bonuswheel); - miKeepPowerupField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 300, "Bonus Item", 500, 220); + miKeepPowerupField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "Bonus Item", 500, 220); miKeepPowerupField->add("Until Next Spin", false); miKeepPowerupField->add("Keep Always", true); miKeepPowerupField->setOutputPtr(&game_values.keeppowerup); diff --git a/src/smw/menu/options/PowerupSettingsMenu.h b/src/smw/menu/options/PowerupSettingsMenu.h index 58a5d71c..185716bf 100644 --- a/src/smw/menu/options/PowerupSettingsMenu.h +++ b/src/smw/menu/options/PowerupSettingsMenu.h @@ -6,7 +6,7 @@ class MI_Button; class MI_Image; class MI_StoredPowerupResetButton; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; /* In this menu, you can change some powerup settings, @@ -17,12 +17,12 @@ class UI_PowerupSettingsMenu : public UI_Menu { UI_PowerupSettingsMenu(); private: - MI_SelectFieldDyn* miStoredPowerupDelayField = nullptr; - MI_SelectFieldDyn* miItemRespawnField = nullptr; - MI_SelectFieldDyn* miSwapStyleField = nullptr; - MI_SelectFieldDyn* miBonusWheelField = nullptr; - MI_SelectFieldDyn* miKeepPowerupField = nullptr; - MI_SelectFieldDyn* miHiddenBlockRespawnField = nullptr; + MI_SelectField* miStoredPowerupDelayField = nullptr; + MI_SelectField* miItemRespawnField = nullptr; + MI_SelectField* miSwapStyleField = nullptr; + MI_SelectField* miBonusWheelField = nullptr; + MI_SelectField* miKeepPowerupField = nullptr; + MI_SelectField* miHiddenBlockRespawnField = nullptr; MI_StoredPowerupResetButton* miStoredPowerupResetButton = nullptr; MI_Button* miPowerupSettingsMenuBackButton = nullptr; diff --git a/src/smw/menu/options/ProjectileLimitsMenu.cpp b/src/smw/menu/options/ProjectileLimitsMenu.cpp index 1c863562..8e7901e5 100644 --- a/src/smw/menu/options/ProjectileLimitsMenu.cpp +++ b/src/smw/menu/options/ProjectileLimitsMenu.cpp @@ -14,7 +14,7 @@ extern CGameValues game_values; UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() : UI_Menu() { - miFireballLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 60, "Fireball Limit", 500, 220); + miFireballLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 60, "Fireball Limit", 500, 220); miFireballLimitField->add("Unlimited", 0); miFireballLimitField->add("2", 2); miFireballLimitField->add("5", 5); @@ -30,7 +30,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miFireballLimitField->setOutputPtr(&game_values.fireballlimit); miFireballLimitField->setCurrentValue(game_values.fireballlimit); - miHammerLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Hammer Limit", 500, 220); + miHammerLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Hammer Limit", 500, 220); miHammerLimitField->add("Unlimited", 0); miHammerLimitField->add("2", 2); miHammerLimitField->add("5", 5); @@ -46,7 +46,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miHammerLimitField->setOutputPtr(&game_values.hammerlimit); miHammerLimitField->setCurrentValue(game_values.hammerlimit); - miBoomerangLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 140, "Boomerang Limit", 500, 220); + miBoomerangLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Boomerang Limit", 500, 220); miBoomerangLimitField->add("Unlimited", 0); miBoomerangLimitField->add("2", 2); miBoomerangLimitField->add("5", 5); @@ -62,7 +62,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miBoomerangLimitField->setOutputPtr(&game_values.boomeranglimit); miBoomerangLimitField->setCurrentValue(game_values.boomeranglimit); - miFeatherLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Feather Limit", 500, 220); + miFeatherLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Feather Limit", 500, 220); miFeatherLimitField->add("Unlimited", 0); miFeatherLimitField->add("2", 2); miFeatherLimitField->add("5", 5); @@ -78,7 +78,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miFeatherLimitField->setOutputPtr(&game_values.featherlimit); miFeatherLimitField->setCurrentValue(game_values.featherlimit); - miLeafLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 220, "Leaf Limit", 500, 220); + miLeafLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Leaf Limit", 500, 220); miLeafLimitField->add("Unlimited", 0); miLeafLimitField->add("2", 2); miLeafLimitField->add("5", 5); @@ -94,7 +94,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miLeafLimitField->setOutputPtr(&game_values.leaflimit); miLeafLimitField->setCurrentValue(game_values.leaflimit); - miPwingsLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 260, "P-Wings Limit", 500, 220); + miPwingsLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "P-Wings Limit", 500, 220); miPwingsLimitField->add("Unlimited", 0); miPwingsLimitField->add("2", 2); miPwingsLimitField->add("5", 5); @@ -110,7 +110,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miPwingsLimitField->setOutputPtr(&game_values.pwingslimit); miPwingsLimitField->setCurrentValue(game_values.pwingslimit); - miTanookiLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 300, "Tanooki Limit", 500, 220); + miTanookiLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "Tanooki Limit", 500, 220); miTanookiLimitField->add("Unlimited", 0); miTanookiLimitField->add("2", 2); miTanookiLimitField->add("5", 5); @@ -126,7 +126,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miTanookiLimitField->setOutputPtr(&game_values.tanookilimit); miTanookiLimitField->setCurrentValue(game_values.tanookilimit); - miBombLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 340, "Bomb Limit", 500, 220); + miBombLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 340, "Bomb Limit", 500, 220); miBombLimitField->add("Unlimited", 0); miBombLimitField->add("2", 2); miBombLimitField->add("5", 5); @@ -142,7 +142,7 @@ UI_ProjectileLimitsMenu::UI_ProjectileLimitsMenu() miBombLimitField->setOutputPtr(&game_values.bombslimit); miBombLimitField->setCurrentValue(game_values.bombslimit); - miWandLimitField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 380, "Wand Limit", 500, 220); + miWandLimitField = new MI_SelectField(&rm->spr_selectfield, 70, 380, "Wand Limit", 500, 220); miWandLimitField->add("Unlimited", 0); miWandLimitField->add("2", 2); miWandLimitField->add("5", 5); diff --git a/src/smw/menu/options/ProjectileLimitsMenu.h b/src/smw/menu/options/ProjectileLimitsMenu.h index 9bfe03a1..bd927864 100644 --- a/src/smw/menu/options/ProjectileLimitsMenu.h +++ b/src/smw/menu/options/ProjectileLimitsMenu.h @@ -5,7 +5,7 @@ class MI_Button; class MI_Image; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; /* You can set the maximum number of uses of certain @@ -16,15 +16,15 @@ class UI_ProjectileLimitsMenu : public UI_Menu { UI_ProjectileLimitsMenu(); private: - MI_SelectFieldDyn* miFireballLimitField; - MI_SelectFieldDyn* miHammerLimitField; - MI_SelectFieldDyn* miBoomerangLimitField; - MI_SelectFieldDyn* miFeatherLimitField; - MI_SelectFieldDyn* miLeafLimitField; - MI_SelectFieldDyn* miPwingsLimitField; - MI_SelectFieldDyn* miTanookiLimitField; - MI_SelectFieldDyn* miBombLimitField; - MI_SelectFieldDyn* miWandLimitField; + MI_SelectField* miFireballLimitField; + MI_SelectField* miHammerLimitField; + MI_SelectField* miBoomerangLimitField; + MI_SelectField* miFeatherLimitField; + MI_SelectField* miLeafLimitField; + MI_SelectField* miPwingsLimitField; + MI_SelectField* miTanookiLimitField; + MI_SelectField* miBombLimitField; + MI_SelectField* miWandLimitField; MI_Button* miProjectilesLimitsMenuBackButton; diff --git a/src/smw/menu/options/ProjectileOptionsMenu.cpp b/src/smw/menu/options/ProjectileOptionsMenu.cpp index a533ceb3..38f0ad1e 100644 --- a/src/smw/menu/options/ProjectileOptionsMenu.cpp +++ b/src/smw/menu/options/ProjectileOptionsMenu.cpp @@ -14,7 +14,7 @@ extern CGameValues game_values; UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() : UI_Menu() { - miFireballLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 80, "Life", 305, 120); + miFireballLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 80, "Life", 305, 120); miFireballLifeField->add("1 Second", 62); miFireballLifeField->add("2 Seconds", 124); miFireballLifeField->add("3 Seconds", 186); @@ -28,7 +28,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miFireballLifeField->setOutputPtr(&game_values.fireballttl); miFireballLifeField->setCurrentValue(game_values.fireballttl); - miFeatherJumpsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 150, "Jumps", 305, 120); + miFeatherJumpsField = new MI_SelectField(&rm->spr_selectfield, 10, 150, "Jumps", 305, 120); miFeatherJumpsField->add("1", 1); miFeatherJumpsField->add("2", 2); miFeatherJumpsField->add("3", 3); @@ -37,7 +37,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miFeatherJumpsField->setOutputPtr(&game_values.featherjumps); miFeatherJumpsField->setCurrentValue(game_values.featherjumps); - miBoomerangStyleField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 220, "Style", 305, 120); + miBoomerangStyleField = new MI_SelectField(&rm->spr_selectfield, 10, 220, "Style", 305, 120); miBoomerangStyleField->add("Flat", 0); miBoomerangStyleField->add("SMB3", 1); miBoomerangStyleField->add("Zelda", 2); @@ -45,7 +45,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miBoomerangStyleField->setOutputPtr(&game_values.boomerangstyle); miBoomerangStyleField->setCurrentValue(game_values.boomerangstyle); - miBoomerangLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 260, "Life", 305, 120); + miBoomerangLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 260, "Life", 305, 120); miBoomerangLifeField->add("1 Second", 62); miBoomerangLifeField->add("2 Seconds", 124); miBoomerangLifeField->add("3 Seconds", 186); @@ -59,7 +59,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miBoomerangLifeField->setOutputPtr(&game_values.boomeranglife); miBoomerangLifeField->setCurrentValue(game_values.boomeranglife); - miHammerLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 80, "Life", 305, 120); + miHammerLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 80, "Life", 305, 120); miHammerLifeField->add("No Limit", 310); miHammerLifeField->add("0.5 Seconds", 31); miHammerLifeField->add("0.6 Seconds", 37); @@ -72,7 +72,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miHammerLifeField->setOutputPtr(&game_values.hammerttl); miHammerLifeField->setCurrentValue(game_values.hammerttl); - miHammerDelayField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 120, "Delay", 305, 120); + miHammerDelayField = new MI_SelectField(&rm->spr_selectfield, 325, 120, "Delay", 305, 120); miHammerDelayField->add("None", 0); miHammerDelayField->add("0.1 Seconds", 6); miHammerDelayField->add("0.2 Seconds", 12); @@ -87,14 +87,14 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miHammerDelayField->setOutputPtr(&game_values.hammerdelay); miHammerDelayField->setCurrentValue(game_values.hammerdelay); - miHammerOneKillField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 160, "Power", 305, 120); + miHammerOneKillField = new MI_SelectField(&rm->spr_selectfield, 325, 160, "Power", 305, 120); miHammerOneKillField->add("One Kill", true); miHammerOneKillField->add("Multiple Kills", false); miHammerOneKillField->setOutputPtr(&game_values.hammerpower); miHammerOneKillField->setCurrentValue(game_values.hammerpower); miHammerOneKillField->setAutoAdvance(true); - miShellLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 330, "Life", 305, 120); + miShellLifeField = new MI_SelectField(&rm->spr_selectfield, 10, 330, "Life", 305, 120); miShellLifeField->add("Unlimited", 0); miShellLifeField->add("1 Second", 62); miShellLifeField->add("2 Seconds", 124); @@ -113,7 +113,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miShellLifeField->setOutputPtr(&game_values.shellttl); miShellLifeField->setCurrentValue(game_values.shellttl); - miWandFreezeTimeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 10, 400, "Freeze", 305, 120); + miWandFreezeTimeField = new MI_SelectField(&rm->spr_selectfield, 10, 400, "Freeze", 305, 120); miWandFreezeTimeField->add("1 Second", 62); miWandFreezeTimeField->add("2 Seconds", 124); miWandFreezeTimeField->add("3 Seconds", 186); @@ -131,7 +131,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miWandFreezeTimeField->setOutputPtr(&game_values.wandfreezetime); miWandFreezeTimeField->setCurrentValue(game_values.wandfreezetime); - miBlueBlockLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 230, "Blue Life", 305, 120); + miBlueBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 230, "Blue Life", 305, 120); miBlueBlockLifeField->add("Unlimited", 0); miBlueBlockLifeField->add("1 Second", 62); miBlueBlockLifeField->add("2 Seconds", 124); @@ -150,7 +150,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miBlueBlockLifeField->setOutputPtr(&game_values.blueblockttl); miBlueBlockLifeField->setCurrentValue(game_values.blueblockttl); - miGrayBlockLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 270, "Gray Life", 305, 120); + miGrayBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 270, "Gray Life", 305, 120); miGrayBlockLifeField->add("Unlimited", 0); miGrayBlockLifeField->add("1 Second", 62); miGrayBlockLifeField->add("2 Seconds", 124); @@ -169,7 +169,7 @@ UI_ProjectileOptionsMenu::UI_ProjectileOptionsMenu() miGrayBlockLifeField->setOutputPtr(&game_values.grayblockttl); miGrayBlockLifeField->setCurrentValue(game_values.grayblockttl); - miRedBlockLifeField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 310, "Red Life", 305, 120); + miRedBlockLifeField = new MI_SelectField(&rm->spr_selectfield, 325, 310, "Red Life", 305, 120); miRedBlockLifeField->add("Unlimited", 0); miRedBlockLifeField->add("1 Second", 62); miRedBlockLifeField->add("2 Seconds", 124); diff --git a/src/smw/menu/options/ProjectileOptionsMenu.h b/src/smw/menu/options/ProjectileOptionsMenu.h index e608f32d..04a23a82 100644 --- a/src/smw/menu/options/ProjectileOptionsMenu.h +++ b/src/smw/menu/options/ProjectileOptionsMenu.h @@ -5,7 +5,7 @@ class MI_Button; class MI_Image; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_ProjectileOptionsMenu : public UI_Menu { @@ -13,19 +13,19 @@ class UI_ProjectileOptionsMenu : public UI_Menu { UI_ProjectileOptionsMenu(); private: - MI_SelectFieldDyn* miFireballLifeField; - MI_SelectFieldDyn* miHammerLifeField; - MI_SelectFieldDyn* miHammerDelayField; - MI_SelectFieldDyn* miHammerOneKillField; - MI_SelectFieldDyn* miShellLifeField; - MI_SelectFieldDyn* miWandFreezeTimeField; - - MI_SelectFieldDyn* miBlueBlockLifeField; - MI_SelectFieldDyn* miGrayBlockLifeField; - MI_SelectFieldDyn* miRedBlockLifeField; - MI_SelectFieldDyn* miBoomerangStyleField; - MI_SelectFieldDyn* miBoomerangLifeField; - MI_SelectFieldDyn* miFeatherJumpsField; + MI_SelectField* miFireballLifeField; + MI_SelectField* miHammerLifeField; + MI_SelectField* miHammerDelayField; + MI_SelectField* miHammerOneKillField; + MI_SelectField* miShellLifeField; + MI_SelectField* miWandFreezeTimeField; + + MI_SelectField* miBlueBlockLifeField; + MI_SelectField* miGrayBlockLifeField; + MI_SelectField* miRedBlockLifeField; + MI_SelectField* miBoomerangStyleField; + MI_SelectField* miBoomerangLifeField; + MI_SelectField* miFeatherJumpsField; MI_Button* miProjectileOptionsMenuBackButton; diff --git a/src/smw/menu/options/SoundOptionsMenu.cpp b/src/smw/menu/options/SoundOptionsMenu.cpp index 40d4916d..1080374d 100644 --- a/src/smw/menu/options/SoundOptionsMenu.cpp +++ b/src/smw/menu/options/SoundOptionsMenu.cpp @@ -53,7 +53,7 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() miMusicVolumeField->allowWrap(false); miMusicVolumeField->setItemChangedCode(MENU_CODE_MUSIC_VOLUME_CHANGED); - miPlayNextMusicField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Next Music", 500, 220); + miPlayNextMusicField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Next Music", 500, 220); miPlayNextMusicField->add("Off", false); miPlayNextMusicField->add("On", true); miPlayNextMusicField->setOutputPtr(&game_values.playnextmusic); @@ -64,7 +64,7 @@ UI_SoundOptionsMenu::UI_SoundOptionsMenu() miSoundPackField = new MI_PacksField(&rm->spr_selectfield, 70, 260, "Sound Pack", 500, 220, soundpacklist, MENU_CODE_SOUND_PACK_CHANGED); miPlaylistField = new MI_PlaylistField(&rm->spr_selectfield, 70, 300, "Game Music Pack", 500, 220); - miWorldMusicField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 340, "World Music Pack", 500, 220); + miWorldMusicField = new MI_SelectField(&rm->spr_selectfield, 70, 340, "World Music Pack", 500, 220); int iCurrentMusic = worldmusiclist->GetCurrentIndex(); worldmusiclist->SetCurrent(0); diff --git a/src/smw/menu/options/SoundOptionsMenu.h b/src/smw/menu/options/SoundOptionsMenu.h index 5c1f3225..b179663f 100644 --- a/src/smw/menu/options/SoundOptionsMenu.h +++ b/src/smw/menu/options/SoundOptionsMenu.h @@ -9,7 +9,7 @@ class MI_SliderField; class MI_PacksField; class MI_PlaylistField; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; class UI_SoundOptionsMenu : public UI_Menu { @@ -21,10 +21,10 @@ class UI_SoundOptionsMenu : public UI_Menu { private: MI_SliderField* miSoundVolumeField; MI_SliderField* miMusicVolumeField; - MI_SelectFieldDyn* miPlayNextMusicField; + MI_SelectField* miPlayNextMusicField; MI_AnnouncerField* miAnnouncerField; MI_PlaylistField* miPlaylistField; - MI_SelectFieldDyn* miWorldMusicField; + MI_SelectField* miWorldMusicField; MI_PacksField* miSoundPackField; MI_Button* miSoundOptionsMenuBackButton; diff --git a/src/smw/menu/options/TeamOptionsMenu.cpp b/src/smw/menu/options/TeamOptionsMenu.cpp index 2bc43cc2..5e0e34cd 100644 --- a/src/smw/menu/options/TeamOptionsMenu.cpp +++ b/src/smw/menu/options/TeamOptionsMenu.cpp @@ -14,21 +14,21 @@ extern CGameValues game_values; UI_TeamOptionsMenu::UI_TeamOptionsMenu() : UI_Menu() { - miTeamKillsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 180, "Player Collision", 500, 220); + miTeamKillsField = new MI_SelectField(&rm->spr_selectfield, 70, 180, "Player Collision", 500, 220); miTeamKillsField->add("Off", 0); miTeamKillsField->add("Assist", 1); miTeamKillsField->add("On", 2); miTeamKillsField->setOutputPtr(&game_values.teamcollision); miTeamKillsField->setCurrentValue(game_values.teamcollision); - miTeamColorsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 220, "Colors", 500, 220); + miTeamColorsField = new MI_SelectField(&rm->spr_selectfield, 70, 220, "Colors", 500, 220); miTeamColorsField->add("Individual", false); miTeamColorsField->add("Team", true); miTeamColorsField->setOutputPtr(&game_values.teamcolors); miTeamColorsField->setCurrentValue(game_values.teamcolors ? 1 : 0); miTeamColorsField->setAutoAdvance(true); - miTournamentControlField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 260, "Tournament Control", 500, 220); + miTournamentControlField = new MI_SelectField(&rm->spr_selectfield, 70, 260, "Tournament Control", 500, 220); miTournamentControlField->add("All", 0); miTournamentControlField->add("Game Winner", 1); miTournamentControlField->add("Game Loser", 2); diff --git a/src/smw/menu/options/TeamOptionsMenu.h b/src/smw/menu/options/TeamOptionsMenu.h index f8c26141..7c240f68 100644 --- a/src/smw/menu/options/TeamOptionsMenu.h +++ b/src/smw/menu/options/TeamOptionsMenu.h @@ -5,7 +5,7 @@ class MI_Button; class MI_Image; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; /* In this menu, you can set team-relates preferences, @@ -16,9 +16,9 @@ class UI_TeamOptionsMenu : public UI_Menu { UI_TeamOptionsMenu(); private: - MI_SelectFieldDyn* miTeamKillsField; - MI_SelectFieldDyn* miTeamColorsField; - MI_SelectFieldDyn* miTournamentControlField; + MI_SelectField* miTeamKillsField; + MI_SelectField* miTeamColorsField; + MI_SelectField* miTournamentControlField; MI_Button* miTeamOptionsMenuBackButton; MI_Image* miTeamOptionsMenuLeftHeaderBar; diff --git a/src/smw/menu/xbox/ScreenSettingsMenu.cpp b/src/smw/menu/xbox/ScreenSettingsMenu.cpp index 496cc878..baefdfe9 100644 --- a/src/smw/menu/xbox/ScreenSettingsMenu.cpp +++ b/src/smw/menu/xbox/ScreenSettingsMenu.cpp @@ -10,7 +10,7 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() miScreenResizeButton = new MI_Button(&rm->spr_selectfield, 70, 160, "Resize Screen", 500, 0); miScreenResizeButton->SetCode(MENU_CODE_TO_SCREEN_RESIZE); - miScreenHardwareFilterField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Screen Filter", 500, 220); + miScreenHardwareFilterField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Screen Filter", 500, 220); //miScreenHardwareFilterField->add("None", 0); miScreenHardwareFilterField->add("Point", 1); miScreenHardwareFilterField->add("Bilinear", 2); @@ -22,7 +22,7 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() miScreenHardwareFilterField->setCurrenzValue(game_values.hardwarefilter); miScreenHardwareFilterField->setItemChangedCode(MENU_CODE_SCREEN_FILTER_CHANGED); - miScreenFlickerFilterField = new MI_SelectFieldDyn(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 240, "Flicker Filter", 500, 220, 380); + miScreenFlickerFilterField = new MI_SelectField(&rm->spr_selectfield, &rm->menu_slider_bar, 70, 240, "Flicker Filter", 500, 220, 380); miScreenFlickerFilterField->add("0", 0); miScreenFlickerFilterField->add("1", 1); miScreenFlickerFilterField->add("2", 2); @@ -34,7 +34,7 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() miScreenFlickerFilterField->allowWrap(false); miScreenFlickerFilterField->setItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); - miScreenSoftFilterField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Soften Filter", 500, 220); + miScreenSoftFilterField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Soften Filter", 500, 220); miScreenSoftFilterField->add("Off", false); miScreenSoftFilterField->add("On", true); miScreenSoftFilterField->setOutputPtr(&game_values.softfilter); @@ -43,7 +43,7 @@ UI_ScreenSettingsMenu::UI_ScreenSettingsMenu() : UI_Menu() miScreenSoftFilterField->setItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); /* - miScreenAspectRatioField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 300, "10x11 Aspect", 500, 220); + miScreenAspectRatioField = new MI_SelectField(&rm->spr_selectfield, 70, 300, "10x11 Aspect", 500, 220); miScreenAspectRatioField->add("Off", false); miScreenAspectRatioField->add("On", true); miScreenAspectRatioField->setOutputPtr(&game_values.aspectratio10x11); diff --git a/src/smw/menu/xbox/ScreenSettingsMenu.h b/src/smw/menu/xbox/ScreenSettingsMenu.h index b4cf1837..e67ac000 100644 --- a/src/smw/menu/xbox/ScreenSettingsMenu.h +++ b/src/smw/menu/xbox/ScreenSettingsMenu.h @@ -16,10 +16,10 @@ class UI_ScreenSettingsMenu : public UI_Menu private: MI_Button * miScreenResizeButton; - MI_SelectFieldDyn* miScreenHardwareFilterField; - MI_SelectFieldDyn* miScreenFlickerFilterField; - MI_SelectFieldDyn* miScreenSoftFilterField; - //MI_SelectFieldDyn* miScreenAspectRatioField; + MI_SelectField* miScreenHardwareFilterField; + MI_SelectField* miScreenFlickerFilterField; + MI_SelectField* miScreenSoftFilterField; + //MI_SelectField* miScreenAspectRatioField; MI_Button * miScreenSettingsMenuBackButton; diff --git a/src/smw/ui/MI_FrenzyModeOptions.cpp b/src/smw/ui/MI_FrenzyModeOptions.cpp index 0e984f87..46b27c03 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.cpp +++ b/src/smw/ui/MI_FrenzyModeOptions.cpp @@ -29,7 +29,7 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short mMenu = new UI_Menu(); - miQuantityField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 40, "Limit", 400, 180); + miQuantityField = new MI_SelectField(&rm->spr_selectfield, 120, 40, "Limit", 400, 180); miQuantityField->add("Single Powerup", 0); miQuantityField->add("1 Powerup", 1); miQuantityField->add("2 Powerups", 2); @@ -44,7 +44,7 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short miQuantityField->setOutputPtr(&game_values.gamemodemenusettings.frenzy.quantity); miQuantityField->setCurrentValue(game_values.gamemodemenusettings.frenzy.quantity); - miRateField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 80, "Rate", 400, 180); + miRateField = new MI_SelectField(&rm->spr_selectfield, 120, 80, "Rate", 400, 180); miRateField->add("Instant", 0); miRateField->add("1 Second", 62); miRateField->add("2 Seconds", 124); @@ -58,7 +58,7 @@ MI_FrenzyModeOptions::MI_FrenzyModeOptions(short x, short y, short width, short miRateField->setOutputPtr(&game_values.gamemodemenusettings.frenzy.rate); miRateField->setCurrentValue(game_values.gamemodemenusettings.frenzy.rate); - miStoredShellsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 120, 120, "Store Shells", 400, 180); + miStoredShellsField = new MI_SelectField(&rm->spr_selectfield, 120, 120, "Store Shells", 400, 180); miStoredShellsField->add("Off", false); miStoredShellsField->add("On", true); miStoredShellsField->setOutputPtr(&game_values.gamemodemenusettings.frenzy.storedshells); diff --git a/src/smw/ui/MI_FrenzyModeOptions.h b/src/smw/ui/MI_FrenzyModeOptions.h index b8fd5f95..92923dd1 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.h +++ b/src/smw/ui/MI_FrenzyModeOptions.h @@ -42,9 +42,9 @@ class MI_FrenzyModeOptions : public UI_Control UI_Menu * mMenu; - MI_SelectFieldDyn * miQuantityField; - MI_SelectFieldDyn * miRateField; - MI_SelectFieldDyn* miStoredShellsField; + MI_SelectField * miQuantityField; + MI_SelectField * miRateField; + MI_SelectField* miStoredShellsField; MI_PowerupSlider * miPowerupSlider[NUMFRENZYCARDS]; MI_Button * miBackButton; diff --git a/src/smw/ui/MI_InputControlContainer.cpp b/src/smw/ui/MI_InputControlContainer.cpp index 23623a2d..00fd58e2 100644 --- a/src/smw/ui/MI_InputControlContainer.cpp +++ b/src/smw/ui/MI_InputControlContainer.cpp @@ -392,7 +392,7 @@ MI_InputControlContainer::MI_InputControlContainer(gfxSprite * spr_button, short miImage[0] = new MI_Image(spr_button, 0, 0, 0, 0, 320, 32, 1, 1, 0); miImage[1] = new MI_Image(spr_button, 320, 0, 192, 0, 320, 32, 1, 1, 0); - miDeviceSelectField = new MI_SelectFieldDyn(spr_button, x + 16, y + 38, "Device", 420, 150); + miDeviceSelectField = new MI_SelectField(spr_button, x + 16, y + 38, "Device", 420, 150); miDeviceSelectField->setItemChangedCode(MENU_CODE_INPUT_DEVICE_CHANGED); miDeviceSelectField->add("Keyboard", -1); #ifdef _XBOX diff --git a/src/smw/ui/MI_InputControlContainer.h b/src/smw/ui/MI_InputControlContainer.h index 80ac910e..0511b853 100644 --- a/src/smw/ui/MI_InputControlContainer.h +++ b/src/smw/ui/MI_InputControlContainer.h @@ -7,7 +7,7 @@ class gfxSprite; class MI_Image; class MI_Text; class MI_Button; -template class MI_SelectFieldDyn; +template class MI_SelectField; class MI_InputControlField : public UI_Control { @@ -86,7 +86,7 @@ class MI_InputControlContainer : public UI_Control MI_Image * miImage[2]; MI_Text * miText; - MI_SelectFieldDyn* miDeviceSelectField; + MI_SelectField* miDeviceSelectField; MI_Button * miInputTypeButton; MI_InputControlField * miGameInputControlFields[NUM_KEYS]; MI_InputControlField * miMenuInputControlFields[NUM_KEYS]; diff --git a/src/smw/ui/MI_PowerupSelection.cpp b/src/smw/ui/MI_PowerupSelection.cpp index 943f7497..9207a76f 100644 --- a/src/smw/ui/MI_PowerupSelection.cpp +++ b/src/smw/ui/MI_PowerupSelection.cpp @@ -75,7 +75,7 @@ MI_PowerupSelection::MI_PowerupSelection(short x, short y, short width, short nu { mMenu = std::make_unique(); - miOverride = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, iy, "Use Settings From", 500, 250); + miOverride = new MI_SelectField(&rm->spr_selectfield, 70, iy, "Use Settings From", 500, 250); miOverride->add("Map Only", 0); miOverride->add("Game Only", 1); miOverride->add("Basic Average", 2); @@ -84,7 +84,7 @@ MI_PowerupSelection::MI_PowerupSelection(short x, short y, short width, short nu miOverride->setCurrentValue(game_values.overridepowerupsettings); //miOverride->SetItemChangedCode(MENU_CODE_POWERUP_OVERRIDE_CHANGED); - miPreset = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, iy + 40, "Item Set", 500, 250); + miPreset = new MI_SelectField(&rm->spr_selectfield, 70, iy + 40, "Item Set", 500, 250); miPreset->add("Custom Set 1", 0); miPreset->add("Custom Set 2", 1); miPreset->add("Custom Set 3", 2); diff --git a/src/smw/ui/MI_PowerupSelection.h b/src/smw/ui/MI_PowerupSelection.h index f970ef7b..30ed4c82 100644 --- a/src/smw/ui/MI_PowerupSelection.h +++ b/src/smw/ui/MI_PowerupSelection.h @@ -11,7 +11,7 @@ class MI_Image; class MI_PowerupSlider; class MI_Text; class UI_Menu; -template class MI_SelectFieldDyn; +template class MI_SelectField; class MI_PowerupSelection : public UI_Control { @@ -42,8 +42,8 @@ class MI_PowerupSelection : public UI_Control { // TODO: Ownership of most members gets passed to this menu std::unique_ptr mMenu; - MI_SelectFieldDyn* miOverride = nullptr; - MI_SelectFieldDyn* miPreset = nullptr; + MI_SelectField* miOverride = nullptr; + MI_SelectField* miPreset = nullptr; std::array miPowerupSlider; diff --git a/src/smw/ui/MI_TourStop.cpp b/src/smw/ui/MI_TourStop.cpp index 001a1f41..2aa62a3b 100644 --- a/src/smw/ui/MI_TourStop.cpp +++ b/src/smw/ui/MI_TourStop.cpp @@ -28,10 +28,10 @@ MI_TourStop::MI_TourStop(short x, short y, bool fWorld) { if (fIsWorld) { miModeField = std::make_unique(&rm->spr_selectfielddisabled, &rm->menu_mode_small, 70, 85, "Mode", 305, 90, 16, 16); - miGoalField = std::make_unique>(&rm->spr_selectfielddisabled, 380, 85, "Goal", 190, 90); - miPointsField = std::make_unique>(&rm->spr_selectfielddisabled, 380, 125, "Score", 190, 90); + miGoalField = std::make_unique>(&rm->spr_selectfielddisabled, 380, 85, "Goal", 190, 90); + miPointsField = std::make_unique>(&rm->spr_selectfielddisabled, 380, 125, "Score", 190, 90); - miBonusField = std::make_unique>(&rm->spr_selectfielddisabled, 70, 125, "Bonus", 305, 90); + miBonusField = std::make_unique>(&rm->spr_selectfielddisabled, 70, 125, "Bonus", 305, 90); miBonusField->Disable(true); miEndStageImage[0] = std::make_unique(&rm->spr_worlditemsplace, 54, 201, 0, 20, 80, 248, 1, 1, 0); @@ -49,8 +49,8 @@ MI_TourStop::MI_TourStop(short x, short y, bool fWorld) } } else { miModeField = std::make_unique(&rm->spr_selectfielddisabled, &rm->menu_mode_small, 70, 85, "Mode", 500, 120, 16, 16); - miGoalField = std::make_unique>(&rm->spr_selectfielddisabled, 70, 125, "Goal", 246, 120); - miPointsField = std::make_unique>(&rm->spr_selectfielddisabled, 70 + 254, 125, "Score", 246, 120); + miGoalField = std::make_unique>(&rm->spr_selectfielddisabled, 70, 125, "Goal", 246, 120); + miPointsField = std::make_unique>(&rm->spr_selectfielddisabled, 70 + 254, 125, "Score", 246, 120); miBonusField = 0; } diff --git a/src/smw/ui/MI_TourStop.h b/src/smw/ui/MI_TourStop.h index ffdae671..1a2fc7ca 100644 --- a/src/smw/ui/MI_TourStop.h +++ b/src/smw/ui/MI_TourStop.h @@ -9,7 +9,7 @@ class MI_Image; class MI_ImageSelectField; class MI_MapField; class MI_Text; -template class MI_SelectFieldDyn; +template class MI_SelectField; class MI_TourStop : public UI_Control { @@ -24,12 +24,12 @@ class MI_TourStop : public UI_Control { private: std::unique_ptr miModeField; - std::unique_ptr> miGoalField; - std::unique_ptr> miPointsField; + std::unique_ptr> miGoalField; + std::unique_ptr> miPointsField; std::unique_ptr miMapField; std::unique_ptr miStartButton; - std::unique_ptr> miBonusField; + std::unique_ptr> miBonusField; std::array, 2> miEndStageImage; std::array, 10> miBonusIcon; diff --git a/src/worldeditor/worldeditor.cpp b/src/worldeditor/worldeditor.cpp index 70925ea7..03cd641c 100644 --- a/src/worldeditor/worldeditor.cpp +++ b/src/worldeditor/worldeditor.cpp @@ -357,16 +357,16 @@ UI_Menu mStageSettingsMenu; UI_Menu mBonusItemPicker; MI_ImageSelectField * miModeField; -MI_SelectFieldDyn * miGoalField[GAMEMODE_LAST]; +MI_SelectField * miGoalField[GAMEMODE_LAST]; MI_Button * miModeSettingsButton; MI_Button * miBonusItemsButton; -MI_SelectFieldDyn * miSpecialGoalField[3]; +MI_SelectField * miSpecialGoalField[3]; -MI_SelectFieldDyn * miFinalStageField; -MI_SelectFieldDyn * miPointsField; +MI_SelectField * miFinalStageField; +MI_SelectField * miPointsField; MI_TextField * miNameField; -MI_SelectFieldDyn * miBonusType; +MI_SelectField * miBonusType; MI_TextField * miBonusTextField[5]; MI_MapField * miMapField; @@ -383,11 +383,11 @@ MI_Button * miDeleteStageDialogNoButton; UI_Menu mVehicleMenu; MI_ImageSelectField * miVehicleSpriteField; MI_ImageSelectField * miVehicleStageField; -MI_SelectFieldDyn * miVehicleMinMovesField; -MI_SelectFieldDyn * miVehicleMaxMovesField; -MI_SelectFieldDyn * miVehiclePacesField; -MI_SelectFieldDyn * miVehicleDirectionField; -MI_SelectFieldDyn * miVehicleBoundaryField; +MI_SelectField * miVehicleMinMovesField; +MI_SelectField * miVehicleMaxMovesField; +MI_SelectField * miVehiclePacesField; +MI_SelectField * miVehicleDirectionField; +MI_SelectField * miVehicleBoundaryField; MI_Button * miVehicleCreateButton; MI_Text * miTitleText; @@ -655,7 +655,7 @@ int main(int argc, char *argv[]) for (short iGameMode = 0; iGameMode < GAMEMODE_LAST; iGameMode++) { miModeField->add(stagemodes[iGameMode].szName, iGameMode); - miGoalField[iGameMode] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, stagemodes[iGameMode].szGoal, 352, 120); + miGoalField[iGameMode] = new MI_SelectField(&rm->spr_selectfield, 70, 100, stagemodes[iGameMode].szGoal, 352, 120); miGoalField[iGameMode]->Show(iGameMode == 0); for (short iGameModeOption = 0; iGameModeOption < GAMEMODE_NUM_OPTIONS - 1; iGameModeOption++) { @@ -673,7 +673,7 @@ int main(int argc, char *argv[]) miModeField->add("Boxes Minigame", 27); //Create goal field for pipe game - miSpecialGoalField[0] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Points", 352, 120); + miSpecialGoalField[0] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Points", 352, 120); miSpecialGoalField[0]->Show(false); for (short iGameModeOption = 0; iGameModeOption < GAMEMODE_NUM_OPTIONS - 1; iGameModeOption++) { @@ -684,7 +684,7 @@ int main(int argc, char *argv[]) } //Create goal field for boss game - miSpecialGoalField[1] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); + miSpecialGoalField[1] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); miSpecialGoalField[1]->Show(false); for (short iGameLives = 1; iGameLives <= 30; iGameLives++) { @@ -694,7 +694,7 @@ int main(int argc, char *argv[]) } //Create goal field for boxes game - miSpecialGoalField[2] = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); + miSpecialGoalField[2] = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Lives", 352, 120); miSpecialGoalField[2]->Show(false); for (short iGameLives = 1; iGameLives <= 30; iGameLives++) { @@ -708,7 +708,7 @@ int main(int argc, char *argv[]) miModeSettingsButton->SetCode(MENU_CODE_TO_MODE_SETTINGS_MENU); //Points Field - miPointsField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 140, "Points", 245, 120); + miPointsField = new MI_SelectField(&rm->spr_selectfield, 70, 140, "Points", 245, 120); for (short iPoints = 0; iPoints <= 20; iPoints++) { char szPoints[8]; sprintf(szPoints, "%d", iPoints); @@ -716,7 +716,7 @@ int main(int argc, char *argv[]) } //Final Stage Field - miFinalStageField = new MI_SelectFieldDyn(&rm->spr_selectfield, 325, 140, "End Stage", 245, 120); + miFinalStageField = new MI_SelectField(&rm->spr_selectfield, 325, 140, "End Stage", 245, 120); miFinalStageField->add("No", false); miFinalStageField->add("Yes", true); miFinalStageField->setAutoAdvance(true); @@ -729,7 +729,7 @@ int main(int argc, char *argv[]) miBonusItemsButton->SetCode(MENU_CODE_TO_BONUS_PICKER_MENU); //Bonus Type - miBonusType = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 100, "Type", 500, 120); + miBonusType = new MI_SelectField(&rm->spr_selectfield, 70, 100, "Type", 500, 120); miBonusType->add("Fixed", false); miBonusType->add("Random", true); miBonusType->setAutoAdvance(true); @@ -853,7 +853,7 @@ int main(int argc, char *argv[]) miVehicleStageField = new MI_ImageSelectField(&rm->spr_selectfield, &rm->menu_mode_small, 70, 120, "Stage", 500, 150, 16, 16); miVehicleStageField->setOutputPtr(&g_wvVehicleStamp.iActionId); - miVehicleMinMovesField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 160, "Min Moves", 500, 150); + miVehicleMinMovesField = new MI_SelectField(&rm->spr_selectfield, 70, 160, "Min Moves", 500, 150); for (short iMinMoves = 0; iMinMoves <= 100; iMinMoves++) { char szMinMoves[8]; @@ -867,7 +867,7 @@ int main(int argc, char *argv[]) miVehicleMinMovesField->allowWrap(false); miVehicleMinMovesField->allowFastScroll(true); - miVehicleMaxMovesField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 200, "Max Moves", 500, 150); + miVehicleMaxMovesField = new MI_SelectField(&rm->spr_selectfield, 70, 200, "Max Moves", 500, 150); for (short iMaxMoves = 0; iMaxMoves <= 100; iMaxMoves++) { char szMaxMoves[8]; @@ -881,21 +881,21 @@ int main(int argc, char *argv[]) miVehicleMaxMovesField->allowWrap(false); miVehicleMaxMovesField->allowFastScroll(true); - miVehiclePacesField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 240, "Paces", 500, 150); + miVehiclePacesField = new MI_SelectField(&rm->spr_selectfield, 70, 240, "Paces", 500, 150); miVehiclePacesField->add("No", false); miVehiclePacesField->add("Yes", true); miVehiclePacesField->setOutputPtr(&g_wvVehicleStamp.fSpritePaces); miVehiclePacesField->setCurrentValue(g_wvVehicleStamp.fSpritePaces ? 1 : 0); miVehiclePacesField->setAutoAdvance(true); - miVehicleDirectionField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 280, "Direction", 500, 150); + miVehicleDirectionField = new MI_SelectField(&rm->spr_selectfield, 70, 280, "Direction", 500, 150); miVehicleDirectionField->add("Left", false); miVehicleDirectionField->add("Right", true); miVehicleDirectionField->setOutputPtr(&g_wvVehicleStamp.iDrawDirection); miVehicleDirectionField->setCurrentValue(g_wvVehicleStamp.iDrawDirection); miVehicleDirectionField->setAutoAdvance(true); - miVehicleBoundaryField = new MI_SelectFieldDyn(&rm->spr_selectfield, 70, 320, "Boundary", 500, 150); + miVehicleBoundaryField = new MI_SelectField(&rm->spr_selectfield, 70, 320, "Boundary", 500, 150); miVehicleBoundaryField->add("No Boundary", 0); for (short iBoundary = 1; iBoundary <= 100; iBoundary++) { @@ -3304,7 +3304,7 @@ int editor_vehicles() char szStageName[256]; sprintf(szStageName, "(%d) %s", iStage + 1, ts->szName); - SF_ListItemDyn& item = miVehicleStageField->add(szStageName, iStage); + SF_ListItem& item = miVehicleStageField->add(szStageName, iStage); item.iconOverride = ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode); }