_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "cursor.h"
#include "interface.h"
#include "script.h"
#include "minimap.h"
#include "color.h"
#include "viewport.h"
#include "ui/statusline.h"
#include "ui/uitimer.h"
#include <vector>
#include <string>
#include <map>
Go to the source code of this file.
Classes | |
class | ButtonStyleProperties |
class | ButtonStyle |
class | CUIButton |
buttons on screen themselves More... | |
class | CMapArea |
class | ConditionPanel |
class | CUnitInfoPanel |
class | CFiller |
class | CButtonPanel |
class | CPieMenu |
class | CResourceInfo |
class | CInfoPanel |
class | CUIUserButton |
class | CUserInterface |
ui.h - The user interface header file. | |
#define | MAX_NUM_VIEWPORTS 8 |
#define | MaxResourceInfo MaxCosts + 4 |
enum | TextAlignment { TextAlignUndefined, TextAlignCenter, TextAlignLeft, TextAlignRight } |
enum | ViewportModeType { VIEWPORT_SINGLE = 0, VIEWPORT_SPLIT_HORIZ, VIEWPORT_SPLIT_HORIZ3, VIEWPORT_SPLIT_VERT, VIEWPORT_QUAD, NUM_VIEWPORT_MODES } |
std::vector< ButtonAction > | CurrentButtons |
Pointer to current buttons. More... | |
CUserInterface | UI |
Current Selected Buttons. More... | |
std::string | ClickMissile |
The user interface. More... | |
std::string | DamageMissile |
Missile to show when you click. More... | |
std::map< std::string, ButtonStyle * > | ButtonStyleHash |
Missile to show damage caused. More... | |
bool | RightButtonAttacks |
const char | DefaultGroupKeys [] |
right button attacks More... | |
std::string | UiGroupKeys |
Default group keys. More... | |
bool | FancyBuildings |
Up to 11 keys used for group selection. More... | |
void | InitUserInterface () |
Mirror buildings 1 yes, 0 now. More... | |
void | SaveUserInterface (CFile &file) |
Save the ui state. More... | |
void | CleanUserInterface () |
Clean up the ui module. More... | |
void | FreeButtonStyles () |
void | UserInterfaceCclRegister () |
Register ccl features. More... | |
CPopup * | PopupByIdent (const std::string &ident) |
return popup by ident string More... | |
ButtonStyle * | FindButtonStyle (const std::string &style) |
Find a button style. More... | |
void | UIHandleMouseMove (const PixelPos &pos) |
Called if the mouse is moved in Normal interface state. More... | |
void | UIHandleButtonDown (unsigned button) |
Called if any mouse button is pressed down. More... | |
void | UIHandleButtonUp (unsigned button) |
Called if any mouse button is released up. More... | |
void | RestrictCursorToViewport () |
Restrict mouse cursor to viewport. More... | |
void | RestrictCursorToMinimap () |
Restrict mouse cursor to minimap. More... | |
CViewport * | GetViewport (const PixelPos &screenPos) |
Get viewport for screen pixel position. More... | |
void | CycleViewportMode (int) |
Cycle through all available viewport modes. More... | |
void | SetViewportMode (ViewportModeType mode) |
Select viewport mode. More... | |
void | SetNewViewportMode (ViewportModeType mode) |
void | CheckViewportMode () |
bool | GetMouseScroll () |
Check if mouse scrolling is enabled. More... | |
void | SetMouseScroll (bool enabled) |
Enable/disable scrolling with the mouse. More... | |
bool | GetKeyScroll () |
Check if keyboard scrolling is enabled. More... | |
void | SetKeyScroll (bool enabled) |
Enable/disable scrolling with the keyboard. More... | |
bool | GetGrabMouse () |
Check if mouse grabbing is enabled. More... | |
void | SetGrabMouse (bool enabled) |
Enable/disable grabbing the mouse. More... | |
bool | GetLeaveStops () |
Check if scrolling stops when leaving the window. More... | |
void | SetLeaveStops (bool enabled) |
Enable/disable leaving the window stops scrolling. More... | |
int | AddHandler (lua_State *l) |
void | CallHandler (unsigned int handle, int value) |
void | ShowLoadProgress (const char *fmt,...) PRINTF_VAARG_ATTRIBUTE(1 |
Show load progress. More... | |
void bool | IsDemoMode () |
Check if Demo/Attract mode is in progress. More... | |
#define MAX_NUM_VIEWPORTS 8 |
#define MaxResourceInfo MaxCosts + 4 |
enum TextAlignment |
enum ViewportModeType |
Enumeration of the different predefined viewport configurations.
int AddHandler | ( | lua_State * | l | ) |
Add a Lua handler FIXME: when should these be freed?
void CallHandler | ( | unsigned int | handle, |
int | value | ||
) |
Call a Lua handler
void CheckViewportMode | ( | ) |
void CleanUserInterface | ( | ) |
Clean up the ui module.
Clean up the user interface module.
void CycleViewportMode | ( | int | step | ) |
Cycle through all available viewport modes.
Cycles through predefined viewport modes (geometry configurations) in order defined by the ViewportMode enumerated type.
step | The size of step used for cycling. Values that make sense are mostly 1 (next viewport mode) and -1 (previous viewport mode). |
ButtonStyle* FindButtonStyle | ( | const std::string & | style | ) |
Find a button style.
Find a button style
style | Name of the style to find. |
void FreeButtonStyles | ( | ) |
bool GetGrabMouse | ( | ) |
Check if mouse grabbing is enabled.
Check if mouse grabbing is enabled
bool GetKeyScroll | ( | ) |
Check if keyboard scrolling is enabled.
Check if keyboard scrolling is enabled
bool GetLeaveStops | ( | ) |
Check if scrolling stops when leaving the window.
Check if scrolling stops when leaving the window
bool GetMouseScroll | ( | ) |
Check if mouse scrolling is enabled.
Check if mouse scrolling is enabled
Get viewport for screen pixel position.
Takes coordinates of a pixel in stratagus's window and computes the map viewport which contains this pixel.
screenPos | pixel coordinate with origin at UL corner of screen |
void InitUserInterface | ( | ) |
Mirror buildings 1 yes, 0 now.
Initialize the ui
Initialize the user interface.
Align UI map area if at least one of the map dimensions fits completely into it.
void bool IsDemoMode | ( | ) |
Check if Demo/Attract mode is in progress.
Check if the game is running in Demo mode.
CPopup* PopupByIdent | ( | const std::string & | ident | ) |
return popup by ident string
Get popup class pointer by string identifier.
ident | Popup identifier. |
void RestrictCursorToMinimap | ( | ) |
Restrict mouse cursor to minimap.
Restrict mouse cursor to minimap
void RestrictCursorToViewport | ( | ) |
Restrict mouse cursor to viewport.
Restrict mouse cursor to viewport.
Save the ui state.
Save the user interface module.
file | Save file handle |
void SetGrabMouse | ( | bool | enabled | ) |
Enable/disable grabbing the mouse.
Enable/disable grabbing the mouse
enabled | True to enable mouse grabbing, false to disable |
void SetKeyScroll | ( | bool | enabled | ) |
Enable/disable scrolling with the keyboard.
Enable/disable scrolling with the keyboard
enabled | True to enable keyboard scrolling, false to disable |
void SetLeaveStops | ( | bool | enabled | ) |
Enable/disable leaving the window stops scrolling.
Enable/disable leaving the window stops scrolling
enabled | True to stop scrolling, false to disable |
void SetMouseScroll | ( | bool | enabled | ) |
Enable/disable scrolling with the mouse.
Enable/disable scrolling with the mouse
enabled | True to enable mouse scrolling, false to disable |
void SetNewViewportMode | ( | ViewportModeType | new_mode | ) |
Sets up a new viewport mode.
new_mode | New mode's number. |
void SetViewportMode | ( | ViewportModeType | new_mode | ) |
Select viewport mode.
Sets up (calls geometry setup routines for) a new viewport mode.
new_mode | New mode's number. |
void ShowLoadProgress | ( | const char * | fmt, |
... | |||
) |
Show load progress.
void UIHandleButtonDown | ( | unsigned | button | ) |
Called if any mouse button is pressed down.
Called if mouse button pressed down.
button | Button pressed down. |
void UIHandleButtonUp | ( | unsigned | button | ) |
Called if any mouse button is released up.
Called if mouse button released.
button | Button released. |
Called if the mouse is moved in Normal interface state.
Handle movement of the cursor.
cursorPos | Screen X position. |
void UserInterfaceCclRegister | ( | ) |
Register ccl features.
Register CCL features for UI.
std::map<std::string, ButtonStyle *> ButtonStyleHash |
std::string ClickMissile |
The user interface.
std::vector<ButtonAction> CurrentButtons |
Pointer to current buttons.
const char DefaultGroupKeys[] |
right button attacks
right button attacks
bool FancyBuildings |
Up to 11 keys used for group selection.
bool RightButtonAttacks |
Current Selected Buttons.
Current Selected Buttons.
The user interface configuration
std::string UiGroupKeys |
Default group keys.