|
1 | | -/* |
2 | | - * Copyright 2010-2015 OpenXcom Developers. |
3 | | - * |
4 | | - * This file is part of OpenXcom. |
5 | | - * |
6 | | - * OpenXcom is free software: you can redistribute it and/or modify |
7 | | - * it under the terms of the GNU General Public License as published by |
8 | | - * the Free Software Foundation, either version 3 of the License, or |
9 | | - * (at your option) any later version. |
10 | | - * |
11 | | - * OpenXcom is distributed in the hope that it will be useful, |
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | - * GNU General Public License for more details. |
15 | | - * |
16 | | - * You should have received a copy of the GNU General Public License |
17 | | - * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>. |
18 | | - */ |
19 | | -#ifndef OPENXCOM_MANUFACTUREINFOSTATE_H |
20 | | -#define OPENXCOM_MANUFACTUREINFOSTATE_H |
21 | | - |
22 | | -#include "../Engine/State.h" |
23 | | - |
24 | | -namespace OpenXcom |
25 | | -{ |
26 | | -class Base; |
27 | | -class Window; |
28 | | -class Text; |
29 | | -class ArrowButton; |
30 | | -class TextButton; |
31 | | -class ToggleTextButton; |
32 | | -class RuleManufacture; |
33 | | -class Production; |
34 | | -class Timer; |
35 | | -class InteractiveSurface; |
36 | | - |
37 | | -/** |
38 | | - * Screen that allows changing of Production settings (assigned engineer, units to build). |
39 | | - */ |
40 | | -class ManufactureInfoState : public State |
41 | | -{ |
42 | | -private: |
43 | | - Base * _base; |
44 | | - RuleManufacture * _item; |
45 | | - Production * _production; |
46 | | - Window * _window; |
47 | | - ArrowButton * _btnUnitUp, * _btnUnitDown, * _btnEngineerUp, * _btnEngineerDown; |
48 | | - TextButton * _btnStop, * _btnOk; |
49 | | - Text * _txtTitle, * _txtAvailableEngineer, * _txtAvailableSpace, * _txtMonthlyProfit, * _txtAllocatedEngineer, * _txtUnitToProduce, * _txtUnitUp, * _txtUnitDown, * _txtEngineerUp, * _txtEngineerDown, * _txtAllocated, * _txtTodo; |
50 | | - ToggleTextButton *_btnSell; |
51 | | - Timer * _timerMoreEngineer, * _timerMoreUnit, * _timerLessEngineer, * _timerLessUnit; |
52 | | - InteractiveSurface *_surfaceEngineers, *_surfaceUnits; |
53 | | - int _producedItemsValue; |
54 | | - /// Caches static data for monthly profit calculations |
55 | | - void initProfitInfo (); |
56 | | - /// Calculates the monthly change in funds due to the job |
57 | | - int getMonthlyNetFunds (); |
58 | | - /// Handler for the Sell button. |
59 | | - void btnSellClick (Action * action); |
60 | | - /// Handler for the Stop button. |
61 | | - void btnStopClick (Action * action); |
62 | | - /// Handler for the OK button. |
63 | | - void btnOkClick (Action * action); |
64 | | - /// Adds given number of engineers to the project if possible. |
65 | | - void moreEngineer(int change); |
66 | | - /// Handler for pressing the more engineer button. |
67 | | - void moreEngineerPress(Action * action); |
68 | | - /// Handler for releasing the more engineer button. |
69 | | - void moreEngineerRelease(Action * action); |
70 | | - /// Handler for clicking the more engineer button. |
71 | | - void moreEngineerClick(Action * action); |
72 | | - /// Adds given number of units to produce to the project if possible. |
73 | | - void moreUnit(int change); |
74 | | - /// Handler for pressing the more unit button. |
75 | | - void moreUnitPress(Action * action); |
76 | | - /// Handler for releasing the more unit button. |
77 | | - void moreUnitRelease(Action * action); |
78 | | - /// Handler for clicking the more unit button. |
79 | | - void moreUnitClick(Action * action); |
80 | | - /// Removes the given number of engineers from the project if possible. |
81 | | - void lessEngineer(int change); |
82 | | - /// Handler for pressing the less engineer button. |
83 | | - void lessEngineerPress(Action * action); |
84 | | - /// Handler for releasing the less engineer button. |
85 | | - void lessEngineerRelease(Action * action); |
86 | | - /// Handler for clicking the less engineer button. |
87 | | - void lessEngineerClick(Action * action); |
88 | | - /// Removes the given number of units to produce from the project if possible. |
89 | | - void lessUnit(int change); |
90 | | - /// Handler for pressing the less unit button. |
91 | | - void lessUnitPress(Action * action); |
92 | | - /// Handler for releasing the less unit button. |
93 | | - void lessUnitRelease(Action * action); |
94 | | - /// Handler for clicking the less unit button. |
95 | | - void lessUnitClick(Action * action); |
96 | | - /// Adds one engineer to the production (if possible). |
97 | | - void onMoreEngineer(); |
98 | | - /// Removes one engineer from the production (if possible). |
99 | | - void onLessEngineer(); |
100 | | - /// Handler for using the mouse wheel on the Engineer-part of the screen. |
101 | | - void handleWheelEngineer(Action *action); |
102 | | - /// Increases count of number of units to make. |
103 | | - void onMoreUnit(); |
104 | | - /// Decreases count of number of units to make (if possible). |
105 | | - void onLessUnit(); |
106 | | - /// Handler for using the mouse wheel on the Unit-part of the screen. |
107 | | - void handleWheelUnit(Action *action); |
108 | | - /// Updates display of assigned/available engineers and workshop space. |
109 | | - void setAssignedEngineer(); |
110 | | - /// Runs state functionality every cycle. |
111 | | - void think(); |
112 | | - /// Builds the User Interface. |
113 | | - void buildUi(); |
114 | | - /// Helper to exit the State. |
115 | | - void exitState(); |
116 | | -public: |
117 | | - /// Creates the State (new production). |
118 | | - ManufactureInfoState(Base * base, RuleManufacture * _item); |
119 | | - /// Creates the State (modify production). |
120 | | - ManufactureInfoState(Base * base, Production * production); |
121 | | - /// Cleans up the state |
122 | | - ~ManufactureInfoState(); |
123 | | -}; |
124 | | -} |
125 | | -#endif |
| 1 | +/* |
| 2 | + * Copyright 2010-2015 OpenXcom Developers. |
| 3 | + * |
| 4 | + * This file is part of OpenXcom. |
| 5 | + * |
| 6 | + * OpenXcom is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU General Public License as published by |
| 8 | + * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * OpenXcom is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU General Public License |
| 17 | + * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + */ |
| 19 | +#ifndef OPENXCOM_MANUFACTUREINFOSTATE_H |
| 20 | +#define OPENXCOM_MANUFACTUREINFOSTATE_H |
| 21 | + |
| 22 | +#include "../Engine/State.h" |
| 23 | + |
| 24 | +namespace OpenXcom |
| 25 | +{ |
| 26 | +class Base; |
| 27 | +class Window; |
| 28 | +class Text; |
| 29 | +class ArrowButton; |
| 30 | +class TextButton; |
| 31 | +class ToggleTextButton; |
| 32 | +class RuleManufacture; |
| 33 | +class Production; |
| 34 | +class Timer; |
| 35 | +class InteractiveSurface; |
| 36 | + |
| 37 | +/** |
| 38 | + * Screen that allows changing of Production settings (assigned engineer, units to build). |
| 39 | + */ |
| 40 | +class ManufactureInfoState : public State |
| 41 | +{ |
| 42 | +private: |
| 43 | + Base * _base; |
| 44 | + RuleManufacture * _item; |
| 45 | + Production * _production; |
| 46 | + Window * _window; |
| 47 | + ArrowButton * _btnUnitUp, * _btnUnitDown, * _btnEngineerUp, * _btnEngineerDown; |
| 48 | + TextButton * _btnStop, * _btnOk; |
| 49 | + Text * _txtTitle, * _txtAvailableEngineer, * _txtAvailableSpace, * _txtMonthlyProfit, * _txtAllocatedEngineer, * _txtUnitToProduce, * _txtUnitUp, * _txtUnitDown, * _txtEngineerUp, * _txtEngineerDown, * _txtAllocated, * _txtTodo; |
| 50 | + ToggleTextButton *_btnSell; |
| 51 | + Timer * _timerMoreEngineer, * _timerMoreUnit, * _timerLessEngineer, * _timerLessUnit; |
| 52 | + InteractiveSurface *_surfaceEngineers, *_surfaceUnits; |
| 53 | + int _producedItemsValue; |
| 54 | + /// Caches static data for monthly profit calculations |
| 55 | + void initProfitInfo (); |
| 56 | + /// Calculates the monthly change in funds due to the job |
| 57 | + int getMonthlyNetFunds () const; |
| 58 | + /// Handler for the Sell button. |
| 59 | + void btnSellClick (Action * action); |
| 60 | + /// Handler for the Stop button. |
| 61 | + void btnStopClick (Action * action); |
| 62 | + /// Handler for the OK button. |
| 63 | + void btnOkClick (Action * action); |
| 64 | + /// Adds given number of engineers to the project if possible. |
| 65 | + void moreEngineer(int change); |
| 66 | + /// Handler for pressing the more engineer button. |
| 67 | + void moreEngineerPress(Action * action); |
| 68 | + /// Handler for releasing the more engineer button. |
| 69 | + void moreEngineerRelease(Action * action); |
| 70 | + /// Handler for clicking the more engineer button. |
| 71 | + void moreEngineerClick(Action * action); |
| 72 | + /// Adds given number of units to produce to the project if possible. |
| 73 | + void moreUnit(int change); |
| 74 | + /// Handler for pressing the more unit button. |
| 75 | + void moreUnitPress(Action * action); |
| 76 | + /// Handler for releasing the more unit button. |
| 77 | + void moreUnitRelease(Action * action); |
| 78 | + /// Handler for clicking the more unit button. |
| 79 | + void moreUnitClick(Action * action); |
| 80 | + /// Removes the given number of engineers from the project if possible. |
| 81 | + void lessEngineer(int change); |
| 82 | + /// Handler for pressing the less engineer button. |
| 83 | + void lessEngineerPress(Action * action); |
| 84 | + /// Handler for releasing the less engineer button. |
| 85 | + void lessEngineerRelease(Action * action); |
| 86 | + /// Handler for clicking the less engineer button. |
| 87 | + void lessEngineerClick(Action * action); |
| 88 | + /// Removes the given number of units to produce from the project if possible. |
| 89 | + void lessUnit(int change); |
| 90 | + /// Handler for pressing the less unit button. |
| 91 | + void lessUnitPress(Action * action); |
| 92 | + /// Handler for releasing the less unit button. |
| 93 | + void lessUnitRelease(Action * action); |
| 94 | + /// Handler for clicking the less unit button. |
| 95 | + void lessUnitClick(Action * action); |
| 96 | + /// Adds one engineer to the production (if possible). |
| 97 | + void onMoreEngineer(); |
| 98 | + /// Removes one engineer from the production (if possible). |
| 99 | + void onLessEngineer(); |
| 100 | + /// Handler for using the mouse wheel on the Engineer-part of the screen. |
| 101 | + void handleWheelEngineer(Action *action); |
| 102 | + /// Increases count of number of units to make. |
| 103 | + void onMoreUnit(); |
| 104 | + /// Decreases count of number of units to make (if possible). |
| 105 | + void onLessUnit(); |
| 106 | + /// Handler for using the mouse wheel on the Unit-part of the screen. |
| 107 | + void handleWheelUnit(Action *action); |
| 108 | + /// Updates display of assigned/available engineers and workshop space. |
| 109 | + void setAssignedEngineer(); |
| 110 | + /// Runs state functionality every cycle. |
| 111 | + void think(); |
| 112 | + /// Builds the User Interface. |
| 113 | + void buildUi(); |
| 114 | + /// Helper to exit the State. |
| 115 | + void exitState(); |
| 116 | +public: |
| 117 | + /// Creates the State (new production). |
| 118 | + ManufactureInfoState(Base * base, RuleManufacture * _item); |
| 119 | + /// Creates the State (modify production). |
| 120 | + ManufactureInfoState(Base * base, Production * production); |
| 121 | + /// Cleans up the state |
| 122 | + ~ManufactureInfoState(); |
| 123 | +}; |
| 124 | +} |
| 125 | +#endif |
0 commit comments