OpenXcom  1.0
Open-source clone of the original X-Com
OptionsModsState.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "OptionsBaseState.h"
21 #include "../Engine/ModInfo.h"
22 #include <vector>
23 #include <string>
24 #include <utility>
25 
26 namespace OpenXcom
27 {
28 
29 class TextList;
30 class ComboBox;
31 
37 {
38 private:
39  Text *_txtMaster;
40  ComboBox *_cbxMasters;
41  TextList *_lstMods;
42  std::vector<const ModInfo *> _masters;
43  std::string _curMasterId;
44  std::vector< std::pair<std::string, bool> > _mods;
45  size_t _curMasterIdx;
46 public:
48  OptionsModsState(OptionsOrigin origin);
51  std::string makeTooltip(const ModInfo &modInfo);
52  void cbxMasterHover(Action *action);
53  void cbxMasterChange(Action *action);
54  void changeMasterMod();
55  void revertMasterMod();
56  void lstModsRefresh(size_t scrollLoc);
57  void lstModsHover(Action *action);
59  void lstModsClick(Action *action);
60  void toggleMod();
62  void lstModsLeftArrowClick(Action *action);
64  void moveModUp(Action *action, unsigned int row, bool max = false);
66  void lstModsRightArrowClick(Action *action);
68  void moveModDown(Action *action, unsigned int row, bool max = false);
70  void lstModsMousePress(Action *action);
71 };
72 
73 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
List of Text&#39;s split into columns.
Definition: TextList.h:40
Options window that displays the available mods.
Definition: OptionsModsState.h:36
~OptionsModsState()
Cleans up the Advanced state.
Definition: OptionsModsState.cpp:121
Text string displayed on screen.
Definition: Text.h:40
void lstModsMousePress(Action *action)
Handler for pressing-down a mouse-button in the list.
Definition: OptionsModsState.cpp:418
void moveModDown(Action *action, unsigned int row, bool max=false)
Moves a mod down.
Definition: OptionsModsState.cpp:376
Text button with a list dropdown when pressed.
Definition: ComboBox.h:36
OptionsModsState(OptionsOrigin origin)
Creates the Advanced state.
Definition: OptionsModsState.cpp:41
void moveModUp(Action *action, unsigned int row, bool max=false)
Moves a mod up.
Definition: OptionsModsState.cpp:297
void lstModsRightArrowClick(Action *action)
Handler for clicking the right reordering button.
Definition: OptionsModsState.cpp:334
Represents mod metadata.
Definition: ModInfo.h:29
void lstModsLeftArrowClick(Action *action)
Handler for clicking the left reordering button.
Definition: OptionsModsState.cpp:256
void lstModsClick(Action *action)
Handler for clicking an item on the menu.
Definition: OptionsModsState.cpp:210
Definition: BaseInfoState.cpp:40
Options base state for common stuff across Options windows.
Definition: OptionsBaseState.h:41