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

src/include/interface.h File Reference

#include "icons.h"
#include "unit.h"

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
#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
#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 ?
#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, ButtonAttackGround, ButtonSpellCast,
  ButtonUnload, ButtonStop, ButtonButton, ButtonTrain,
  ButtonStandGround, ButtonReturn, ButtonResearch, ButtonUpgradeTo,
  ButtonCancel, ButtonCancelUpgrade, ButtonCancelTrain, ButtonCancelBuild
}
 Button Commands that need target selection. More...
enum  _button_area_ {
  ButtonAreaSelected, ButtonAreaTraining, ButtonAreaUpgrading, ButtonAreaResearching,
  ButtonAreaTransporting, ButtonAreaButton, ButtonAreaMenu
}
 Button area under cursor. More...
enum  _menu_button_under_ { ButtonUnderMenu, ButtonUnderNetworkMenu, ButtonUnderNetworkDiplomacy }
 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.
bool GameRunning
 Flag telling if the game is running.
bool GamePaused
 Flag telling if the game is paused.
bool GameObserve
 Flag telling if the game is in observe mode.
char SkipGameCycle
 Flag telling not to advance to the next game cycle.
bool GodMode
 Invincibility cheat.
char BigMapMode
 Whether the map is the only thing displayed or not.
bool IsSDLWindowVisible
 Flag telling if the SDL window is visible.
int MouseButtons
 pressed mouse buttons (normal,double,dragged,long)
int KeyModifiers
 current active modifiers
enum _iface_state_ InterfaceState
 current interface state
int KeyScrollState
 current scroll state of keyboard
int MouseScrollState
 current scroll state of mouse
enum _key_state_ KeyState
 current key state
CUnitPtr UnitUnderCursor
 shared pointer to unit under the cursor
int ButtonAreaUnderCursor
 button area under the cursor
int ButtonUnderCursor
 button number under the cursor
bool GameMenuButtonClicked
 menu button was clicked down
bool GameDiplomacyButtonClicked
 diplomacy button was clicked down
bool LeaveStops
 Mouse leaves windows stops scroll.
enum _cursor_on_ CursorOn
 current CursorOn field
int CurrentButtonLevel
 vladi: used for unit buttons sub-menus etc
int DoubleClickDelay
 Time to detect double clicks.
int HoldClickDelay
 Time to detect hold clicks.
CUnitGetUnitUnderCursor ()
void InitButtons ()
 Generate all buttons.
void CleanButtons ()
 Free memory for buttons.
int AddButton (int pos, int level, const std::string &IconIdent, ButtonCmd action, const std::string &value, const ButtonCheckFunc func, const std::string &arg, const std::string &hint, const std::string &descr, const std::string &sound, const std::string &cursor, const std::string &umask)
 Make a new button.
void HandleButtonDown (unsigned button)
 Called if any mouse button is pressed down.
void HandleButtonUp (unsigned button)
 Called if any mouse button is released up.
void HandleCursorMove (int *x, int *y)
 Keep coordinates in window and update cursor position.
void HandleMouseMove (int x, int y)
 Called if the mouse is moved.
void HandleMouseExit ()
 Called if the mouse exits the game window (only for some videomodes).
int HandleKeyModifiersDown (unsigned keycode, unsigned keychar)
 Update KeyModifiers if a key is pressed.
int HandleKeyModifiersUp (unsigned keycode, unsigned keychar)
 Update KeyModifiers if a key is released.
void HandleKeyDown (unsigned keycode, unsigned keychar)
 Called if a key is pressed.
void HandleKeyUp (unsigned keycode, unsigned keychar)
 Called when a key is released.
void HandleKeyRepeat (unsigned keycode, unsigned keychar)
 Called when a key is repeated.
void InputMouseButtonPress (const struct _event_callback_ *callbacks, unsigned ticks, unsigned button)
 Called if any mouse button is pressed down.
void InputMouseButtonRelease (const struct _event_callback_ *callbacks, unsigned ticks, unsigned button)
 Called if any mouse button is released up.
void InputMouseMove (const struct _event_callback_ *callbacks, unsigned ticks, int x, int y)
 Called if the mouse is moved.
void InputMouseExit (const struct _event_callback_ *callbacks, unsigned ticks)
 Called if the mouse exits the game window (when supported by videomode).
void InputMouseTimeout (const struct _event_callback_ *callbacks, unsigned ticks)
 Called to look for mouse timeouts.
void InputKeyButtonPress (const struct _event_callback_ *callbacks, unsigned ticks, unsigned ikey, unsigned ikeychar)
 Called if any key button is pressed down.
void InputKeyButtonRelease (const struct _event_callback_ *callbacks, unsigned ticks, unsigned ikey, unsigned ikeychar)
 Called if any key button is released up.
void InputKeyTimeout (const struct _event_callback_ *callbacks, unsigned ticks)
 Called to look for key timeouts.
int GetDoubleClickDelay ()
 Get double click delay.
void SetDoubleClickDelay (int delay)
 Set double click delay.
int GetHoldClickDelay ()
 Get hold click delay.
void SetHoldClickDelay (int delay)
 Set hold click delay.
void UiTogglePause ()
 Toggle pause mode.
void UiToggleBigMap ()
 Toggle big map.
int HandleCheats (const std::string &input)
 Handle cheats.
bool HandleCommandKey (int key)
 Call the lua function HandleCommandKey.
void DoRightButton (int tx, int ty)
 Called if right mouse button is pressed.
void CancelBuildingMode ()
 Cancel the building input mode.
void DrawMenuButtonArea ()
 Draw menu button area.
void UpdateMessages ()
 Update messages.
void DrawMessages ()
 Draw messages as overlay over of the map.
void DrawResources ()
 Draw the player resource in resource line.
void SetMessage (const char *fmt,...)
 Set message to display.
void SetMessageEvent (int x, int y, const char *fmt,...)
 Set message to display with event point.
void CenterOnMessage ()
 Center view-point on last event message.
void CleanMessages ()
 Cleanup all messages.
void ToggleShowMessages ()
 show/hide messages
void DrawCosts ()
 Draw costs in status line.
void SetCosts (int mana, int food, const int *costs)
 Set costs to be displayed in status line.
void ClearCosts ()
 Clear the costs displayed in status line (undisplay!).
void DrawTimer ()
 Draw the timer.
void UpdateTimer ()
 Update the timer.
void UpdateStatusLineForButton (const ButtonAction *button)
 Update the status line with hints from the button.
void DrawPieMenu ()
 Draw the Pie Menu.
int HandleMouseScrollArea (int x, int y)
 Handle the mouse in scroll area.
bool ButtonCheckTrue (const CUnit &unit, const ButtonAction *button)
 Check is always true.
bool ButtonCheckFalse (const CUnit &unit, const ButtonAction *button)
 Check is always false.
bool ButtonCheckUpgrade (const CUnit &unit, const ButtonAction *button)
 Check if allowed upgrade is ready.
bool ButtonCheckUnitsOr (const CUnit &unit, const ButtonAction *button)
 Check if allowed units exists.
bool ButtonCheckUnitsAnd (const CUnit &unit, const ButtonAction *button)
 Check if allowed units exists.
bool ButtonCheckNetwork (const CUnit &unit, const ButtonAction *button)
 Check if have network play.
bool ButtonCheckNoNetwork (const CUnit &unit, const ButtonAction *button)
 Check if don't have network play.
bool ButtonCheckNoWork (const CUnit &unit, const ButtonAction *button)
 Check if unit isn't working (train,upgrade,research).
bool ButtonCheckNoResearch (const CUnit &unit, const ButtonAction *button)
 Check if unit isn't researching or upgrading.
bool ButtonCheckAttack (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for an attack to are meet.
bool ButtonCheckUpgradeTo (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for an upgrade to are meet.
bool ButtonCheckResearch (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for a research are meet.
bool ButtonCheckSingleResearch (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for a single research are meet.
void SelectionChanged ()
 Called whenever the units selection is altered.
void SelectedUnitChanged ()
 Called whenever the selected unit was updated.
void SetGamePaused (bool paused)
 Set the game paused or unpaused.
bool GetGamePaused ()
 Get the game paused or unpaused.
void SetGameSpeed (int speed)
 Set the game speed.
int GetGameSpeed ()
 Get the game speed.

Define Documentation

#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 Documentation

typedef bool(* ButtonCheckFunc)(const CUnit &, const ButtonAction *)


Enumeration Type Documentation

Button area under cursor.

Enumerator:
ButtonAreaSelected 
ButtonAreaTraining  Selected button.
ButtonAreaUpgrading  Training button.
ButtonAreaResearching  Upgrading button.
ButtonAreaTransporting  Researching button.
ButtonAreaButton  Transporting button.
ButtonAreaMenu  Button panel button.

Menu button

Where is our cursor ?

Enumerator:
CursorOnUnknown 
CursorOnMinimap  not known
CursorOnButton  minimap area
CursorOnMap  button area see: ButtonUnderCursor
CursorOnScrollUp  over map area
CursorOnScrollDown  in scroll up area
CursorOnScrollLeft  in scroll down area
CursorOnScrollRight  in scroll left area
CursorOnScrollLeftUp  in scroll right area
CursorOnScrollLeftDown  in scroll left+up area
CursorOnScrollRightUp  in scroll left+down area
CursorOnScrollRightDown  in scroll right+up area

in scroll right+down area

current interface state

Enumerator:
IfaceStateNormal 
IfaceStateMenu  Normal Game state.

Menu active

current key state

Enumerator:
KeyStateCommand 
KeyStateInput  keys -> commands

keys -> line editor

Menu button under cursor.

Enumerator:
ButtonUnderMenu 
ButtonUnderNetworkMenu  Menu button.
ButtonUnderNetworkDiplomacy  Network menu button.

Diplomacy button

enum ButtonCmd

Button Commands that need target selection.

Enumerator:
ButtonMove 
ButtonAttack  order move
ButtonRepair  order attack
ButtonHarvest  order repair
ButtonBuild  order harvest
ButtonPatrol  order build
ButtonAttackGround  order patrol
ButtonSpellCast  order attack ground
ButtonUnload  order cast spell
ButtonStop  order unload unit
ButtonButton  order stop
ButtonTrain  choose other button set
ButtonStandGround  order train
ButtonReturn  order stand ground
ButtonResearch  order return goods
ButtonUpgradeTo  order reseach
ButtonCancel  order upgrade
ButtonCancelUpgrade  cancel
ButtonCancelTrain  cancel upgrade
ButtonCancelBuild  cancel training

cancel building


Function Documentation

int AddButton ( int  pos,
int  level,
const std::string &  icon_ident,
ButtonCmd  action,
const std::string &  value,
const ButtonCheckFunc  func,
const std::string &  allow,
const std::string &  hint,
const std::string &  descr,
const std::string &  sound,
const std::string &  cursor,
const std::string &  umask 
)

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.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckFalse ( const CUnit ,
const ButtonAction  
)

Check is always false.

Check for button enabled, always false. This needed to overwrite the internal tests.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckNetwork ( const CUnit ,
const ButtonAction  
)

Check if have network play.

Check if network play is enabled.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.
Note:
: this check could also be moved into intialisation.

bool ButtonCheckNoNetwork ( const CUnit ,
const ButtonAction  
)

Check if don't have network play.

Check if network play is disabled.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if disabled.
Note:
: this check could also be moved into intialisation.

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.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckTrue ( const CUnit ,
const ButtonAction  
)

Check is always true.

ButtonCheck for button enabled, always true. This needed to overwrite the internal tests.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckUnitsAnd ( const CUnit unit,
const ButtonAction button 
)

Check if allowed units exists.

Check for button enabled, if all units are available.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckUnitsOr ( const CUnit unit,
const ButtonAction button 
)

Check if allowed units exists.

Check for button enabled, if any unit is available.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckUpgrade ( const CUnit unit,
const ButtonAction button 
)

Check if allowed upgrade is ready.

Check for button enabled, if upgrade is ready.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

void CancelBuildingMode (  ) 

Cancel the building input mode.

Cancel building cursor mode.

void CenterOnMessage (  ) 

Center view-point on last event message.

Goto message origin.

void CleanButtons (  ) 

Free memory for buttons.

Cleanup buttons.

void CleanMessages (  ) 

Cleanup all messages.

Clean messages

void ClearCosts (  ) 

Clear the costs displayed in status line (undisplay!).

Clear costs in status line.

void DoRightButton ( int  sx,
int  sy 
)

Called if right mouse button is pressed.

Called when right button is pressed

Parameters:
sx X map position in pixels.
sy Y map position in pixels.

void DrawCosts (  ) 

Draw costs in status line.

Draw costs in status line.

Draw costs in status line.

Todo:
FIXME : make DrawCosts more configurable.
Todo:
FIXME : 'time' resource should be shown too.
Todo:
FIXME : remove hardcoded image for mana.

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 DrawResources (  ) 

Draw the player resource in resource line.

Draw the player resource in top line.

Todo:
FIXME : make DrawResources more configurable (format, font).

void DrawTimer (  ) 

Draw the timer.

Draw the timer

Todo:
FIXME : make DrawTimer more configurable (Pos, format).

int GetDoubleClickDelay (  ) 

Get double click delay.

Get double click delay

bool GetGamePaused (  ) 

Get the game paused or unpaused.

Get the game paused or unpaused

Returns:
True if the game is paused, false otherwise

int GetGameSpeed (  ) 

Get the game speed.

Get the game speed

Returns:
Game speed

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.

Parameters:
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.

Todo:
FIXME: the mouse handling should be complete rewritten
Todo:
FIXME: this is needed for double click, long click,...
Parameters:
button Mouse button number (0 left, 1 middle, 2 right)

int HandleCheats ( const std::string &  input  ) 

Handle cheats.

Handle cheats

Returns:
1 if a cheat was handled, 0 otherwise

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

Parameters:
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.

Parameters:
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.

Parameters:
key Key scancode.
keychar Character code.
Returns:
1 if modifier found, 0 otherwise

int HandleKeyModifiersUp ( unsigned  key,
unsigned   
)

Update KeyModifiers if a key is released.

Update KeyModifiers if a key is released.

Parameters:
key Key scancode.
keychar Character code.
Returns:
1 if modifier found, 0 otherwise

void HandleKeyRepeat ( unsigned  ,
unsigned  keychar 
)

Called when a key is repeated.

Handle key up.

Parameters:
key Key scancode.
keychar Character code.

void HandleKeyUp ( unsigned  key,
unsigned  keychar 
)

Called when a key is released.

Handle key up.

Parameters:
key Key scancode.
keychar Character code.

void HandleMouseExit (  ) 

Called if the mouse exits the game window (only for some videomodes).

Handle cursor exits the game window (only for some videomodes)

Todo:
FIXME: make it so that the game is partially 'paused'. Game should run (for network play), but not react on or show interactive events.

void HandleMouseMove ( int  x,
int  y 
)

Called if the mouse is moved.

Handle movement of the cursor.

Parameters:
x screen pixel X position.
y screen pixel Y position.

int HandleMouseScrollArea ( int  x,
int  y 
)

Handle the mouse in scroll area.

Handle the mouse in scroll area

Parameters:
x Screen X position.
y Screen Y position.
Returns:
1 if the mouse is in the scroll area, 0 otherwise

void InitButtons (  ) 

Generate all buttons.

Initialize the buttons.

void InputKeyButtonPress ( const struct _event_callback_ callbacks,
unsigned  ticks,
unsigned  ikey,
unsigned  ikeychar 
)

Called if any key button is pressed down.

void InputKeyButtonRelease ( const struct _event_callback_ callbacks,
unsigned  ticks,
unsigned  ikey,
unsigned  ikeychar 
)

Called if any key button is released up.

void InputKeyTimeout ( const struct _event_callback_ callbacks,
unsigned  ticks 
)

Called to look for key timeouts.

void InputMouseButtonPress ( const struct _event_callback_ callbacks,
unsigned  ticks,
unsigned  button 
)

Called if any mouse button is pressed down.

void InputMouseButtonRelease ( const struct _event_callback_ callbacks,
unsigned  ticks,
unsigned  button 
)

Called if any mouse button is released up.

void InputMouseExit ( const struct _event_callback_ callbacks,
unsigned  ticks 
)

Called if the mouse exits the game window (when supported by videomode).

void InputMouseMove ( const struct _event_callback_ callbacks,
unsigned  ticks,
int  x,
int  y 
)

Called if the mouse is moved.

void InputMouseTimeout ( const struct _event_callback_ callbacks,
unsigned  ticks 
)

Called to look for mouse timeouts.

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 SetCosts ( int  mana,
int  food,
const int *  costs 
)

Set costs to be displayed in status line.

Set costs in status line.

Parameters:
mana Mana costs.
food Food costs.
costs Resource costs, NULL pointer if all are zero.

void SetDoubleClickDelay ( int  delay  ) 

Set double click delay.

Set double click delay

Parameters:
delay Double click delay

void SetGamePaused ( bool  paused  ) 

Set the game paused or unpaused.

Set the game paused or unpaused

Parameters:
paused True to pause game, false to unpause.

void SetGameSpeed ( int  speed  ) 

Set the game speed.

Set the game speed

Parameters:
speed New game speed.

void SetHoldClickDelay ( int  delay  ) 

Set hold click delay.

Set hold click delay

Parameters:
delay Hold click delay

void SetMessage ( const char *  fmt,
  ... 
)

Set message to display.

Set message to display.

Parameters:
fmt To be displayed in text overlay.

void SetMessageEvent ( int  x,
int  y,
const char *  fmt,
  ... 
)

Set message to display with event point.

Set message to display.

Parameters:
x Message X map origin.
y Message Y map origin.
fmt To be displayed in text overlay.
Note:
FIXME: vladi: I know this can be just separated func w/o msg but it is handy to stick all in one call, someone?

void ToggleShowMessages (  ) 

show/hide messages

void UiToggleBigMap (  ) 

Toggle big map.

Toggle big map mode.

Todo:
FIXME: We should try to keep the same view, if possible

void UiTogglePause (  ) 

Toggle pause mode.

Toggle pause on / off.

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

Parameters:
button Button

void UpdateTimer (  ) 

Update the timer.

Update the timer


Variable Documentation

char BigMapMode

Whether the map is the only thing displayed or not.

button area under the cursor

button number under the cursor

vladi: used for unit buttons sub-menus etc

current CursorOn field

Time to detect double clicks.

diplomacy button was clicked down

menu button was clicked down

Flag telling if the game is in observe mode.

bool GamePaused

Flag telling if the game is paused.

Flag telling if the game is running.

bool GodMode

Invincibility cheat.

Time to detect hold clicks.

current interface state

Flag telling if the SDL window is visible.

current active modifiers

current scroll state of keyboard

current key state

bool LeaveStops

Mouse leaves windows stops scroll.

pressed mouse buttons (normal,double,dragged,long)

current scroll state of mouse

Flag telling not to advance to the next game cycle.

std::vector<ButtonAction *> UnitButtonTable

All buttons for units.

shared pointer to unit under the cursor

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.