/* Copyright (c) 2002-2012 Croteam Ltd. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "StdH.h" #include #include "MenuPrinting.h" #include "VarList.h" #include "MVar.h" extern BOOL _bVarChanged; void CVarMenu::Initialize_t(void) { gm_mgTitle.mg_boxOnScreen = BoxTitle(); gm_mgTitle.mg_strText = ""; gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode); for (INDEX iLabel = 0; iLabel= gm_iListOffset) && (iLabel<(gm_iListOffset + VARS_ON_SCREEN))) { bHasFirst |= (iLabel == 0); bHasLast |= (iLabel == ctLabels - 1); gm_mgVar[iInMenu].mg_pvsVar = &vs; gm_mgVar[iInMenu].mg_strTip = vs.vs_strTip; gm_mgVar[iInMenu].mg_bEnabled = gm_mgVar[iInMenu].IsEnabled(); gm_mgVar[iInMenu].mg_iInList = iLabel; } iLabel++; } // enable/disable up/down arrows gm_mgArrowUp.mg_bEnabled = !bHasFirst && ctLabels>0; gm_mgArrowDn.mg_bEnabled = !bHasLast && ctLabels>0; } void CVarMenu::StartMenu(void) { LoadVarSettings(gm_fnmMenuCFG); // set default parameters for the list gm_iListOffset = 0; gm_ctListTotal = _lhVarSettings.Count(); gm_iListWantedItem = 0; CGameMenu::StartMenu(); } void CVarMenu::EndMenu(void) { // disable all items first for (INDEX i = 0; i