_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
Go to the source code of this file.
Classes | |
class | ButtonAction |
Action of button. More... | |
interface.h - The user interface header file. | |
#define | ModifierShift 1 |
current keyboard state More... | |
#define | ModifierControl 2 |
#define | ModifierAlt 4 |
#define | ModifierSuper 8 |
#define | ModifierDoublePress 16 |
#define | MouseDoubleShift 8 |
#define | MouseDragShift 16 |
#define | MouseHoldShift 24 |
#define | NoButton 0 |
pressed mouse button flags More... | |
#define | LeftButton 2 |
#define | MiddleButton 4 |
#define | RightButton 8 |
#define | UpButton 16 |
#define | DownButton 32 |
#define | LeftAndMiddleButton (LeftButton | MiddleButton) |
#define | LeftAndRightButton (LeftButton | RightButton) |
#define | MiddleAndRightButton (MiddleButton | RightButton) |
#define | ScrollNone 0 |
Are We Scrolling With the Keyboard ? More... | |
#define | ScrollUp 1 |
#define | ScrollDown 2 |
#define | ScrollLeft 4 |
#define | ScrollRight 8 |
#define | ScrollLeftUp 5 |
#define | ScrollLeftDown 6 |
#define | ScrollRightUp 9 |
#define | ScrollRightDown 10 |
enum | ButtonCmd { ButtonMove, ButtonAttack, ButtonRepair, ButtonHarvest, ButtonBuild, ButtonPatrol, ButtonExplore, ButtonAttackGround, ButtonSpellCast, ButtonUnload, ButtonStop, ButtonButton, ButtonTrain, ButtonStandGround, ButtonReturn, ButtonResearch, ButtonUpgradeTo, ButtonCancel, ButtonCancelUpgrade, ButtonCancelTrain, ButtonCancelBuild, ButtonCallbackAction } |
Button Commands that need target selection. More... | |
enum | _button_area_ { ButtonAreaSelected, ButtonAreaTraining, ButtonAreaUpgrading, ButtonAreaResearching, ButtonAreaTransporting, ButtonAreaButton, ButtonAreaMenu, ButtonAreaUser } |
Button area under cursor. More... | |
enum | _menu_button_under_ { ButtonUnderMenu, ButtonUnderNetworkMenu, ButtonUnderNetworkDiplomacy, ButtonUnderFreeWorkers } |
Menu button under cursor. More... | |
enum | _iface_state_ { IfaceStateNormal, IfaceStateMenu } |
current interface state More... | |
enum | _key_state_ { KeyStateCommand = 0, KeyStateInput } |
current key state More... | |
enum | _cursor_on_ { CursorOnUnknown = -1, CursorOnMinimap, CursorOnButton, CursorOnMap, CursorOnScrollUp, CursorOnScrollDown, CursorOnScrollLeft, CursorOnScrollRight, CursorOnScrollLeftUp, CursorOnScrollLeftDown, CursorOnScrollRightUp, CursorOnScrollRightDown } |
Where is our cursor ? More... | |
typedef bool(* | ButtonCheckFunc) (const CUnit &, const ButtonAction &) |
std::vector< ButtonAction * > | UnitButtonTable |
All buttons for units. More... | |
bool | GameRunning |
Flag telling if the game is running. More... | |
bool | GamePaused |
Flag telling if the game is paused. More... | |
bool | GameObserve |
Flag telling if the game is in observe mode. More... | |
bool | GameEstablishing |
Flag telling if the game is in establishing mode. More... | |
char | SkipGameCycle |
Flag telling not to advance to the next game cycle. More... | |
bool | GodMode |
Invincibility cheat. More... | |
char | BigMapMode |
Whether the map is the only thing displayed or not. More... | |
bool | IsSDLWindowVisible |
Flag telling if the SDL window is visible. More... | |
int | MouseButtons |
pressed mouse buttons (normal,double,dragged,long) More... | |
int | KeyModifiers |
current active modifiers More... | |
enum _iface_state_ | InterfaceState |
current interface state More... | |
int | KeyScrollState |
current scroll state of keyboard More... | |
int | MouseScrollState |
current scroll state of mouse More... | |
enum _key_state_ | KeyState |
current key state More... | |
CUnit * | UnitUnderCursor |
shared pointer to unit under the cursor More... | |
int | ButtonAreaUnderCursor |
button area under the cursor More... | |
int | ButtonUnderCursor |
button number under the cursor More... | |
int | OldButtonUnderCursor |
oldbutton number under the cursor More... | |
bool | GameMenuButtonClicked |
menu button was clicked down More... | |
bool | GameDiplomacyButtonClicked |
diplomacy button was clicked down More... | |
bool | LeaveStops |
Mouse leaves windows stops scroll. More... | |
enum _cursor_on_ | CursorOn |
current CursorOn field More... | |
int | CurrentButtonLevel |
vladi: used for unit buttons sub-menus etc More... | |
ButtonAction * | LastDrawnButtonPopup |
Last drawn popup : used to speed up drawing. More... | |
int | DoubleClickDelay |
Time to detect double clicks. More... | |
int | HoldClickDelay |
Time to detect hold clicks. More... | |
CUnit * | GetUnitUnderCursor () |
void | InitButtons () |
Generate all buttons. More... | |
void | CleanButtons () |
Free memory for buttons. More... | |
int | AddButton (int pos, int level, const std::string &IconIdent, ButtonCmd action, const std::string &value, void *payload, const ButtonCheckFunc func, const std::string &arg, const int key, const std::string &hint, const std::string &descr, const std::string &sound, const std::string &cursor, const std::string &umask, const std::string &popup, bool alwaysShow) |
Make a new button. More... | |
bool | IsButtonAllowed (const CUnit &unit, const ButtonAction &buttonaction) |
void | HandleButtonDown (unsigned button) |
Called if any mouse button is pressed down. More... | |
void | HandleButtonUp (unsigned button) |
Called if any mouse button is released up. More... | |
void | HandleCursorMove (int *x, int *y) |
Keep coordinates in window and update cursor position. More... | |
void | HandleMouseMove (const PixelPos &pos) |
Called if the mouse is moved. More... | |
void | HandleMouseExit () |
Called if the mouse exits the game window (only for some videomodes) More... | |
int | HandleKeyModifiersDown (unsigned keycode, unsigned keychar) |
Update KeyModifiers if a key is pressed. More... | |
int | HandleKeyModifiersUp (unsigned keycode, unsigned keychar) |
Update KeyModifiers if a key is released. More... | |
void | HandleKeyDown (unsigned keycode, unsigned keychar) |
Called if a key is pressed. More... | |
void | HandleKeyUp (unsigned keycode, unsigned keychar) |
Called when a key is released. More... | |
void | HandleKeyRepeat (unsigned keycode, unsigned keychar) |
Called when a key is repeated. More... | |
void | InputMouseButtonPress (const EventCallback &callbacks, unsigned ticks, unsigned button) |
Called if any mouse button is pressed down. More... | |
void | InputMouseButtonRelease (const EventCallback &callbacks, unsigned ticks, unsigned button) |
Called if any mouse button is released up. More... | |
void | InputMouseMove (const EventCallback &callbacks, unsigned ticks, int x, int y) |
Called if the mouse is moved. More... | |
void | InputMouseExit (const EventCallback &callbacks, unsigned ticks) |
Called if the mouse exits the game window (when supported by videomode) More... | |
void | InputMouseTimeout (const EventCallback &callbacks, unsigned ticks) |
Called to look for mouse timeouts. More... | |
void | InputKeyButtonPress (const EventCallback &callbacks, unsigned ticks, unsigned ikey, unsigned ikeychar) |
Called if any key button is pressed down. More... | |
void | InputKeyButtonRelease (const EventCallback &callbacks, unsigned ticks, unsigned ikey, unsigned ikeychar) |
Called if any key button is released up. More... | |
void | InputKeyTimeout (const EventCallback &callbacks, unsigned ticks) |
Called to look for key timeouts. More... | |
int | GetDoubleClickDelay () |
Get double click delay. More... | |
void | SetDoubleClickDelay (int delay) |
Set double click delay. More... | |
int | GetHoldClickDelay () |
Get hold click delay. More... | |
void | SetHoldClickDelay (int delay) |
Set hold click delay. More... | |
void | UiTogglePause () |
Toggle pause mode. More... | |
void | UiToggleBigMap () |
Toggle big map. More... | |
void | UiToggleTerrain () |
Toggle terrain display on/off. More... | |
void | UiFindIdleWorker () |
Find the next idle worker. More... | |
void | UiTrackUnit () |
Track unit, the viewport follows the unit. More... | |
void | SetScrollMargins (unsigned int top, unsigned int right, unsigned int bottom, unsigned int left) |
Scroll margins on screen. More... | |
int | HandleCheats (const std::string &input) |
Handle cheats. More... | |
bool | HandleCommandKey (int key) |
Call the lua function HandleCommandKey. More... | |
void | CancelBuildingMode () |
Cancel the building input mode. More... | |
void | DrawMenuButtonArea () |
Draw menu button area. More... | |
void | DrawUserDefinedButtons () |
Draw user defined buttons. More... | |
void | UpdateMessages () |
Update messages. More... | |
void | DrawMessages () |
Draw messages as overlay over of the map. More... | |
void | DrawResources () |
Draw the player resource in resource line. More... | |
void | SetMessage (const char *fmt,...) PRINTF_VAARG_ATTRIBUTE(1 |
Set message to display. More... | |
void void | SetMessageEvent (const Vec2i &pos, const char *fmt,...) PRINTF_VAARG_ATTRIBUTE(2 |
Set message to display with event point. More... | |
void void void | CenterOnMessage () |
Center view-point on last event message. More... | |
void | CleanMessages () |
Cleanup all messages. More... | |
void | ToggleShowMessages () |
show/hide messages More... | |
void | SetMaxMessageCount (int newMax) |
max message count More... | |
void | DrawTimer () |
Draw the timer. More... | |
void | UpdateTimer () |
Update the timer. More... | |
void | UpdateStatusLineForButton (const ButtonAction &button) |
Update the status line with hints from the button. More... | |
void | DrawPieMenu () |
Draw the Pie Menu. More... | |
void | DrawPopup (const ButtonAction &button, const CUIButton &uibutton, int x=0, int y=0) |
Draw the button popup. More... | |
bool | HandleMouseScrollArea (const PixelPos &mousePos) |
Handle the mouse in scroll area. More... | |
bool | ButtonCheckTrue (const CUnit &unit, const ButtonAction &button) |
Check is always true. More... | |
bool | ButtonCheckFalse (const CUnit &unit, const ButtonAction &button) |
Check is always false. More... | |
bool | ButtonCheckUpgrade (const CUnit &unit, const ButtonAction &button) |
Check if allowed upgrade is ready. More... | |
bool | ButtonCheckIndividualUpgrade (const CUnit &unit, const ButtonAction &button) |
Check if unit has an individual upgrade. More... | |
bool | ButtonCheckUnitVariable (const CUnit &unit, const ButtonAction &button) |
Check if unit's variables pass the condition check. More... | |
bool | ButtonCheckUnitsOr (const CUnit &unit, const ButtonAction &button) |
Check if allowed units exists. More... | |
bool | ButtonCheckUnitsAnd (const CUnit &unit, const ButtonAction &button) |
Check if allowed units exists. More... | |
bool | ButtonCheckUnitsNot (const CUnit &unit, const ButtonAction &button) |
Check if not one unit exist. More... | |
bool | ButtonCheckUnitsNor (const CUnit &unit, const ButtonAction &button) |
Check if none of the units exist. More... | |
bool | ButtonCheckNetwork (const CUnit &unit, const ButtonAction &button) |
Check if have network play. More... | |
bool | ButtonCheckNoNetwork (const CUnit &unit, const ButtonAction &button) |
Check if don't have network play. More... | |
bool | ButtonCheckNoWork (const CUnit &unit, const ButtonAction &button) |
Check if unit isn't working (train,upgrade,research) More... | |
bool | ButtonCheckNoResearch (const CUnit &unit, const ButtonAction &button) |
Check if unit isn't researching or upgrading. More... | |
bool | ButtonCheckAttack (const CUnit &unit, const ButtonAction &button) |
Check if all requirements for an attack to are meet. More... | |
bool | ButtonCheckUpgradeTo (const CUnit &unit, const ButtonAction &button) |
Check if all requirements for an upgrade to are meet. More... | |
bool | ButtonCheckResearch (const CUnit &unit, const ButtonAction &button) |
Check if all requirements for a research are meet. More... | |
bool | ButtonCheckSingleResearch (const CUnit &unit, const ButtonAction &button) |
Check if all requirements for a single research are meet. More... | |
bool | ButtonCheckDebug (const CUnit &unit, const ButtonAction &button) |
Check for button enabled, if requested condition passes check. Used for debug purposes. More... | |
void | SelectionChanged () |
Called whenever the units selection is altered. More... | |
void | SelectedUnitChanged () |
Called whenever the selected unit was updated. More... | |
void | SetGamePaused (bool paused) |
Set the game paused or unpaused. More... | |
bool | GetGamePaused () |
Get the game paused or unpaused. More... | |
void | SetGameSpeed (int speed) |
Set the game speed. More... | |
int | GetGameSpeed () |
Get the game speed. More... | |
#define DownButton 32 |
#define LeftAndMiddleButton (LeftButton | MiddleButton) |
#define LeftAndRightButton (LeftButton | RightButton) |
#define LeftButton 2 |
#define MiddleAndRightButton (MiddleButton | RightButton) |
#define MiddleButton 4 |
#define ModifierAlt 4 |
#define ModifierControl 2 |
#define ModifierDoublePress 16 |
#define ModifierShift 1 |
current keyboard state
Key modifier
#define ModifierSuper 8 |
#define MouseDoubleShift 8 |
#define MouseDragShift 16 |
#define MouseHoldShift 24 |
#define NoButton 0 |
pressed mouse button flags
#define RightButton 8 |
#define ScrollDown 2 |
#define ScrollLeft 4 |
#define ScrollLeftDown 6 |
#define ScrollLeftUp 5 |
#define ScrollNone 0 |
Are We Scrolling With the Keyboard ?
#define ScrollRight 8 |
#define ScrollRightDown 10 |
#define ScrollRightUp 9 |
#define ScrollUp 1 |
#define UpButton 16 |
typedef bool(* ButtonCheckFunc) (const CUnit &, const ButtonAction &) |
enum _button_area_ |
Button area under cursor.
enum _cursor_on_ |
Where is our cursor ?
enum _iface_state_ |
current interface state
Enumerator | |
---|---|
IfaceStateNormal | |
IfaceStateMenu | Normal Game state. Menu active |
enum _key_state_ |
enum _menu_button_under_ |
enum ButtonCmd |
Button Commands that need target selection.
int AddButton | ( | int | pos, |
int | level, | ||
const std::string & | icon_ident, | ||
ButtonCmd | action, | ||
const std::string & | value, | ||
void * | actionCb, | ||
const ButtonCheckFunc | func, | ||
const std::string & | allow, | ||
const int | key, | ||
const std::string & | hint, | ||
const std::string & | descr, | ||
const std::string & | sound, | ||
const std::string & | cursor, | ||
const std::string & | umask, | ||
const std::string & | popup, | ||
bool | alwaysShow | ||
) |
Make a new button.
FIXME: docu
bool ButtonCheckAttack | ( | const CUnit & | unit, |
const ButtonAction & | |||
) |
Check if all requirements for an attack to are meet.
Check if all requirements for an attack are met.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckDebug | ( | const CUnit & | , |
const ButtonAction & | button | ||
) |
Check for button enabled, if requested condition passes check. Used for debug purposes.
Check for button enabled, if requested condition passes check Used for debug purposes
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
Check if enabled walls for singleplayer games
bool ButtonCheckFalse | ( | const CUnit & | , |
const ButtonAction & | |||
) |
Check is always false.
Check for button enabled, always false. This needed to overwrite the internal tests.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckIndividualUpgrade | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if unit has an individual upgrade.
Check for button enabled, if unit has an individual upgrade.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckNetwork | ( | const CUnit & | , |
const ButtonAction & | |||
) |
Check if have network play.
Check if network play is enabled.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckNoNetwork | ( | const CUnit & | , |
const ButtonAction & | |||
) |
Check if don't have network play.
Check if network play is disabled.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckNoResearch | ( | const CUnit & | unit, |
const ButtonAction & | |||
) |
Check if unit isn't researching or upgrading.
Check for button enabled, if the unit isn't researching.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckNoWork | ( | const CUnit & | unit, |
const ButtonAction & | |||
) |
Check if unit isn't working (train,upgrade,research)
Check for button enabled, if the unit isn't working. Working is training, upgrading, researching.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckResearch | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if all requirements for a research are meet.
Check if all requirements for upgrade research are met.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckSingleResearch | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if all requirements for a single research are meet.
Check if all requirements for upgrade research are met only one running research allowed.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckTrue | ( | const CUnit & | , |
const ButtonAction & | |||
) |
Check is always true.
ButtonCheck for button enabled, always true. This needed to overwrite the internal tests.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUnitsAnd | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if allowed units exists.
Check for button enabled, if all units are available.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUnitsNor | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if none of the units exist.
Check for button enabled, if none of the units are available.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUnitsNot | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if not one unit exist.
Check for button enabled, if not all units are available.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUnitsOr | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if allowed units exists.
Check for button enabled, if any unit is available.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUnitVariable | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if unit's variables pass the condition check.
Check for button enabled, if unit's variables pass the condition check.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUpgrade | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if allowed upgrade is ready.
Check for button enabled, if upgrade is ready.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
bool ButtonCheckUpgradeTo | ( | const CUnit & | unit, |
const ButtonAction & | button | ||
) |
Check if all requirements for an upgrade to are meet.
Check for button enabled, if all requirements for an upgrade to unit are met.
unit | Pointer to unit for button. |
button | Pointer to button to check/enable. |
void CancelBuildingMode | ( | ) |
Cancel the building input mode.
Cancel building cursor mode.
void CleanButtons | ( | ) |
Free memory for buttons.
Cleanup buttons.
void CleanMessages | ( | ) |
Cleanup all messages.
Clean messages
void DrawMenuButtonArea | ( | ) |
Draw menu button area.
Draw menu button area.
void DrawMessages | ( | ) |
Draw messages as overlay over of the map.
Draw messages
void DrawPieMenu | ( | ) |
Draw the Pie Menu.
Draw Pie Menu
void DrawPopup | ( | const ButtonAction & | button, |
const CUIButton & | uibutton, | ||
int | x, | ||
int | y | ||
) |
Draw the button popup.
Draw popup
void DrawResources | ( | ) |
Draw the player resource in resource line.
Draw the player resource in top line.
void DrawTimer | ( | ) |
void DrawUserDefinedButtons | ( | ) |
Draw user defined buttons.
int GetDoubleClickDelay | ( | ) |
Get double click delay.
Get double click delay
bool GetGamePaused | ( | ) |
Get the game paused or unpaused.
Get the game paused or unpaused
int GetGameSpeed | ( | ) |
int GetHoldClickDelay | ( | ) |
Get hold click delay.
Get hold click delay
CUnit* GetUnitUnderCursor | ( | ) |
void HandleButtonDown | ( | unsigned | button | ) |
Called if any mouse button is pressed down.
Called if mouse button pressed down.
button | Mouse button number (0 left, 1 middle, 2 right) |
void HandleButtonUp | ( | unsigned | button | ) |
Called if any mouse button is released up.
Called if mouse button released.
FIXME: the mouse handling should be complete rewritten
FIXME: this is needed for double click, long click,...
button | Mouse button number (0 left, 1 middle, 2 right) |
int HandleCheats | ( | const std::string & | input | ) |
Handle cheats.
Handle cheats
bool HandleCommandKey | ( | int | key | ) |
Call the lua function HandleCommandKey.
Call the lua function HandleCommandKey
void HandleCursorMove | ( | int * | x, |
int * | y | ||
) |
Keep coordinates in window and update cursor position.
Keep coordinates in window and update cursor position
x | screen pixel X position. |
y | screen pixel Y position. |
void HandleKeyDown | ( | unsigned | key, |
unsigned | keychar | ||
) |
Called if a key is pressed.
Handle key down.
key | Key scancode. |
keychar | Character code. |
int HandleKeyModifiersDown | ( | unsigned | key, |
unsigned | |||
) |
Update KeyModifiers if a key is pressed.
Update KeyModifiers if a key is pressed.
key | Key scancode. |
keychar | Character code. |
int HandleKeyModifiersUp | ( | unsigned | key, |
unsigned | |||
) |
Update KeyModifiers if a key is released.
Update KeyModifiers if a key is released.
key | Key scancode. |
keychar | Character code. |
void HandleKeyRepeat | ( | unsigned | , |
unsigned | keychar | ||
) |
Called when a key is repeated.
Handle key up.
key | Key scancode. |
keychar | Character code. |
void HandleKeyUp | ( | unsigned | key, |
unsigned | keychar | ||
) |
Called when a key is released.
Handle key up.
key | Key scancode. |
keychar | Character code. |
void HandleMouseExit | ( | ) |
Called if the mouse is moved.
Handle movement of the cursor.
screePos | screen pixel position. |
bool HandleMouseScrollArea | ( | const PixelPos & | mousePos | ) |
Handle the mouse in scroll area.
Handle the mouse in scroll area
mousePos | Screen position. |
void InitButtons | ( | ) |
Generate all buttons.
Initialize the buttons.
void InputKeyButtonPress | ( | const EventCallback & | callbacks, |
unsigned | ticks, | ||
unsigned | ikey, | ||
unsigned | ikeychar | ||
) |
Called if any key button is pressed down.
Called if any key button is pressed down.
Handle keyboard key press.
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
ikey | Key scancode. |
ikeychar | Character code. |
void InputKeyButtonRelease | ( | const EventCallback & | callbacks, |
unsigned | ticks, | ||
unsigned | ikey, | ||
unsigned | ikeychar | ||
) |
Called if any key button is released up.
Handle keyboard key release.
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
ikey | Key scancode. |
ikeychar | Character code. |
void InputKeyTimeout | ( | const EventCallback & | callbacks, |
unsigned | ticks | ||
) |
Called to look for key timeouts.
Called each frame to handle keyboard timeouts.
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
void InputMouseButtonPress | ( | const EventCallback & | callbacks, |
unsigned | ticks, | ||
unsigned | button | ||
) |
Called if any mouse button is pressed down.
Called if any mouse button is pressed down.
Called if any mouse button is pressed down
Handles event conversion to double click, dragging, hold.
FIXME: dragging is not supported.
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
button | Mouse button pressed. |
void InputMouseButtonRelease | ( | const EventCallback & | callbacks, |
unsigned | ticks, | ||
unsigned | button | ||
) |
Called if any mouse button is released up.
Called if any mouse button is released up
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
button | Mouse button released. |
void InputMouseExit | ( | const EventCallback & | callbacks, |
unsigned | |||
) |
Called if the mouse exits the game window (when supported by videomode)
Called if the mouse exits the game window (when supported by videomode)
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
void InputMouseMove | ( | const EventCallback & | callbacks, |
unsigned | ticks, | ||
int | x, | ||
int | y | ||
) |
Called if the mouse is moved.
Called if the mouse is moved
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
x | X movement |
y | Y movement |
void InputMouseTimeout | ( | const EventCallback & | callbacks, |
unsigned | ticks | ||
) |
Called to look for mouse timeouts.
Called each frame to handle mouse timeouts.
callbacks | Callback structure for events. |
ticks | Denotes time-stamp of video-system |
bool IsButtonAllowed | ( | const CUnit & | unit, |
const ButtonAction & | buttonaction | ||
) |
Check if the button is allowed for the unit.
unit | unit which checks for allow. |
buttonaction | button to check if it is allowed. |
FIXME: better check. (dependency, resource, ...)
FIXME: make difference with impossible and not yet researched.
void SelectedUnitChanged | ( | ) |
Called whenever the selected unit was updated.
The selected unit has been altered.
void SelectionChanged | ( | ) |
Called whenever the units selection is altered.
Run the set-selection-changed-hook.
void SetDoubleClickDelay | ( | int | delay | ) |
Set double click delay.
Set double click delay
delay | Double click delay |
void SetGamePaused | ( | bool | paused | ) |
Set the game paused or unpaused.
Set the game paused or unpaused
paused | True to pause game, false to unpause. |
void SetGameSpeed | ( | int | speed | ) |
Set the game speed.
Set the game speed
speed | New game speed. |
void SetHoldClickDelay | ( | int | delay | ) |
Set hold click delay.
Set hold click delay
delay | Hold click delay |
void SetMaxMessageCount | ( | int | newMax | ) |
max message count
void SetMessage | ( | const char * | fmt, |
... | |||
) |
Set message to display.
Set message to display with event point.
void SetScrollMargins | ( | unsigned int | top, |
unsigned int | right, | ||
unsigned int | bottom, | ||
unsigned int | left | ||
) |
Scroll margins on screen.
Configure margins (in pixels) on screen where map scrolling starts.
void ToggleShowMessages | ( | ) |
show/hide messages
void UiFindIdleWorker | ( | ) |
Find the next idle worker.
Find the next idle worker, select it, and center on it
void UiToggleBigMap | ( | ) |
void UiTogglePause | ( | ) |
Toggle pause mode.
Toggle pause on / off.
void UiToggleTerrain | ( | ) |
Toggle terrain display on/off.
Toggle terrain display on/off.
void UiTrackUnit | ( | ) |
Track unit, the viewport follows the unit.
Track unit, the viewport follows the unit.
void UpdateMessages | ( | ) |
Update messages.
Update messages
void UpdateStatusLineForButton | ( | const ButtonAction & | button | ) |
Update the status line with hints from the button.
Update the status line with hints from the button
button | Button |
void UpdateTimer | ( | ) |
Update the timer.
Update the timer
char BigMapMode |
Whether the map is the only thing displayed or not.
Whether the map is the only thing displayed or not.
int ButtonAreaUnderCursor |
button area under the cursor
button area under the cursor
int ButtonUnderCursor |
button number under the cursor
button number under the cursor
int CurrentButtonLevel |
vladi: used for unit buttons sub-menus etc
vladi: used for unit buttons sub-menus etc
enum _cursor_on_ CursorOn |
current CursorOn field
current CursorOn field
int DoubleClickDelay |
Time to detect double clicks.
bool GameDiplomacyButtonClicked |
diplomacy button was clicked down
diplomacy button was clicked down
bool GameEstablishing |
Flag telling if the game is in establishing mode.
Flag telling if the game is in establishing mode.
bool GameMenuButtonClicked |
menu button was clicked down
menu button was clicked down
bool GameObserve |
Flag telling if the game is in observe mode.
Flag telling if the game is in observe mode.
bool GamePaused |
Flag telling if the game is paused.
Flag telling if the game is paused.
bool GameRunning |
Flag telling if the game is running.
Flag telling if the game is running.
bool GodMode |
Invincibility cheat.
Invincibility cheat.
int HoldClickDelay |
Time to detect hold clicks.
Time to detect hold clicks.
enum _iface_state_ InterfaceState |
current interface state
current interface state
bool IsSDLWindowVisible |
Flag telling if the SDL window is visible.
int KeyModifiers |
current active modifiers
current active modifiers
int KeyScrollState |
current scroll state of keyboard
current scroll state of keyboard
enum _key_state_ KeyState |
current key state
current key state
ButtonAction* LastDrawnButtonPopup |
Last drawn popup : used to speed up drawing.
bool LeaveStops |
Mouse leaves windows stops scroll.
Mouse leaves windows stops scroll.
int MouseButtons |
pressed mouse buttons (normal,double,dragged,long)
int MouseScrollState |
current scroll state of mouse
current scroll state of mouse
int OldButtonUnderCursor |
oldbutton number under the cursor
oldbutton number under the cursor
char SkipGameCycle |
Flag telling not to advance to the next game cycle.
Flag telling not to advance to the next game cycle.
std::vector<ButtonAction *> UnitButtonTable |
All buttons for units.
CUnit* UnitUnderCursor |
shared pointer to unit under the cursor
shared pointer to unit under the cursor