/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */ #include "StdH.h" #include #include "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(); }