____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

script_ui.cpp File Reference

The ui ccl functions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include "script.h"
#include "interface.h"
#include "ui.h"
#include "video.h"
#include "map.h"
#include "menus.h"
#include "font.h"
#include "unit.h"
#include "unit_manager.h"
#include "unittype.h"
#include "title.h"

Go to the source code of this file.

Functions

static int CclSetMouseScrollSpeedDefault (lua_State *l)
static int CclSetMouseScrollSpeedControl (lua_State *l)
static int CclSetClickMissile (lua_State *l)
static int CclSetDamageMissile (lua_State *l)
static int CclSetVideoResolution (lua_State *l)
static int CclGetVideoResolution (lua_State *l)
static int CclSetVideoFullScreen (lua_State *l)
static int CclGetVideoFullScreen (lua_State *l)
static int CclSetTitleScreens (lua_State *l)
static int CclDefineCursor (lua_State *l)
static int CclSetGameCursor (lua_State *l)
static int CclDefineViewports (lua_State *l)
static int CclRightButtonAttacks (lua_State *l)
static int CclRightButtonMoves (lua_State *l)
ButtonStyleFindButtonStyle (const std::string &style)
 Called if the mouse is moved in Normal interface state.
static void ParseButtonStyleProperties (lua_State *l, ButtonStyleProperties *p)
static int CclDefineButtonStyle (lua_State *l)
int AddHandler (lua_State *l)
void CallHandler (unsigned int handle, int value)
static int CclDefineButton (lua_State *l)
void SelectionChanged (void)
 < Called whenever the units selection is altered
void SelectedUnitChanged (void)
 Called whenever the selected unit was updated.
static int CclAddMessage (lua_State *l)
static int CclSetGroupKeys (lua_State *l)
static int CclPresentMap (lua_State *l)
static int CclDefineMapSetup (lua_State *l)
void UserInterfaceCclRegister (void)
 Find a button style.

Variables

std::string ClickMissile
 FIXME:docu.
std::string DamageMissile
 FIXME:docu.
std::map< std::string,
ButtonStyle * > 
ButtonStyleHash
static int HandleCount = 1
 Lua handler count.
CPreference Preference


Detailed Description

The ui ccl functions.

Definition in file script_ui.cpp.


Function Documentation

int AddHandler ( lua_State *  l  ) 

Add a Lua handler FIXME: when should these be freed?

Definition at line 694 of file script_ui.cpp.

References HandleCount.

void CallHandler ( unsigned int  handle,
int  value 
)

Call a Lua handler

Definition at line 716 of file script_ui.cpp.

References Lua, and LuaCall().

static int CclAddMessage ( lua_State *  l  )  [static]

Add a new message.

Parameters:
l Lua state.

Definition at line 907 of file script_ui.cpp.

References LuaCheckArgs, LuaToString(), and SetMessage().

Referenced by UserInterfaceCclRegister().

static int CclDefineButton ( lua_State *  l  )  [static]

static int CclDefineButtonStyle ( lua_State *  l  )  [static]

static int CclDefineCursor ( lua_State *  l  )  [static]

Define a cursor.

Parameters:
l Lua state.

Definition at line 310 of file script_ui.cpp.

References _C_, AllCursors, Assert, int(), LuaCheckArgs, LuaError, LuaToNumber(), LuaToString(), and CGraphic::New().

Referenced by UserInterfaceCclRegister().

static int CclDefineMapSetup ( lua_State *  l  )  [static]

Define the lua file that will build the map

Parameters:
l Lua state.

Definition at line 949 of file script_ui.cpp.

References CMapInfo::Filename, CMap::Info, LuaCheckArgs, LuaToString(), and Map.

Referenced by UserInterfaceCclRegister().

static int CclDefineViewports ( lua_State *  l  )  [static]

static int CclGetVideoFullScreen ( lua_State *  l  )  [static]

Get the video fullscreen mode.

Parameters:
l Lua state.

Definition at line 188 of file script_ui.cpp.

References CVideo::FullScreen, LuaCheckArgs, and Video.

Referenced by UserInterfaceCclRegister().

static int CclGetVideoResolution ( lua_State *  l  )  [static]

Get the video resolution.

Parameters:
l Lua state.

Definition at line 158 of file script_ui.cpp.

References CVideo::Height, LuaCheckArgs, Video, and CVideo::Width.

Referenced by UserInterfaceCclRegister().

static int CclPresentMap ( lua_State *  l  )  [static]

Set basic map caracteristics.

Parameters:
l Lua state.

Definition at line 931 of file script_ui.cpp.

References CMapInfo::Description, CMap::Info, LuaCheckArgs, LuaToNumber(), LuaToString(), Map, CMapInfo::MapHeight, CMapInfo::MapUID, and CMapInfo::MapWidth.

Referenced by UserInterfaceCclRegister().

static int CclRightButtonAttacks ( lua_State *  l  )  [static]

Fighter right button attacks as default.

Parameters:
l Lua state.

Definition at line 458 of file script_ui.cpp.

References LuaCheckArgs, and RightButtonAttacks.

Referenced by UserInterfaceCclRegister().

static int CclRightButtonMoves ( lua_State *  l  )  [static]

Fighter right button moves as default.

Parameters:
l Lua state.

Definition at line 470 of file script_ui.cpp.

References LuaCheckArgs, and RightButtonAttacks.

Referenced by UserInterfaceCclRegister().

static int CclSetClickMissile ( lua_State *  l  )  [static]

Set which missile is used for right click

Parameters:
l Lua state.

Definition at line 98 of file script_ui.cpp.

References ClickMissile, and LuaError.

Referenced by UserInterfaceCclRegister().

static int CclSetDamageMissile ( lua_State *  l  )  [static]

Set which missile shows Damage

Parameters:
l Lua state.

Definition at line 119 of file script_ui.cpp.

References DamageMissile, and LuaError.

Referenced by UserInterfaceCclRegister().

static int CclSetGameCursor ( lua_State *  l  )  [static]

Set the current game cursor.

Parameters:
l Lua state.

Definition at line 401 of file script_ui.cpp.

References CursorByIdent(), GameCursor, LuaCheckArgs, and LuaToString().

Referenced by UserInterfaceCclRegister().

static int CclSetGroupKeys ( lua_State *  l  )  [static]

Set the keys which are use for grouping units, helpful for other keyboards

Parameters:
l Lua state.

Definition at line 919 of file script_ui.cpp.

References LuaCheckArgs, LuaToString(), and UiGroupKeys.

Referenced by UserInterfaceCclRegister().

static int CclSetMouseScrollSpeedControl ( lua_State *  l  )  [static]

Set speed of ctrl-middle-mouse scroll

Parameters:
l Lua state.

Definition at line 86 of file script_ui.cpp.

References LuaCheckArgs, LuaToNumber(), CUserInterface::MouseScrollSpeedControl, and UI.

Referenced by UserInterfaceCclRegister().

static int CclSetMouseScrollSpeedDefault ( lua_State *  l  )  [static]

Set speed of middle-mouse scroll

Parameters:
l Lua state.

Definition at line 74 of file script_ui.cpp.

References LuaCheckArgs, LuaToNumber(), CUserInterface::MouseScrollSpeedDefault, and UI.

Referenced by UserInterfaceCclRegister().

static int CclSetTitleScreens ( lua_State *  l  )  [static]

static int CclSetVideoFullScreen ( lua_State *  l  )  [static]

Set the video fullscreen mode.

Parameters:
l Lua state.

Definition at line 171 of file script_ui.cpp.

References CclInConfigFile, CVideo::FullScreen, LuaCheckArgs, LuaToBoolean(), Video, and VideoForceFullScreen.

Referenced by UserInterfaceCclRegister().

static int CclSetVideoResolution ( lua_State *  l  )  [static]

Set the video resolution.

Parameters:
l Lua state.

Definition at line 140 of file script_ui.cpp.

References CclInConfigFile, CVideo::Height, LuaCheckArgs, LuaToNumber(), Video, and CVideo::Width.

Referenced by UserInterfaceCclRegister().

ButtonStyle* FindButtonStyle ( const std::string &  style  ) 

Called if the mouse is moved in Normal interface state.

Find a button style

Parameters:
style Name of the style to find.
Returns:
Button style, NULL if not found.

Definition at line 484 of file script_ui.cpp.

References ButtonStyleHash.

Referenced by tolua_stratagus_FindButtonStyle00().

static void ParseButtonStyleProperties ( lua_State *  l,
ButtonStyleProperties p 
) [static]

void SelectedUnitChanged ( void   ) 

Called whenever the selected unit was updated.

The selected unit has been altered.

Definition at line 897 of file script_ui.cpp.

References CUserInterface::ButtonPanel, UI, and CButtonPanel::Update().

Referenced by CUnit::ClearAction(), CommandCancelTraining(), EnterTransporter(), HandleActionBuilt(), HandleKeyModifiersDown(), HandleKeyModifiersUp(), HandleUnitAction(), and LeaveTransporter().

void SelectionChanged ( void   ) 

void UserInterfaceCclRegister ( void   ) 


Variable Documentation

std::map<std::string, ButtonStyle *> ButtonStyleHash

Definition at line 59 of file script_ui.cpp.

Referenced by CclDefineButtonStyle(), and FindButtonStyle().

std::string ClickMissile

FIXME:docu.

Missile to show when you click.

Definition at line 56 of file script_ui.cpp.

Referenced by CclSetClickMissile(), UIHandleButtonDown(), and UISelectStateButtonDown().

std::string DamageMissile

FIXME:docu.

Missile to show damage caused.

Definition at line 57 of file script_ui.cpp.

Referenced by CclSetDamageMissile(), and HitUnit().

int HandleCount = 1 [static]

Lua handler count.

Definition at line 61 of file script_ui.cpp.

Referenced by AddHandler().


Generated on Sat Feb 21 00:28:19 2009 for Bos Wars by  doxygen 1.5.6