_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ui.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 1999-2007 by Lutz Sammer and Jimmy Salmon
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __UI_H__
31 #define __UI_H__
32 
34 
37 
38 /*----------------------------------------------------------------------------
39 -- Includes
40 ----------------------------------------------------------------------------*/
41 
42 #ifndef __CURSOR_H__
43 #include "cursor.h"
44 #endif
45 #ifndef __INTERFACE_H__
46 #include "interface.h"
47 #endif
48 #ifndef __SCRIPT_H__
49 #include "script.h"
50 #endif
51 #ifndef __MINIMAP_H__
52 #include "minimap.h"
53 #endif
54 
55 #include "color.h"
56 #include "viewport.h"
57 #include "ui/statusline.h"
58 #include "ui/uitimer.h"
59 #include <vector>
60 #include <string>
61 #include <map>
62 
63 /*----------------------------------------------------------------------------
64 -- Declarations
65 ----------------------------------------------------------------------------*/
66 
67 class CContentType;
68 class CUnit;
69 class CFile;
70 class CFont;
71 class LuaActionListener;
72 class CPopup;
73 
74 /*----------------------------------------------------------------------------
75 -- Definitions
76 ----------------------------------------------------------------------------*/
77 
83 };
84 
86 {
87 public:
90  TextPos(0, 0)
91  {}
92 
94  int Frame;
100  std::string TextNormalColor;
101  std::string TextReverseColor;
102 };
103 
105 {
106 public:
107  ButtonStyle() : Width(0), Height(0), Font(0),
109 
110  int Width;
111  int Height;
113  std::string TextNormalColor;
114  std::string TextReverseColor;
116  int TextX;
117  int TextY;
121 };
122 
125 {
126 public:
127  CUIButton() : X(0), Y(0), Style(NULL), Callback(NULL) {} //OLD BUTTON STYLE CODE
128  // NEW CODE BELOW, THANKS TO ANDRETTIN - MODIFIED BY DINKY
129  // CUIButton() : X(0), Y(0), Clicked(false), HotKeyPressed(false), Style(NULL), Callback(NULL) {}
131 
132  bool Contains(const PixelPos &screenPos) const;
133 
134 public:
135  int X;
136  int Y;
137  //NEW CODE START
138  //bool Clicked; /// whether the button is currently clicked or not
139  //bool HotKeyPressed; /// whether the buttons hotkey is currently pressed or not
140  // NEW CODE END
141  std::string Text;
144 };
145 
146 #define MAX_NUM_VIEWPORTS 8
147 
148 
160 };
161 
162 class CMapArea
163 {
164 public:
165  CMapArea() : X(0), Y(0), EndX(0), EndY(0),
168 
169  bool Contains(const PixelPos &screenPos) const;
170 
171 public:
172  int X;
173  int Y;
174  int EndX;
175  int EndY;
180 };
181 
186 {
187 public:
189  HideAllied(false), ShowOpponent(false), BoolFlags(NULL),
190  Variables(NULL) {}
192  {
193  delete[] BoolFlags;
194  delete[] Variables;
195  }
196 
198 
199  bool HideNeutral;
200  bool HideAllied;
202 
203  char *BoolFlags;
204  char *Variables;
205 };
206 
211 {
212 public:
214  Contents(), Condition(NULL) {}
215  ~CUnitInfoPanel();
216 
217 public:
218  std::string Name;
219  int PosX;
220  int PosY;
222 
223  std::vector<CContentType *>Contents;
224 
226 };
227 
228 
229 class CFiller
230 {
231  struct bits_map {
232  bits_map() : Width(0), Height(0), bstore(NULL) {}
233  ~bits_map();
234 
235  void Init(CGraphic *g);
236 
237  bool TransparentPixel(int x, int y)
238  {
239  if (bstore) {
240  const unsigned int x_index = x / 32;
241  y *= Width;
242  y /= 32;
243  x -= (x_index * 32);
244  return ((bstore[y + x_index] & (1 << x)) == 0);
245  }
246  return false;
247  };
248 
249  int Width;
250  int Height;
251  unsigned int *bstore;
252  };
253 
254  bits_map map;
255 public:
256  CFiller() : G(NULL), X(0), Y(0) {}
257 
258  void Load();
259 
260  bool OnGraphic(int x, int y)
261  {
262  x -= X;
263  y -= Y;
264  if (x >= 0 && y >= 0 && x < map.Width && y < map.Height) {
265  return !map.TransparentPixel(x, y);
266  }
267  return false;
268  }
270  int X;
271  int Y;
272 };
273 
275 {
276 public:
277  CButtonPanel() : G(NULL), X(0), Y(0), ShowCommandKey(true)
278  {}
279 
280  void Draw();
281  void Update();
282  void DoClicked(int button);
283  int DoKey(int key);
284 
285 private:
286  void DoClicked_SelectTarget(int button);
287 
288  void DoClicked_Unload(int button);
289  void DoClicked_SpellCast(int button);
290  void DoClicked_Repair(int button);
291  void DoClicked_Return();
292  void DoClicked_Stop();
293  void DoClicked_StandGround();
294  void DoClicked_Button(int button);
295  void DoClicked_CancelUpgrade();
296  void DoClicked_CancelTrain();
297  void DoClicked_CancelBuild();
298  void DoClicked_Build(int button);
299  void DoClicked_Train(int button);
300  void DoClicked_UpgradeTo(int button);
301  void DoClicked_Research(int button);
302  void DoClicked_CallbackAction(int button);
303 
304 
305 public:
307  int X;
308  int Y;
309  std::vector<CUIButton> Buttons;
312 };
313 
314 class CPieMenu
315 {
316 public:
318  {
319  memset(this->X, 0, sizeof(this->X));
320  memset(this->Y, 0, sizeof(this->Y));
321  }
322 
325  int X[9];
326  int Y[9];
327 
328  void SetRadius(int radius)
329  {
330  const int coeffX[] = { 0, 193, 256, 193, 0, -193, -256, -193, 0};
331  const int coeffY[] = { -256, -193, 0, 193, 256, 193, 0, -193, 0};
332  for (int i = 0; i < 9; ++i) {
333  this->X[i] = (coeffX[i] * radius) >> 8;
334  this->Y[i] = (coeffY[i] * radius) >> 8;
335  }
336  }
337 };
338 
340 {
341 public:
342  CResourceInfo() : G(NULL), IconFrame(0), IconX(0), IconY(0), IconWidth(-1),
343  TextX(-1), TextY(-1) {}
344 
346  int IconFrame;
347  int IconX;
348  int IconY;
349  int IconWidth;
350  int TextX;
351  int TextY;
352 };
353 #define MaxResourceInfo MaxCosts + 4
354 
356 {
357 public:
358  CInfoPanel() : G(NULL), X(0), Y(0) {}
359 
360  void Draw();
361 
363  int X;
364  int Y;
365 };
366 
368 {
369 public:
370  CUIUserButton() : Clicked(false) {}
371 
372  bool Clicked; // true if button is clicked, false otherwise
373  CUIButton Button; // User button
374 };
375 
380 {
381 public:
382  CUserInterface();
383  ~CUserInterface();
384 
385  void Load();
386 
387 
388  bool MouseScroll;
389  bool KeyScroll;
390  int KeyScrollSpeed;
398 
400 
401  std::string NormalFontColor;
402  std::string ReverseFontColor;
403 
404  std::vector<CFiller> Fillers;
405 
407 
409  std::vector<CUnitInfoPanel *> InfoPanelContents;
410 
411  std::vector<CPopup *> ButtonPopups;
412 
414 
415  std::vector<CUIButton> SelectedButtons;
419 
421  std::string SingleTrainingText;
425 
426  std::vector<CUIButton> TrainingButtons;
427  std::string TrainingText;
431 
433 
435 
436  std::vector<CUIButton> TransportingButtons;
437 
438  // Completed bar
442 
443  // Button panel
445 
446  // Pie Menu
448 
449  // Map area
458 
459  // Menu buttons
463 
464  // Used defined buttons
465  std::vector<CUIUserButton> UserButtons;
466 
467  // The minimap
470 
471  // The status line
473 
474  // Game timer
476 
477  // Offsets for 640x480 center used by menus
480 
481  //
482  // Cursors used.
483  //
491 
500 
506 
509 };
510 
511 extern std::vector<ButtonAction> CurrentButtons;
512 
513 /*----------------------------------------------------------------------------
514 -- Variables
515 ----------------------------------------------------------------------------*/
516 
517 extern CUserInterface UI;
518 
519 extern std::string ClickMissile;
520 extern std::string DamageMissile;
521 
522 
524 extern std::map<std::string, ButtonStyle *> ButtonStyleHash;
525 
526 extern bool RightButtonAttacks;
527 
528 extern const char DefaultGroupKeys[];
529 extern std::string UiGroupKeys;
530 
531 extern bool FancyBuildings;
532 
533 // only exported to save them
534 
535 /*----------------------------------------------------------------------------
536 -- Functions
537 ----------------------------------------------------------------------------*/
538 
540 extern void InitUserInterface();
542 extern void SaveUserInterface(CFile &file);
544 extern void CleanUserInterface();
545 
546 extern void FreeButtonStyles();
547 
549 extern void UserInterfaceCclRegister();
550 
552 extern CPopup *PopupByIdent(const std::string &ident);
553 
555 extern ButtonStyle *FindButtonStyle(const std::string &style);
556 
558 extern void UIHandleMouseMove(const PixelPos &pos);
560 extern void UIHandleButtonDown(unsigned button);
562 extern void UIHandleButtonUp(unsigned button);
563 
565 extern void RestrictCursorToViewport();
567 extern void RestrictCursorToMinimap();
568 
570 extern CViewport *GetViewport(const PixelPos &screenPos);
572 extern void CycleViewportMode(int);
574 extern void SetViewportMode(ViewportModeType mode);
575 extern void SetNewViewportMode(ViewportModeType mode);
576 extern void CheckViewportMode();
577 
579 extern bool GetMouseScroll();
581 extern void SetMouseScroll(bool enabled);
583 extern bool GetKeyScroll();
585 extern void SetKeyScroll(bool enabled);
587 extern bool GetGrabMouse();
589 extern void SetGrabMouse(bool enabled);
591 extern bool GetLeaveStops();
593 extern void SetLeaveStops(bool enabled);
594 
595 extern int AddHandler(lua_State *l);
596 extern void CallHandler(unsigned int handle, int value);
597 
599 extern void ShowLoadProgress(const char *fmt, ...) PRINTF_VAARG_ATTRIBUTE(1, 2);
600 
602 
603 #endif // !__UI_H__
int MouseScrollSpeedDefault
Middle-Mouse Scroll Speed (screenpixels per mousepixel)
Definition: ui.h:395
CViewport * SelectedViewport
Viewport containing mouse.
Definition: ui.h:452
int PosX
Ident of the panel.
Definition: ui.h:219
~CUIButton()
Definition: ui.h:130
Two viewports split horizontal.
Definition: ui.h:156
void DoClicked(int button)
Definition: botpanel.cpp:1396
CUIButton NetworkDiplomacyButton
network menu button
Definition: ui.h:462
Two viewports split vertical.
Definition: ui.h:158
CFont * TrainingFont
Multiple Training Text.
Definition: ui.h:428
bool ShowCommandKey
Definition: ui.h:311
int Y[9]
X position of the pies.
Definition: ui.h:326
CursorConfig ArrowNW
Cursor pointing north.
Definition: ui.h:495
int X
Definition: ui.h:363
int Offset640X
game timer
Definition: ui.h:478
int X
Definition: ui.h:172
bool HideNeutral
if true, show only for selected unit.
Definition: ui.h:199
int Y
Definition: ui.h:364
CursorConfig ArrowNE
Cursor pointing east.
Definition: ui.h:493
#define MaxResourceInfo
Definition: ui.h:353
std::vector< CUIUserButton > UserButtons
network diplomacy button
Definition: ui.h:465
ViewportModeType
Definition: ui.h:153
CFont * Font
Button height.
Definition: ui.h:112
std::string SingleTrainingText
Button for single training.
Definition: ui.h:421
Four viewports split symmetric.
Definition: ui.h:159
CursorConfig Point
Offset for 640x480 Y position.
Definition: ui.h:484
std::string Name
Definition: ui.h:218
char * BoolFlags
if true, show for opponent unit.
Definition: ui.h:203
std::vector< ButtonAction > CurrentButtons
Pointer to current buttons.
Definition: botpanel.cpp:80
buttons on screen themselves
Definition: ui.h:124
std::string TextNormalColor
Font.
Definition: ui.h:113
void UIHandleMouseMove(const PixelPos &pos)
Called if the mouse is moved in Normal interface state.
Definition: mouse.cpp:900
Old single viewport.
Definition: ui.h:155
std::string Text
y coordinate on the screen
Definition: ui.h:141
CUIButton * UpgradingButton
Multiple Training Y Text position.
Definition: ui.h:432
void UserInterfaceCclRegister()
Register ccl features.
Definition: script_ui.cpp:1215
std::string TextNormalColor
Text location.
Definition: ui.h:100
int MouseButton
Optional background image.
Definition: ui.h:324
A platform independent color.
Definition: color.h:39
void Update()
Definition: botpanel.cpp:1077
std::string TextReverseColor
Normal text color.
Definition: ui.h:114
CGraphic * G
Definition: ui.h:306
CursorConfig ArrowS
Cursor pointing south west.
Definition: ui.h:498
TextAlignment
Definition: ui.h:78
Definition: ui.h:367
CursorConfig Cross
HourGlass, system is waiting.
Definition: ui.h:486
int IconFrame
icon graphic
Definition: ui.h:346
std::string TextReverseColor
Normal text color.
Definition: ui.h:101
CUIButton Button
Definition: ui.h:373
Definition: ui.h:162
~ConditionPanel()
Definition: ui.h:191
int PosY
X coordinate of the panel.
Definition: ui.h:220
CursorConfig RedHair
Green action,attack cursor.
Definition: ui.h:489
ButtonStyleProperties Default
Text Y location.
Definition: ui.h:118
int NumViewports
Current selected active viewport.
Definition: ui.h:453
CUserInterface()
Definition: ui.cpp:114
int Y
X coordinate.
Definition: ui.h:271
Definition: ui.h:379
std::vector< CPopup * > ButtonPopups
Info panel contents.
Definition: ui.h:411
void FreeButtonStyles()
Definition: ui.cpp:377
int SingleTrainingTextX
Font for single traning.
Definition: ui.h:423
IntColor ViewportCursorColor
minimap
Definition: ui.h:469
int BorderSize
Definition: ui.h:97
void Load()
Definition: graphic.cpp:1642
void UIHandleButtonDown(unsigned button)
Called if any mouse button is pressed down.
Definition: mouse.cpp:1800
CUIButton NetworkMenuButton
menu button
Definition: ui.h:461
CursorConfig ArrowW
Cursor pointing north west.
Definition: ui.h:496
bool OnGraphic(int x, int y)
Definition: ui.h:260
void SetLeaveStops(bool enabled)
Enable/disable leaving the window stops scrolling.
Definition: ui.cpp:775
Definition: ui.h:185
void ShowLoadProgress(const char *fmt,...) PRINTF_VAARG_ATTRIBUTE(1
Show load progress.
CUIButton()
Definition: ui.h:127
bool GetKeyScroll()
Check if keyboard scrolling is enabled.
Definition: ui.cpp:729
CUserInterface UI
Current Selected Buttons.
Definition: ui.cpp:67
CMinimap Minimap
User buttons.
Definition: ui.h:468
int X
Graphic.
Definition: ui.h:270
The big unit structure.
Definition: unit.h:119
LuaActionListener * Callback
button style
Definition: ui.h:143
CPieMenu PieMenu
Definition: ui.h:447
std::vector< CUIButton > TransportingButtons
Button info for researching.
Definition: ui.h:436
#define PRINTF_VAARG_ATTRIBUTE(a, b)
Definition: stratagus.h:90
Definition: minimap.h:46
const char DefaultGroupKeys[]
right button attacks
Definition: interface.cpp:79
ButtonStyle * FindButtonStyle(const std::string &style)
Find a button style.
Definition: script_ui.cpp:731
int EndX
Screen pixel upper corner y coordinate.
Definition: ui.h:174
std::string ClickMissile
The user interface.
Definition: script_ui.cpp:60
CFont * DefaultFont
Y coordinate of the panel.
Definition: ui.h:221
#define NoButton
pressed mouse button flags
Definition: interface.h:156
CGraphic * DefeatBackgroundG
Victory background graphic.
Definition: ui.h:508
std::vector< CUnitInfoPanel * > InfoPanelContents
Info panel.
Definition: ui.h:409
ViewportModeType ViewportMode
Definition: ui.h:450
PixelPos TextPos
Text alignment.
Definition: ui.h:99
bool Clicked
Definition: ui.h:372
CGraphic * G
Definition: ui.h:323
Definition: contenttype.h:46
bool GetMouseScroll()
Check if mouse scrolling is enabled.
Definition: ui.cpp:711
bool ShowOpponent
if true, don't show for allied unit. (but show own units)
Definition: ui.h:201
Definition: ui.h:274
CursorConfig YellowHair
Multi-select cursor.
Definition: ui.h:487
Definition: ui.h:314
std::string UiGroupKeys
Default group keys.
Definition: interface.cpp:80
void Draw()
Definition: mainscr.cpp:1168
CPopup * PopupByIdent(const std::string &ident)
return popup by ident string
Definition: ui.cpp:160
CInfoPanel InfoPanel
Icon+Text of all resources.
Definition: ui.h:408
ButtonStyleProperties Hover
Default button properties.
Definition: ui.h:119
CUIButton * ResearchingButton
Button info for upgrade.
Definition: ui.h:434
std::vector< CUIButton > SelectedButtons
Button for single selected unit.
Definition: ui.h:415
CursorConfig GreenHair
Yellow action,attack cursor.
Definition: ui.h:488
Definition: ui.h:80
int TextY
text X position
Definition: ui.h:351
CGraphic * Sprite
Definition: ui.h:93
CUIUserButton()
Definition: ui.h:370
Definition: widgets.h:46
ButtonStyle * Style
button text
Definition: ui.h:142
CViewport * MouseViewport
Current viewport mode.
Definition: ui.h:451
Definition: ui.h:82
std::string TrainingText
Training buttons.
Definition: ui.h:427
Definition: video.h:64
Definition: viewport.h:63
CButtonPanel ButtonPanel
should complete bar have shadow
Definition: ui.h:444
int Y
x coordinate on the screen
Definition: ui.h:136
Definition: iolib.h:101
int TextY
Text X location.
Definition: ui.h:117
CColor AutoCastBorderColorRGB
Definition: ui.h:310
int Height
Button width.
Definition: ui.h:111
CFont * MaxSelectedFont
Selected buttons.
Definition: ui.h:416
Font definition.
Definition: font.h:73
int TrainingTextY
Multiple Training X Text position.
Definition: ui.h:430
int ScrollPaddingBottom
Scrollable area past the top of map.
Definition: ui.h:179
std::vector< CFiller > Fillers
Color for reverse text displayed.
Definition: ui.h:404
CButtonPanel()
Definition: ui.h:277
CStatusLine StatusLine
minimap cursor color
Definition: ui.h:472
void CleanUserInterface()
Clean up the ui module.
Definition: ui.cpp:311
bool CompletedBarShadow
color for completed bar
Definition: ui.h:441
void Draw()
Definition: botpanel.cpp:732
~CUserInterface()
Definition: ui.cpp:304
void Load()
Definition: ui.cpp:210
Three viewports split horiontal.
Definition: ui.h:157
CMapArea()
Definition: ui.h:165
void CheckViewportMode()
Definition: ui.cpp:701
int MaxSelectedTextY
position to place '+#' text
Definition: ui.h:418
CUIButton MenuButton
Scroll speed in seconds for messages.
Definition: ui.h:460
Definition: ui.h:79
int X
Definition: ui.h:135
bool GetGrabMouse()
Check if mouse grabbing is enabled.
Definition: ui.cpp:747
ConditionPanel * Condition
Array of contents to display.
Definition: ui.h:225
int IconX
icon frame
Definition: ui.h:347
CColor BorderColorRGB
Definition: ui.h:95
CGraphic * VictoryBackgroundG
Cursor pointing south east.
Definition: ui.h:507
int TextX
Text alignment.
Definition: ui.h:116
int Width
Definition: ui.h:110
std::string ReverseFontColor
Color for normal text displayed.
Definition: ui.h:402
CUIButton * SingleSelectedButton
Popup windows for buttons.
Definition: ui.h:413
#define MAX_NUM_VIEWPORTS
Definition: ui.h:146
bool GetLeaveStops()
Check if scrolling stops when leaving the window.
Definition: ui.cpp:765
std::string DamageMissile
Missile to show when you click.
Definition: script_ui.cpp:61
Definition: statusline.h:41
CMapArea MapArea
Parameters of all viewports.
Definition: ui.h:455
int DoKey(int key)
Definition: botpanel.cpp:1451
~CUnitInfoPanel()
Definition: ui.cpp:104
IntColor BorderColor
Definition: ui.h:96
int KeyScrollSpeed
Key Scroll Speed.
Definition: ui.h:391
ButtonStyleProperties()
Definition: ui.h:88
std::map< std::string, ButtonStyle * > ButtonStyleHash
Missile to show damage caused.
Definition: script_ui.cpp:62
CursorConfig Glass
General pointing cursor.
Definition: ui.h:485
TextAlignment TextAlign
Definition: ui.h:98
Definition: uitimer.h:37
TextAlignment TextAlign
Reverse text color.
Definition: ui.h:115
int IconWidth
icon Y position
Definition: ui.h:349
void UIHandleButtonUp(unsigned button)
Called if any mouse button is released up.
Definition: mouse.cpp:1881
std::vector< CUIButton > TrainingButtons
Y text position single training.
Definition: ui.h:426
Definition: ui.h:229
void SetRadius(int radius)
Y position of the pies.
Definition: ui.h:328
CViewport * GetViewport(const PixelPos &screenPos)
Get viewport for screen pixel position.
Definition: ui.cpp:398
std::string NormalFontColor
Cursor warp screen position.
Definition: ui.h:401
void InitUserInterface()
Mirror buildings 1 yes, 0 now.
Definition: ui.cpp:173
bool KeyScroll
Enable mouse scrolling.
Definition: ui.h:389
bool Contains(const PixelPos &screenPos) const
Definition: ui.cpp:267
Definition: ui.h:154
CursorConfig ArrowSW
Cursor pointing west.
Definition: ui.h:497
CGraphic * G
Definition: ui.h:362
CResourceInfo Resources[MaxResourceInfo]
Filler graphics.
Definition: ui.h:406
int ScrollPaddingTop
Scrollable area past the right of map.
Definition: ui.h:178
bool HideAllied
if true, don't show for neutral unit.
Definition: ui.h:200
Definition: ui.h:81
bool Contains(const PixelPos &screenPos) const
Definition: mouse.cpp:643
char * Variables
array of condition about user flags.
Definition: ui.h:204
void RestrictCursorToViewport()
Restrict mouse cursor to viewport.
Definition: mouse.cpp:862
Definition: ui.h:355
void SetGrabMouse(bool enabled)
Enable/disable grabbing the mouse.
Definition: ui.cpp:757
int IconY
icon X position
Definition: ui.h:348
CPieMenu()
Definition: ui.h:317
CUITimer Timer
status line
Definition: ui.h:475
CursorConfig ArrowSE
Cursor pointing south.
Definition: ui.h:499
CGraphic * G
Definition: ui.h:345
CColor CompletedBarColorRGB
Button info for transporting.
Definition: ui.h:439
CResourceInfo()
Definition: ui.h:342
void RestrictCursorToMinimap()
Restrict mouse cursor to minimap.
Definition: mouse.cpp:872
int SingleTrainingTextY
X text position single training.
Definition: ui.h:424
PixelPos MouseWarpPos
Definition: ui.h:399
int MouseScrollSpeed
Mouse Scroll Speed (screenpixels per mousepixel)
Definition: ui.h:393
void SetMouseScroll(bool enabled)
Enable/disable scrolling with the mouse.
Definition: ui.cpp:721
CViewport Viewports[MAX_NUM_VIEWPORTS]
Viewports currently used
Definition: ui.h:454
Definition: ui.h:104
CFont * MessageFont
geometry of the whole map area
Definition: ui.h:456
bool FancyBuildings
Up to 11 keys used for group selection.
Definition: ui.cpp:62
int MaxSelectedTextX
Font type to use.
Definition: ui.h:417
CursorConfig Scroll
Red action,attack cursor.
Definition: ui.h:490
CUIButton * SingleTrainingButton
if > maximum units selected
Definition: ui.h:420
CFont * SingleTrainingFont
Text for single training.
Definition: ui.h:422
bool MouseScroll
Definition: ui.h:388
CursorConfig ArrowN
Cursor pointing north east.
Definition: ui.h:494
int MessageScrollSpeed
Font used for messages.
Definition: ui.h:457
int TrainingTextX
Multiple Training Font.
Definition: ui.h:429
CursorConfig ArrowE
Cursor for scrolling map around.
Definition: ui.h:492
bool RightButtonAttacks
Definition: ui.cpp:58
void SetNewViewportMode(ViewportModeType mode)
Definition: ui.cpp:671
int X[9]
Which mouse button pops up the piemenu, deactivate with NoButton.
Definition: ui.h:325
Definition: ui.h:339
CGraphic * G
Definition: ui.h:269
int Offset480Y
Offset for 640x480 X position.
Definition: ui.h:479
void SaveUserInterface(CFile &file)
Save the ui state.
Definition: ui.cpp:296
int MouseScrollSpeedControl
Middle-Mouse Scroll Speed with Control pressed.
Definition: ui.h:397
int AddHandler(lua_State *l)
Definition: script_ui.cpp:892
int X
Definition: ui.h:307
uint32_t IntColor
Definition: color.h:74
CUnitInfoPanel()
Definition: ui.h:213
int ScrollPaddingLeft
Screen pixel bottom y coordinate.
Definition: ui.h:176
int EndY
Screen pixel right x coordinate.
Definition: ui.h:175
void CycleViewportMode(int)
Cycle through all available viewport modes.
Definition: ui.cpp:690
int Y
Screen pixel left corner x coordinate.
Definition: ui.h:173
bool ShowOnlySelected
Definition: ui.h:197
void SetKeyScroll(bool enabled)
Enable/disable scrolling with the keyboard.
Definition: ui.cpp:739
ButtonStyleProperties Clicked
Hover button properties.
Definition: ui.h:120
Definition: popup.h:211
Definition: ui.h:210
Definition: ui.h:85
ButtonStyle()
Definition: ui.h:107
CInfoPanel()
Definition: ui.h:358
ConditionPanel()
Definition: ui.h:188
Cursor config reference.
Definition: cursor.h:144
int ScrollPaddingRight
Scrollable area past the left of map.
Definition: ui.h:177
int Y
Definition: ui.h:308
int Frame
Definition: ui.h:94
CFiller()
Definition: ui.h:256
std::vector< CContentType * > Contents
Default font for content.
Definition: ui.h:223
void CallHandler(unsigned int handle, int value)
Definition: script_ui.cpp:911
IntColor CompletedBarColor
color for completed bar
Definition: ui.h:440
std::vector< CUIButton > Buttons
Definition: ui.h:309
int TextX
icon W size
Definition: ui.h:350
void SetViewportMode(ViewportModeType mode)
Select viewport mode.
Definition: ui.cpp:642
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.