diff --git a/src/common/ui/MI_ImageSelectField.cpp b/src/common/ui/MI_ImageSelectField.cpp index e5c56457a..5dbaf7cc1 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_SelectField(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 2916a1bdd..343f58313 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_SelectField { 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 db8429d52..4f0115ead 100644 --- a/src/common/ui/MI_SelectField.cpp +++ b/src/common/ui/MI_SelectField.cpp @@ -1,189 +1,108 @@ #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) +template +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) + , 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 + iWidth - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); + miModifyImageRight = std::make_unique(nspr, ix + width - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); miModifyImageRight->Show(false); } -MI_SelectField::MI_SelectField(const MI_SelectField& other) + +template +MI_SelectField::MI_SelectField(const MI_SelectField& 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) { - 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])); + setCurrentIndex(other.m_index); - iWidth = other.iWidth; - iIndent = other.iIndent; - - miModifyImageLeft = std::make_unique(spr, ix + iIndent - 26, iy + 4, 32, 64, 26, 24, 4, 1, 8); + 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(spr, ix + iWidth - 16, iy + 4, 32, 88, 26, 24, 4, 1, 8); + miModifyImageRight = std::make_unique(m_spr, ix + m_width - 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) +template +void MI_SelectField::Update() { - szName = std::move(name); + miModifyImageRight->Update(); + miModifyImageLeft->Update(); } -//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) +template +void MI_SelectField::Draw() { - if (index >= items.size()) - return false; - - current = items.begin(); + if (!fShow) + return; - for (unsigned int iSearch = 0; iSearch < index; iSearch++) { - ++current; + 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); } - iIndex = index; + if (m_indent> 0) + rm->menu_font_large.drawChopRight(ix + 16, iy + 5, m_indent - 8, m_name.c_str()); - SetValues(); - - return true; -} - -void MI_SelectField::Add(std::string name, short ivalue, std::string svalue, bool fvalue, bool fhidden, bool fGoodRandom, short iIconOverride) -{ - SF_ListItem * item = new SF_ListItem(name, ivalue, svalue, fvalue, fhidden, iIconOverride); - items.push_back(item); - - if (fGoodRandom) - goodRandomItems.push_back(item); - - if (items.size() >= 1) { - current = items.begin(); - iIndex = 0; + 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()); } -} - -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; - } + const bool drawLeft = m_index > 0; + if (m_wraps || drawLeft) + miModifyImageLeft->Draw(); - return false; + const bool drawRight = (m_index + 1) < m_items.size(); + if (m_wraps || drawRight) + miModifyImageRight->Draw(); } -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) +template +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(); - } - + if (m_autoAdvance && modify) { + moveNext(); return mcItemChangedCode; } @@ -196,18 +115,20 @@ MenuCodeEnum MI_SelectField::Modify(bool modify) return MENU_CODE_MODIFY_ACCEPTED; } -MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) + +template +MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) { for (int iPlayer = 0; iPlayer < 4; iPlayer++) { short iNumMoves = 1; - if (fFastScroll && playerInput->outputControls[iPlayer].menu_scrollfast.fDown) + 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(); + fMoved |= moveNext(); if (fMoved) return mcItemChangedCode; @@ -217,14 +138,14 @@ MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) bool fMoved = false; for (short iMove = 0; iMove < iNumMoves; iMove++) - fMoved |= MovePrev(); + fMoved |= movePrev(); if (fMoved) return mcItemChangedCode; } if (playerInput->outputControls[iPlayer].menu_random.fPressed) { - if (MoveRandom()) + if (moveRandom()) return mcItemChangedCode; } @@ -234,7 +155,7 @@ MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) fModifying = false; - SetValues(); + updateOutput(); return MENU_CODE_UNSELECT_ITEM; } @@ -244,139 +165,150 @@ MenuCodeEnum MI_SelectField::SendInput(CPlayerInput * playerInput) } -void MI_SelectField::Update() -{ - miModifyImageRight->Update(); - miModifyImageLeft->Update(); -} +template +MenuCodeEnum MI_SelectField::MouseClick(short iMouseX, short iMouseY) { + if (fDisable) + return MENU_CODE_NONE; -void MI_SelectField::Draw() -{ - if (!fShow) - return; + //If we are modifying this control, see if we clicked on a next/prev button + if (fModifying) { + short x, y, w, h; - 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); + 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; + } + } } - if (iIndent> 0) - rm->menu_font_large.drawChopRight(ix + 16, iy + 5, iIndent - 8, szName.c_str()); + //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; +} - // 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; +template +void MI_SelectField::Refresh() +{ + if (m_outputPtr) + setCurrentValue(*m_outputPtr); +} - if ((items.begin() != items.end() && current == items.begin())) - drawLeft = false; - if (!fNoWrap || drawLeft) - miModifyImageLeft->Draw(); +template +T MI_SelectField::randomValue() const +{ + const size_t idx = m_goodRandomIndices.at(RANDOM_INT(m_goodRandomIndices.size())); + return m_items.at(idx).value; +} - //TODO: invert order - bool drawRight = true; +template +bool MI_SelectField::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; +} - if (items.end() != items.begin()) { - if (items.begin() != --items.end()) { +template +bool MI_SelectField::setCurrentIndex(size_t index) +{ + if (m_index < m_items.size()) { + m_index = index; + updateOutput(); + return true; + } + return false; +} - if (current == --items.end()) - drawRight = false; - } - } - if (drawRight || !fNoWrap) - miModifyImageRight->Draw(); +template +void MI_SelectField::updateOutput() const +{ + if (m_outputPtr) + *m_outputPtr = currentValue(); } -void MI_SelectField::SetValues() + +template +SF_ListItem& MI_SelectField::add(std::string name, T value, bool goodRandom) { - if (iValue) - *iValue = (*current)->iValue; + size_t new_idx = m_items.size(); + m_items.emplace_back(std::move(name), std::move(value)); + m_index = 0; - if (sValue) - *sValue = (*current)->sValue; + if (goodRandom) + m_goodRandomIndices.push_back(new_idx); - if (fValue) - *fValue = (*current)->fValue; + return m_items.back(); } -bool MI_SelectField::MoveNext() + +template +void MI_SelectField::clear() { - if (items.empty()) - return false; + m_items.clear(); + m_goodRandomIndices.clear(); +} - 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++; - } +template +void MI_SelectField::hideItem(T value, bool hide) +{ + for (Item& item : m_items) { + if (item.value == value) + item.hidden = hide; + } + if (currentItem().hidden) + moveNext() || movePrev(); +} - if (findNext == current) - return false; - if (!(*findNext)->fHidden) { - current = findNext; - iIndex = iFindIndex; - SetValues(); - return true; - } +template +void MI_SelectField::hideAllItems(bool hide) +{ + for (Item& item : m_items) { + item.hidden = hide; } - - return false; } -bool MI_SelectField::MovePrev() + +template +bool MI_SelectField::moveNext() { - if (items.empty()) + if (m_items.empty()) return false; - std::vector::iterator findPrev = current; - short iFindIndex = iIndex; + // stop when detecting a restart or a loop + const size_t stop_idx = m_wraps ? m_index : 0; 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(); + m_index = (m_index + 1) % m_items.size(); + if (m_index == stop_idx) + break; + if (!currentItem().hidden) { + updateOutput(); return true; } } @@ -384,100 +316,49 @@ bool MI_SelectField::MovePrev() 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) +template +bool MI_SelectField::movePrev() +{ + if (m_items.empty()) return false; - std::vector::iterator findRandom = current; - short iFindIndex = iIndex; + // stop when detecting a restart or a loop + const size_t stop_idx = m_wraps ? m_index : (m_items.size() - 1); 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(); + m_index = (m_index + m_items.size() - 1) % m_items.size(); + if (m_index == stop_idx) + break; + if (!currentItem().hidden) { + updateOutput(); return true; } } - SetValues(); - return true; + return false; } -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; +template +bool MI_SelectField::moveRandom() +{ + std::vector valid_indices; + valid_indices.reserve(m_items.size()); - return mcItemChangedCode; - } - } + 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; - //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; + m_index = valid_indices[RANDOM_INT(valid_indices.size())]; + updateOutput(); + return true; } -void MI_SelectField::Refresh() -{ - if (iValue) - SetKey(*iValue); - else if (fValue) - SetKey(*fValue ? 1 : 0); -} + +// Actual typed classes +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 2ae0b3d2c..2f49ed830 100644 --- a/src/common/ui/MI_SelectField.h +++ b/src/common/ui/MI_SelectField.h @@ -1,176 +1,105 @@ -#ifndef UI_SELECT_FIELD_H -#define UI_SELECT_FIELD_H +#pragma once #include "uicontrol.h" -#include "gfx/gfxSprite.h" -#include "RandomNumberGenerator.h" #include #include +#include #include +class gfxSprite; class MI_Image; -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) { - 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; +template +struct SF_ListItem { + SF_ListItem(std::string&& name, T value) + : name(std::move(name)) + , value(value) + { + static_assert(std::is_trivially_copyable::value, ""); } - ~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; + const std::string name; //!< Display name + const T value; + bool hidden = false; + short iconOverride = -1; }; -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(); +template +class MI_SelectField : public UI_Control { + using Item = SF_ListItem; - 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; - } - std::string GetStringValue() { - return (*current)->sValue; - } - bool GetBoolValue() { - return (*current)->fValue; - } +public: + MI_SelectField(gfxSprite* nspr, short x, short y, std::string name, short width, short indent); + MI_SelectField(const MI_SelectField&); + virtual ~MI_SelectField() = default; - //Gets a random value, but does not set the control to that value - short GetRandomShortValue() { - return goodRandomItems[RANDOM_INT(goodRandomItems.size())]->iValue; + //! Set the displayed name. + void setTitle(std::string name) { + m_name = std::move(name); } - bool GetRandomBoolValue() { - return goodRandomItems[RANDOM_INT(goodRandomItems.size())]->fValue; + //! When this control is selected, advance the value one instead of modifying the control. + void setAutoAdvance(bool advance) { + m_autoAdvance = advance; } - - //sets the currently selected item - bool SetKey(short iID); - bool SetIndex(unsigned short iPosition); - - //Gets the currently selected item - SF_ListItem GetValue() { - return **current; + void allowWrap(bool wraps) { + m_wraps = wraps; } - - //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, std::string svalue, bool fvalue, 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) { + void setItemChangedCode(MenuCodeEnum code) { mcItemChangedCode = code; } - void SetControlSelectedCode(MenuCodeEnum 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; + void allowFastScroll(bool fastscroll) { + m_fastScroll = fastscroll; } - - MenuCodeEnum MouseClick(short iMouseX, short iMouseY); - - void Refresh(); - - void SetValues(); - - void AllowFastScroll(bool fastscroll) { - fFastScroll = fastscroll; + //! Set where the data of this control is written to (some member of game_values probably) + void setOutputPtr(T* ptr) { + m_outputPtr = ptr; } -protected: - bool MoveNext(); - bool MovePrev(); - bool MoveRandom(); - - gfxSprite* spr = nullptr; - std::string szName; - - short* iValue = nullptr; - std::string* sValue = nullptr; - bool* fValue = nullptr; + //! 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; - std::vector items; - std::vector::iterator current; + //! 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 + Item& add(std::string name, T value, bool goodRandom = true); + //! 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); + //! Updates the value pointed by the output pointer, if it's set + void updateOutput() const; - std::vector goodRandomItems; +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; - short iIndex = 0; - short iWidth = 0; - short iIndent = 0; +protected: + gfxSprite* m_spr = nullptr; + std::string m_name; std::unique_ptr miModifyImageLeft; std::unique_ptr miModifyImageRight; @@ -178,12 +107,19 @@ class MI_SelectField : public UI_Control MenuCodeEnum mcItemChangedCode = MENU_CODE_NONE; MenuCodeEnum mcControlSelectedCode = MENU_CODE_NONE; - bool fAutoAdvance = false; - bool fNoWrap = false; - - short iAdjustmentY = 0; - - bool fFastScroll = false; + 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; + + bool moveNext(); + bool movePrev(); + bool moveRandom(); }; - -#endif // UI_SELECT_FIELD_H diff --git a/src/common/ui/MI_SliderField.cpp b/src/common/ui/MI_SliderField.cpp index 5bd687015..d498ea2f6 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_SelectField(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_SelectField::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_SelectField::SendInput(playerInput); } diff --git a/src/common/ui/MI_SliderField.h b/src/common/ui/MI_SliderField.h index 3bd745cec..a2226da43 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_SelectField { +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/GSMenu.cpp b/src/smw/GSMenu.cpp index f0036ba3d..545586784 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/menu/GameSettingsMenu.cpp b/src/smw/menu/GameSettingsMenu.cpp index 35dc571f4..d18d0d377 100644 --- a/src/smw/menu/GameSettingsMenu.cpp +++ b/src/smw/menu/GameSettingsMenu.cpp @@ -33,24 +33,24 @@ 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); + 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); 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); @@ -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/GameSettingsMenu.h b/src/smw/menu/GameSettingsMenu.h index 242a9dc6e..8610ff692 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_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_SelectField* 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 047da826b..8dd663e6f 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, "", 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->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->SetData(&game_values.tournamentgames, NULL, NULL); - miTournamentField->SetKey(game_values.tournamentgames); + 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->setOutputPtr(&game_values.matchtype); + miMatchSelectionField->setCurrentValue(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->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_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"); - 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_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, "", 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, "", 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->SetData(&game_values.selectedminigame, NULL, NULL); - miMinigameField->SetKey(game_values.selectedminigame); + 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->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 5fc3e662f..ff137e560 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_SelectField; 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_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 7d742cb60..5b0e7ffe4 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, "", false, false); - miClassicModeStyleField->Add("Shield", 1, "", false, false); - 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->SetData(&game_values.gamemodemenusettings.classic.scoring, NULL, NULL); - miClassicModeScoringField->SetKey(game_values.gamemodemenusettings.classic.scoring); + 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_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); + 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, "", false, false); - miFragModeStyleField->Add("Shield", 1, "", false, false); - miFragModeStyleField->SetData(&game_values.gamemodemenusettings.frag.style, NULL, NULL); - miFragModeStyleField->SetKey(game_values.gamemodemenusettings.frag.style); + 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_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->SetData(&game_values.gamemodemenusettings.frag.scoring, NULL, NULL); - miFragModeScoringField->SetKey(game_values.gamemodemenusettings.frag.scoring); + 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); + 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,43 +91,43 @@ 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, "", false, false); - miTimeLimitModeStyleField->Add("Shield", 1, "", false, false); - miTimeLimitModeStyleField->SetData(&game_values.gamemodemenusettings.time.style, NULL, NULL); - miTimeLimitModeStyleField->SetKey(game_values.gamemodemenusettings.time.style); + 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_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->SetData(&game_values.gamemodemenusettings.time.scoring, NULL, NULL); - miTimeLimitModeScoringField->SetKey(game_values.gamemodemenusettings.time.scoring); + 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); + 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, 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->SetData(&game_values.gamemodemenusettings.time.percentextratime, NULL, NULL); - miTimeLimitModePercentExtraTime->SetKey(game_values.gamemodemenusettings.time.percentextratime); - miTimeLimitModePercentExtraTime->SetNoWrap(true); + miTimeLimitModePercentExtraTime->add("0", 0, false); + miTimeLimitModePercentExtraTime->add("5", 5, 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); + 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); 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); @@ -153,62 +153,62 @@ UI_ModeOptionsMenu::UI_ModeOptionsMenu() // Jail Mode Settings //*********************** - miJailModeStyleField = new MI_SelectField(&rm->spr_selectfield, 120, 160, "Style", 400, 150); - miJailModeStyleField->Add("Classic", 0, "", false, false); - 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->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); + 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_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); + 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_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); + 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); - 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->SetData(&game_values.gamemodemenusettings.jail.percentkey, NULL, NULL); - miJailModeJailKeyField->SetKey(game_values.gamemodemenusettings.jail.percentkey); - miJailModeJailKeyField->SetNoWrap(true); + miJailModeJailKeyField->add("0", 0, false); + miJailModeJailKeyField->add("5", 5, 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); + 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); 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); @@ -235,52 +235,52 @@ 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); - - 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->SetData(&game_values.gamemodemenusettings.coins.quantity, NULL, NULL); - miCoinModeQuantityField->SetKey(game_values.gamemodemenusettings.coins.quantity); + 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_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->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, 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->SetData(&game_values.gamemodemenusettings.coins.percentextracoin, NULL, NULL); - miCoinModePercentExtraCoin->SetKey(game_values.gamemodemenusettings.coins.percentextracoin); - miCoinModePercentExtraCoin->SetNoWrap(true); + miCoinModePercentExtraCoin->add("0", 0, false); + miCoinModePercentExtraCoin->add("5", 5, 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); + 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); 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); @@ -306,33 +306,33 @@ 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, 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->SetData(&game_values.gamemodemenusettings.stomp.rate, NULL, NULL); - miStompModeRateField->SetKey(game_values.gamemodemenusettings.stomp.rate); + 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); + 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); - 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,38 +371,38 @@ 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]->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, 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); } 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]->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, 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); } - 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->SetData(&game_values.gamemodemenusettings.egg.explode, NULL, NULL); - miEggModeExplosionTimeField->SetKey(game_values.gamemodemenusettings.egg.explode); + 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); + 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); @@ -437,64 +437,64 @@ 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->SetData(&game_values.gamemodemenusettings.flag.speed, NULL, NULL); - 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); - - 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); - - 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->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); - - 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); + 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); + 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); + + 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_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_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); + 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_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_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); + 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_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_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_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); + 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_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); + 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); @@ -592,55 +592,55 @@ 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, 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->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->SetData(&game_values.gamemodemenusettings.star.shine, NULL, NULL); - miStarModeShineField->SetKey(game_values.gamemodemenusettings.star.shine); + 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); + 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_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->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, 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->SetData(&game_values.gamemodemenusettings.star.percentextratime, NULL, NULL); - miStarModePercentExtraTime->SetKey(game_values.gamemodemenusettings.star.percentextratime); - miStarModePercentExtraTime->SetNoWrap(true); + miStarModePercentExtraTime->add("0", 0, false); + miStarModePercentExtraTime->add("5", 5, 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); + 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); 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); @@ -666,72 +666,72 @@ 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, 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->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->SetData(&game_values.gamemodemenusettings.domination.relocationfrequency, NULL, NULL); - miDominationModeRelocateFrequencyField->SetKey(game_values.gamemodemenusettings.domination.relocationfrequency); + 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); + 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_SelectField(&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); - 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_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_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_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_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_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); + 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); @@ -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, "", 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->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->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->SetData(&game_values.gamemodemenusettings.kingofthehill.maxmultiplier, NULL, NULL); - miKingOfTheHillModeMultiplierField->SetKey(game_values.gamemodemenusettings.kingofthehill.maxmultiplier); + 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->setOutputPtr(&game_values.gamemodemenusettings.kingofthehill.areasize); + miKingOfTheHillModeSizeField->setCurrentValue(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); + 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_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->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, 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->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->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->SetData(&game_values.gamemodemenusettings.race.penalty, NULL, NULL); - miRaceModePenaltyField->SetKey(game_values.gamemodemenusettings.race.penalty); + 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); + 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_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); + 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_SelectField(&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); @@ -900,50 +900,50 @@ 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); - 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->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->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); + 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); + 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_SelectField(&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_SelectField(&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); @@ -971,68 +971,68 @@ 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->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); - - 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->SetData(&game_values.gamemodemenusettings.greed.multiplier, NULL, NULL); - miGreedModeMultiplier->SetKey(game_values.gamemodemenusettings.greed.multiplier); + 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); + 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_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_SelectField(&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, 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->SetData(&game_values.gamemodemenusettings.greed.percentextracoin, NULL, NULL); - miGreedModePercentExtraCoin->SetKey(game_values.gamemodemenusettings.greed.percentextracoin); - miGreedModePercentExtraCoin->SetNoWrap(true); + miGreedModePercentExtraCoin->add("0", 0, false); + miGreedModePercentExtraCoin->add("5", 5, 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); + 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); 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); @@ -1059,61 +1059,61 @@ 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->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->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_SelectField(&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_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); + 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, 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->SetData(&game_values.gamemodemenusettings.health.percentextralife, NULL, NULL); - miHealthModePercentExtraLife->SetKey(game_values.gamemodemenusettings.health.percentextralife); - miHealthModePercentExtraLife->SetNoWrap(true); + miHealthModePercentExtraLife->add("0", 0, false); + miHealthModePercentExtraLife->add("5", 5, 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); + 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); 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); @@ -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, "", 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->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->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->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->SetData(&game_values.gamemodemenusettings.collection.cardlife, NULL, NULL); - miCollectionModeCardLifeField->SetKey(game_values.gamemodemenusettings.collection.cardlife); + 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); + 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_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); + 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_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); + 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_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); + 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,28 +1226,28 @@ 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, 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->SetData(&game_values.gamemodemenusettings.chase.phantospeed, NULL, NULL); - miChaseModeSpeedField->SetKey(game_values.gamemodemenusettings.chase.phantospeed); + 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); + 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); - 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]->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, iPhanto == 0 ? false : true); + miChaseModeQuantitySlider[iPhanto]->add("", 1); + miChaseModeQuantitySlider[iPhanto]->add("", 2); + 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]); } miChaseModeBackButton = new MI_Button(&rm->spr_selectfield, 544, 432, "Back", 80, TextAlign::CENTER); @@ -1277,34 +1277,34 @@ 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); - - 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->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->SetData(&game_values.gamemodemenusettings.shyguytag.freetime, NULL, NULL); - miShyGuyTagModeFreeTimeField->SetKey(game_values.gamemodemenusettings.shyguytag.freetime); + 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_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_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->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, "", false, false); - miBossModeTypeField->Add("Bomb", 1, "", false, false); - miBossModeTypeField->Add("Fire", 2, "", false, false); - 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->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->SetData(&game_values.gamemodemenusettings.boss.hitpoints, NULL, NULL); - miBossModeHitPointsField->SetKey(game_values.gamemodemenusettings.boss.hitpoints); + 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_SelectField(&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_SelectField(&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,119 +1399,119 @@ 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.percentextratime = miTimeLimitModePercentExtraTime->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.tagfree = miJailModeTagFreeField->GetRandomBoolValue(); - game_values.gamemodesettings.jail.percentkey = miJailModeJailKeyField->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->GetRandomBoolValue(); - game_values.gamemodesettings.coins.quantity = miCoinModeQuantityField->GetRandomShortValue(); - game_values.gamemodesettings.coins.percentextracoin = miCoinModePercentExtraCoin->GetRandomShortValue(); + game_values.gamemodesettings.coins.penalty = miCoinModePenaltyField->randomValue(); + 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]->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(); + game_values.gamemodesettings.egg.explode = miEggModeExplosionTimeField->randomValue(); } 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.autoreturn = miFlagModeAutoReturnField->GetRandomShortValue(); - game_values.gamemodesettings.flag.homescore = miFlagModeHomeScoreField->GetRandomBoolValue(); - game_values.gamemodesettings.flag.centerflag = miFlagModeCenterFlagField->GetRandomBoolValue(); + 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->randomValue(); + 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(); + 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.loseondeath = miDominationModeLoseOnDeathField->GetRandomBoolValue(); - game_values.gamemodesettings.domination.relocateondeath = miDominationModeRelocateOnDeathField->GetRandomBoolValue(); - game_values.gamemodesettings.domination.stealondeath = miDominationModeStealOnDeathField->GetRandomBoolValue(); - game_values.gamemodesettings.domination.relocationfrequency = miDominationModeRelocateFrequencyField->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->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.shield = miSurvivalModeShieldField->GetRandomBoolValue(); + 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]->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->GetRandomBoolValue(); - game_values.gamemodesettings.greed.multiplier = miGreedModeMultiplier->GetRandomShortValue(); - game_values.gamemodesettings.greed.percentextracoin = miGreedModePercentExtraCoin->GetRandomShortValue(); + game_values.gamemodesettings.greed.coinlife = miGreedModeCoinLife->randomValue(); + game_values.gamemodesettings.greed.owncoins = miGreedModeOwnCoins->randomValue(); + 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.percentextralife = miHealthModePercentExtraLife->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]->GetRandomShortValue(); + game_values.gamemodesettings.chase.phantoquantity[iPhanto] = miChaseModeQuantitySlider[iPhanto]->currentValue(); } else if (iMode == game_mode_shyguytag) { // shyguy tag - game_values.gamemodesettings.shyguytag.tagonsuicide = miShyGuyTagModeTagOnSuicideField->GetRandomBoolValue(); - game_values.gamemodesettings.shyguytag.tagtransfer = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); - game_values.gamemodesettings.shyguytag.freetime = miShyGuyTagModeTagOnStompField->GetRandomShortValue(); + game_values.gamemodesettings.shyguytag.tagonsuicide = miShyGuyTagModeTagOnSuicideField->randomValue(); + 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 ec69bc5df..c2d2304df 100644 --- a/src/smw/menu/ModeOptionsMenu.h +++ b/src/smw/menu/ModeOptionsMenu.h @@ -6,9 +6,9 @@ class MI_Button; class MI_Image; class MI_FrenzyModeOptions; class MI_PowerupSlider; -class MI_SelectField; class MI_SliderField; class MI_Text; +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_SelectField* miClassicModeStyleField; - MI_SelectField* 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_SelectField* miFragModeStyleField; - MI_SelectField* 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_SelectField* miTimeLimitModeStyleField; - MI_SelectField* 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_SelectField* miJailModeStyleField; - MI_SelectField* miJailModeTagFreeField; - MI_SelectField* miJailModeTimeFreeField; + MI_SelectField* miJailModeStyleField; + MI_SelectField* miJailModeTagFreeField; + MI_SelectField* miJailModeTimeFreeField; MI_SliderField* miJailModeJailKeyField; MI_Button* miJailModeBackButton; @@ -76,9 +76,9 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miJailModeHeaderText; // Coins - MI_SelectField* miCoinModePenaltyField; - MI_SelectField* miCoinModeQuantityField; - MI_SelectField* miCoinModePercentExtraCoin; + MI_SelectField* miCoinModePenaltyField; + MI_SelectField* miCoinModeQuantityField; + MI_SliderField* miCoinModePercentExtraCoin; MI_Button* miCoinModeBackButton; MI_Image* miCoinModeLeftHeaderBar; @@ -88,7 +88,7 @@ class UI_ModeOptionsMenu : public UI_Menu { // Yoshi's Eggs MI_PowerupSlider* miEggModeEggQuantityField[4]; MI_PowerupSlider* miEggModeYoshiQuantityField[4]; - MI_SelectField* 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_SelectField* miFlagModeTouchReturnField; - MI_SelectField* miFlagModePointMoveField; - MI_SelectField* miFlagModeAutoReturnField; - MI_SelectField* miFlagModeHomeScoreField; - MI_SelectField* 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_SelectField* miChickenModeShowTargetField; - MI_SelectField* 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_SelectField* 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_SelectField* miStarModeTimeField; - MI_SelectField* 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_SelectField* miDominationModeQuantityField; - MI_SelectField* miDominationModeLoseOnDeathField; - MI_SelectField* miDominationModeRelocateOnDeathField; - MI_SelectField* miDominationModeStealOnDeathField; - MI_SelectField* 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_SelectField* miKingOfTheHillModeSizeField; - MI_SelectField* miKingOfTheHillModeRelocateFrequencyField; - MI_SelectField* 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_SelectField* miRaceModeQuantityField; - MI_SelectField* miRaceModeSpeedField; - MI_SelectField* 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_SelectField* 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_SelectField* miSurvivalModeDensityField; - MI_SelectField* miSurvivalModeSpeedField; - MI_SelectField* miSurvivalModeShieldField; + MI_SelectField* miSurvivalModeDensityField; + MI_SelectField* miSurvivalModeSpeedField; + MI_SelectField* miSurvivalModeShieldField; MI_Button* miSurvivalModeBackButton; MI_Image* miSurvivalModeLeftHeaderBar; @@ -199,10 +199,10 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miSurvivalModeHeaderText; // Greed - MI_SelectField* miGreedModeCoinLife; - MI_SelectField* miGreedModeOwnCoins; - MI_SelectField* miGreedModeMultiplier; - MI_SelectField* miGreedModePercentExtraCoin; + MI_SelectField* miGreedModeCoinLife; + MI_SelectField* miGreedModeOwnCoins; + MI_SelectField* miGreedModeMultiplier; + MI_SliderField* miGreedModePercentExtraCoin; MI_Button* miGreedModeBackButton; MI_Image* miGreedModeLeftHeaderBar; @@ -210,8 +210,8 @@ class UI_ModeOptionsMenu : public UI_Menu { MI_Text* miGreedModeHeaderText; // Health - MI_SelectField* miHealthModeStartLife; - MI_SelectField* 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_SelectField* miCollectionModeQuantityField; - MI_SelectField* miCollectionModeRateField; - MI_SelectField* miCollectionModeBankTimeField; - MI_SelectField* 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_SelectField* 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_SelectField* miShyGuyTagModeTagOnSuicideField; - MI_SelectField* miShyGuyTagModeTagOnStompField; - MI_SelectField* 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_SelectField* miBossModeTypeField; - MI_SelectField* miBossModeDifficultyField; - MI_SelectField* miBossModeHitPointsField; + MI_SelectField* miBossModeTypeField; + MI_SelectField* miBossModeDifficultyField; + MI_SelectField* miBossModeHitPointsField; MI_Button* miBossModeBackButton; MI_Image* miBossModeLeftHeaderBar; diff --git a/src/smw/menu/network/NetNewRoomMenu.cpp b/src/smw/menu/network/NetNewRoomMenu.cpp index 649b0874f..2ff02300c 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 1bb48895c..a9d4b30ec 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 d67d3c266..5c3d61b67 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_SelectField(*(gsm->miGoalField[iGoalField])); miMapField = new MI_MapField(&rm->spr_selectfield, 70, 165, "Map", 400, 120, true); netplay.mapfilepath = getCurrentMapPath(); @@ -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/menu/network/NetNewRoomSettingsMenu.h b/src/smw/menu/network/NetNewRoomSettingsMenu.h index 1446e9eed..83c5fc576 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_SelectField; 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_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 09044b699..cad0116dd 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, "", false, false); - miSpawnStyleField->Add("Door", 1, "", false, false); - miSpawnStyleField->Add("Swirl", 2, "", false, false); - 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->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->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("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("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("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("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("On", 1, "", true, false); - miDeadTeamNoticeField->SetData(NULL, NULL, &game_values.deadteamnotice); - miDeadTeamNoticeField->SetKey(game_values.deadteamnotice ? 1 : 0); - miDeadTeamNoticeField->SetAutoAdvance(true); + 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_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->setOutputPtr(&game_values.awardstyle); + miAwardStyleField->setCurrentValue(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->setOutputPtr(&game_values.scoreboardstyle); + miScoreStyleField->setCurrentValue(game_values.scoreboardstyle); + + 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_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_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_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_SelectField(&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 6e8d881d2..62e8d69f8 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_SelectField; 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_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 57b6e9998..d3a13ca14 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, "", 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->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->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->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->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->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->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->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->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->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("On", 1, "", true, false); - miSecretsField->SetData(NULL, NULL, &game_values.secretsenabled); - miSecretsField->SetKey(game_values.secretsenabled ? 1 : 0); + 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->setOutputPtr(&game_values.respawn); + miRespawnField->setCurrentValue(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->setOutputPtr(&game_values.shieldstyle); + miShieldStyleField->setCurrentValue(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->setOutputPtr(&game_values.shieldtime); + miShieldTimeField->setCurrentValue(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->setOutputPtr(&game_values.outofboundstime); + miBoundsTimeField->setCurrentValue(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->setOutputPtr(&game_values.suicidetime); + miSuicideTimeField->setCurrentValue(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->setOutputPtr(&game_values.warplockstyle); + miWarpLockStyleField->setCurrentValue(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->setOutputPtr(&game_values.warplocktime); + miWarpLockTimeField->setCurrentValue(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->setOutputPtr(&game_values.cpudifficulty); + miBotsField->setCurrentValue(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->setOutputPtr(&game_values.pointspeed); + miPointSpeedField->setCurrentValue(game_values.pointspeed); + + 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); + 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 239bd9160..c86f4146c 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_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_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_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 35553bd33..fd13d6eda 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, "", false, false); - 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_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_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->SetData(&game_values.framelimiter, NULL, NULL); - miFrameLimiterField->SetKey(game_values.framelimiter); + 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->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, "", false, false); - 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_SelectField(&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 3ff9ce98a..cb20e225e 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_SelectField; /* @@ -18,13 +18,13 @@ class UI_GraphicsOptionsMenu : public UI_Menu { UI_GraphicsOptionsMenu(); private: - MI_SelectField* miTopLayerField; - MI_SelectField* miFrameLimiterField; + MI_SelectField* miTopLayerField; + MI_SelectField* miFrameLimiterField; #ifdef _XBOX MI_Button* miScreenSettingsButton; #else - MI_SelectField* 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 2ae16e43a..fac2f80ed 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, "", 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->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->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->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->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->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("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_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->setOutputPtr(&game_values.storedpowerupdelay); + miStoredPowerupDelayField->setCurrentValue(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->setOutputPtr(&game_values.itemrespawntime); + miItemRespawnField->setCurrentValue(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->setOutputPtr(&game_values.hiddenblockrespawn); + miHiddenBlockRespawnField->setCurrentValue(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->setOutputPtr(&game_values.swapstyle); + miSwapStyleField->setCurrentValue(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->setOutputPtr(&game_values.bonuswheel); + miBonusWheelField->setCurrentValue(game_values.bonuswheel); + + 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); + 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 ce570bd24..185716bf0 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_SelectField; /* 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_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 6488c1acb..8e7901e56 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, "", 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->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->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->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->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->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->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->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->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->SetData(&game_values.wandlimit, NULL, NULL); - miWandLimitField->SetKey(game_values.wandlimit); + 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->setOutputPtr(&game_values.fireballlimit); + miFireballLimitField->setCurrentValue(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->setOutputPtr(&game_values.hammerlimit); + miHammerLimitField->setCurrentValue(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->setOutputPtr(&game_values.boomeranglimit); + miBoomerangLimitField->setCurrentValue(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->setOutputPtr(&game_values.featherlimit); + miFeatherLimitField->setCurrentValue(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->setOutputPtr(&game_values.leaflimit); + miLeafLimitField->setCurrentValue(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->setOutputPtr(&game_values.pwingslimit); + miPwingsLimitField->setCurrentValue(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->setOutputPtr(&game_values.tanookilimit); + miTanookiLimitField->setCurrentValue(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->setOutputPtr(&game_values.bombslimit); + miBombLimitField->setCurrentValue(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->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 5f83835b6..bd927864e 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_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_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_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 555a02fe4..38f0ad1ea 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, "", 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->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->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->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->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->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->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->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->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->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->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->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->SetData(&game_values.redblockttl, NULL, NULL); - miRedBlockLifeField->SetKey(game_values.redblockttl); + 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->setOutputPtr(&game_values.fireballttl); + miFireballLifeField->setCurrentValue(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->setOutputPtr(&game_values.featherjumps); + miFeatherJumpsField->setCurrentValue(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->setOutputPtr(&game_values.boomerangstyle); + miBoomerangStyleField->setCurrentValue(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->setOutputPtr(&game_values.boomeranglife); + miBoomerangLifeField->setCurrentValue(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->setOutputPtr(&game_values.hammerttl); + miHammerLifeField->setCurrentValue(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->setOutputPtr(&game_values.hammerdelay); + miHammerDelayField->setCurrentValue(game_values.hammerdelay); + + 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_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->setOutputPtr(&game_values.shellttl); + miShellLifeField->setCurrentValue(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->setOutputPtr(&game_values.wandfreezetime); + miWandFreezeTimeField->setCurrentValue(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->setOutputPtr(&game_values.blueblockttl); + miBlueBlockLifeField->setCurrentValue(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->setOutputPtr(&game_values.grayblockttl); + miGrayBlockLifeField->setCurrentValue(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->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 ef6d44a2a..04a23a826 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_SelectField; 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_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 2c3166989..1080374d6 100644 --- a/src/smw/menu/options/SoundOptionsMenu.cpp +++ b/src/smw/menu/options/SoundOptionsMenu.cpp @@ -24,57 +24,57 @@ 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->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, "", 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->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("On", 1, "", true, false); - miPlayNextMusicField->SetData(NULL, NULL, &game_values.playnextmusic); - miPlayNextMusicField->SetKey(game_values.playnextmusic ? 1 : 0); - miPlayNextMusicField->SetAutoAdvance(true); + 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", 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_SelectField(&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); 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 a70fe460b..b179663f8 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_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_SelectField* miPlayNextMusicField; + MI_SelectField* miPlayNextMusicField; MI_AnnouncerField* miAnnouncerField; MI_PlaylistField* miPlaylistField; - MI_SelectField* 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 c1823c1ef..5e0e34cd2 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, "", false, false); - miTeamKillsField->Add("Assist", 1, "", false, false); - miTeamKillsField->Add("On", 2, "", false, false); - 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("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->SetData(&game_values.tournamentcontrolstyle, NULL, NULL); - miTournamentControlField->SetKey(game_values.tournamentcontrolstyle); + 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_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_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->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 ea475a8fe..7c240f684 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_SelectField; /* 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_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 ed4629bbd..baefdfe96 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, "", 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->SetData(&game_values.hardwarefilter, NULL, NULL); - miScreenHardwareFilterField->SetKey(game_values.hardwarefilter); - miScreenHardwareFilterField->SetItemChangedCode(MENU_CODE_SCREEN_FILTER_CHANGED); + 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->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, "", 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->SetData(&game_values.flickerfilter, NULL, NULL); - miScreenFlickerFilterField->SetKey(game_values.flickerfilter); - miScreenFlickerFilterField->SetNoWrap(true); - miScreenFlickerFilterField->SetItemChangedCode(MENU_CODE_SCREEN_SETTINGS_CHANGED); + 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); + 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, "", false, false); - 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_SelectField(&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, "", false, false); - 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_SelectField(&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 30e86f6eb..e67ac000b 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_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 12aca7a8c..46b27c033 100644 --- a/src/smw/ui/MI_FrenzyModeOptions.cpp +++ b/src/smw/ui/MI_FrenzyModeOptions.cpp @@ -29,59 +29,59 @@ 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->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->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); + 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); + 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_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); + 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_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); + 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++) { 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); @@ -238,12 +238,12 @@ 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.storedshells = miStoredShellsField->GetRandomBoolValue(); + 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++) - 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_FrenzyModeOptions.h b/src/smw/ui/MI_FrenzyModeOptions.h index 4066784c9..92923dd11 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_SelectField * miQuantityField; - MI_SelectField * miRateField; - MI_SelectField * 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 1e76511b4..00fd58e29 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, "", false, false); + 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 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 4edcd11ee..0511b853c 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_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_SelectField * 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 cba011908..9207a76f7 100644 --- a/src/smw/ui/MI_PowerupSelection.cpp +++ b/src/smw/ui/MI_PowerupSelection.cpp @@ -75,54 +75,54 @@ 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->SetData(&game_values.overridepowerupsettings, NULL, NULL); - miOverride->SetKey(game_values.overridepowerupsettings); + 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->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, "", 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->SetData(&game_values.poweruppreset, NULL, NULL); - miPreset->SetKey(game_values.poweruppreset); - miPreset->SetItemChangedCode(MENU_CODE_POWERUP_PRESET_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->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]); - 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_PowerupSelection.h b/src/smw/ui/MI_PowerupSelection.h index f8f395c59..30ed4c821 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_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_SelectField* miOverride = nullptr; - MI_SelectField* miPreset = nullptr; + MI_SelectField* miOverride = nullptr; + MI_SelectField* miPreset = nullptr; std::array miPowerupSlider; diff --git a/src/smw/ui/MI_PowerupSlider.cpp b/src/smw/ui/MI_PowerupSlider.cpp index 86f014eae..c907e72b9 100644 --- a/src/smw/ui/MI_PowerupSlider.cpp +++ b/src/smw/ui/MI_PowerupSlider.cpp @@ -1,16 +1,17 @@ #include "MI_PowerupSlider.h" +#include "gfx/gfxSprite.h" #include "ui/MI_Image.h" 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 +19,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 2a5115a75..018aaf1c7 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; }; diff --git a/src/smw/ui/MI_TourStop.cpp b/src/smw/ui/MI_TourStop.cpp index 74b5e543e..2aa62a3b4 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; } @@ -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,17 +149,17 @@ void MI_TourStop::Refresh(short iTourStop) tourstopicon = tourstop->iMode; } - miModeField->Add(gamemode->GetModeName(), tourstopicon, "", false, false); + 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 4c3ddad71..1a2fc7cab 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_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 263cbae3e..03cd641cd 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_SelectField * miGoalField[GAMEMODE_LAST]; MI_Button * miModeSettingsButton; MI_Button * miBonusItemsButton; -MI_SelectField * miSpecialGoalField[3]; +MI_SelectField * miSpecialGoalField[3]; -MI_SelectField * miFinalStageField; -MI_SelectField * miPointsField; +MI_SelectField * miFinalStageField; +MI_SelectField * miPointsField; MI_TextField * miNameField; -MI_SelectField * 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_SelectField * miVehicleMinMovesField; -MI_SelectField * miVehicleMaxMovesField; -MI_SelectField * miVehiclePacesField; -MI_SelectField * miVehicleDirectionField; -MI_SelectField * miVehicleBoundaryField; +MI_SelectField * miVehicleMinMovesField; +MI_SelectField * miVehicleMaxMovesField; +MI_SelectField * miVehiclePacesField; +MI_SelectField * miVehicleDirectionField; +MI_SelectField * miVehicleBoundaryField; MI_Button * miVehicleCreateButton; MI_Text * miTitleText; @@ -650,57 +650,57 @@ 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] = 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, "", 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); + 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++) { 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_SelectField(&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_SelectField(&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_SelectField(&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, "", false, false); - miFinalStageField->Add("Yes", 1, "", true, false); - miFinalStageField->SetAutoAdvance(true); + miFinalStageField = new MI_SelectField(&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, "", false, false); - miBonusType->Add("Random", 1, "", true, false); - miBonusType->SetAutoAdvance(true); + miBonusType = new MI_SelectField(&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); @@ -838,75 +838,75 @@ 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->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); + miVehicleMinMovesField = new MI_SelectField(&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_SelectField(&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, "", false, false); - 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("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); + 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_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_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_SelectField(&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); @@ -1195,13 +1195,13 @@ int editor_edit() g_wvVehicleStamp.iDrawDirection = vehicle->iDrawDirection; g_wvVehicleStamp.iBoundary = vehicle->iBoundary; - miVehicleSpriteField->SetKey(g_wvVehicleStamp.iDrawSprite); - miVehicleStageField->SetKey(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); + miVehicleSpriteField->setCurrentValue(g_wvVehicleStamp.iDrawSprite); + miVehicleStageField->setCurrentValue(g_wvVehicleStamp.iActionId); + 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; } @@ -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, false, true, ts->iStageType == 1 ? 24 : (ts->iMode >= 1000 ? ts->iMode - 975 : ts->iMode)); + + SF_ListItem& item = miVehicleStageField->add(szStageName, iStage); + 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(); @@ -3363,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; @@ -3705,18 +3707,18 @@ 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); - 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); @@ -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); @@ -3758,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]; @@ -3774,15 +3776,15 @@ 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); - 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); + miModeField->setCurrentValue(iMode - 975); + 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; } } @@ -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); @@ -4091,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;