/* 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 "SeriousSam/StdH.h" #include #include "SeriousSam/GUI/Menus/MenuPrinting.h" #include "MenuStuff.h" #include "MCustomizeKeyboard.h" void CCustomizeKeyboardMenu::FillListItems(void) { // disable all items first for (INDEX i = 0; igm_ctrlControlsExtra->ctrl_lhButtonActions.Count(); FOREACHINLIST(CButtonAction, ba_lnNode, _pGame->gm_ctrlControlsExtra->ctrl_lhButtonActions, itAct) { INDEX iInMenu = iLabel - gm_iListOffset; if ((iLabel >= gm_iListOffset) && (iLabel<(gm_iListOffset + gm_ctListVisible))) { bHasFirst |= (iLabel == 0); bHasLast |= (iLabel == ctLabels - 1); gm_mgKey[iInMenu].mg_strLabel = TranslateConst(itAct->ba_strName, 0); gm_mgKey[iInMenu].mg_iControlNumber = iLabel; gm_mgKey[iInMenu].SetBindingNames(FALSE); gm_mgKey[iInMenu].mg_strTip = TRANS("Enter - change binding, Backspace - unbind"); gm_mgKey[iInMenu].mg_bEnabled = TRUE; gm_mgKey[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 CCustomizeKeyboardMenu::Initialize_t(void) { // intialize Audio options menu gm_mgTitle.mg_strText = TRANS("CUSTOMIZE BUTTONS"); gm_mgTitle.mg_boxOnScreen = BoxTitle(); gm_lhGadgets.AddTail(gm_mgTitle.mg_lnNode); #define KL_START 3.0f #define KL_STEEP -1.45f for (INDEX iLabel = 0; iLabelgm_ctrlControlsExtra->ctrl_lhButtonActions.Count(); gm_iListWantedItem = 0; CGameMenu::StartMenu(); } void CCustomizeKeyboardMenu::EndMenu(void) { ControlsMenuOff(); CGameMenu::EndMenu(); }