____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#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) |
| ButtonStyle * | FindButtonStyle (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 |
Definition in file script_ui.cpp.
| 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 | |||
| ) |
| static int CclAddMessage | ( | lua_State * | l | ) | [static] |
Add a new message.
| 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] |
Define a button.
| l | Lua state. |
Definition at line 731 of file script_ui.cpp.
References _C_, ButtonAction::Action, AddButton(), ButtonAction::Allowed, ButtonAction::AllowStr, ButtonAttack, ButtonAttackGround, ButtonBuild, ButtonButton, ButtonCancel, ButtonCancelBuild, ButtonCancelTrain, ButtonCheckAttack(), ButtonCheckFalse(), ButtonCheckNetwork(), ButtonCheckNoNetwork(), ButtonCheckNoWork(), ButtonCheckTrue(), ButtonCheckUnitsAnd(), ButtonCheckUnitsOr(), ButtonHarvest, ButtonMove, ButtonPatrol, ButtonRepair, ButtonSpellCast, ButtonStandGround, ButtonStop, ButtonTrain, ButtonUnload, ButtonAction::Hint, ButtonAction::Icon, ButtonAction::Level, LuaCheckArgs, LuaError, LuaToNumber(), LuaToString(), IconConfig::Name, ButtonAction::Pos, sprintf_s(), ButtonAction::UnitMask, and ButtonAction::ValueStr.
Referenced by UserInterfaceCclRegister().
| static int CclDefineButtonStyle | ( | lua_State * | l | ) | [static] |
Define a button style
| l | Lua state. |
Definition at line 593 of file script_ui.cpp.
References _C_, ButtonStyleHash, ButtonStyle::Clicked, ButtonStyle::Default, ButtonStyle::Font, CFont::Get(), ButtonStyle::Height, ButtonStyle::Hover, LuaCheckArgs, LuaError, LuaToNumber(), LuaToString(), ParseButtonStyleProperties(), ButtonStyleProperties::TextAlign, ButtonStyle::TextAlign, TextAlignCenter, TextAlignLeft, TextAlignRight, TextAlignUndefined, ButtonStyle::TextNormalColor, ButtonStyle::TextReverseColor, ButtonStyle::TextX, ButtonStyleProperties::TextX, ButtonStyleProperties::TextY, ButtonStyle::TextY, and ButtonStyle::Width.
Referenced by UserInterfaceCclRegister().
| static int CclDefineCursor | ( | lua_State * | l | ) | [static] |
Define a cursor.
| 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
| 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] |
Define the viewports.
| l | Lua state. |
Definition at line 413 of file script_ui.cpp.
References _C_, int(), LuaError, LuaToNumber(), LuaToString(), CViewport::MapX, CViewport::MapY, CUserInterface::NumViewports, UI, CViewport::Unit, UnitSlots, CUserInterface::ViewportMode, and CUserInterface::Viewports.
Referenced by UserInterfaceCclRegister().
| static int CclGetVideoFullScreen | ( | lua_State * | l | ) | [static] |
Get the video fullscreen mode.
| 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.
| 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.
| 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.
| 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.
| 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
| 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
| 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.
| 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
| 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
| 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
| 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] |
Default title screens.
| l | Lua state. |
Definition at line 200 of file script_ui.cpp.
References _C_, TitleScreen::File, TitleScreenLabel::Flags, TitleScreenLabel::Font, CFont::Get(), TitleScreen::Iterations, Labels, TitleScreen::Labels, LuaError, LuaToBoolean(), LuaToNumber(), LuaToString(), TitleScreen::Music, TitleScreen::StretchImage, TitleScreenLabel::Text, TitleScreen::Timeout, TitleFlagCenter, TitleScreens, TitleScreenLabel::Xofs, and TitleScreenLabel::Yofs.
Referenced by UserInterfaceCclRegister().
| static int CclSetVideoFullScreen | ( | lua_State * | l | ) | [static] |
Set the video fullscreen mode.
| 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.
| 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
| style | Name of the style to find. |
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] |
Parse button style properties
| l | Lua state. | |
| p | Properties to fill in. |
Definition at line 495 of file script_ui.cpp.
References _C_, ButtonStyleProperties::BorderColorRGB, ButtonStyleProperties::BorderSize, ButtonStyleProperties::Frame, LuaError, LuaToNumber(), LuaToString(), CGraphic::New(), ButtonStyleProperties::Sprite, ButtonStyleProperties::TextAlign, TextAlignCenter, TextAlignLeft, TextAlignRight, ButtonStyleProperties::TextNormalColor, ButtonStyleProperties::TextReverseColor, ButtonStyleProperties::TextX, and ButtonStyleProperties::TextY.
Referenced by CclDefineButtonStyle().
| 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 | ) |
< Called whenever the units selection is altered
Run the set-selection-changed-hook.
Definition at line 881 of file script_ui.cpp.
References CUserInterface::ButtonPanel, CStatusLine::Clear(), ClearCosts(), CurrentButtonLevel, CursorConfig::Cursor, CursorBuilding, CursorState, CursorStatePoint, GameCursor, CUserInterface::Point, CUserInterface::StatusLine, UI, and CButtonPanel::Update().
Referenced by DoActionMove(), DoSelectionButtons(), LoadGame(), CUnit::Remove(), UiAddGroupToSelection(), UiFindIdleWorker(), UIHandleButtonUp(), UiSelectGroup(), and UiUnselectAll().
| void UserInterfaceCclRegister | ( | void | ) |
Find a button style.
Register CCL features for UI.
Definition at line 960 of file script_ui.cpp.
References CclAddMessage(), CclDefineButton(), CclDefineButtonStyle(), CclDefineCursor(), CclDefineMapSetup(), CclDefineViewports(), CclGetVideoFullScreen(), CclGetVideoResolution(), CclPresentMap(), CclRightButtonAttacks(), CclRightButtonMoves(), CclSetClickMissile(), CclSetDamageMissile(), CclSetGameCursor(), CclSetGroupKeys(), CclSetMouseScrollSpeedControl(), CclSetMouseScrollSpeedDefault(), CclSetTitleScreens(), CclSetVideoFullScreen(), CclSetVideoResolution(), and Lua.
Referenced by InitCcl().
| 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] |
Definition at line 63 of file script_ui.cpp.
Referenced by DoRightButton(), CViewport::Draw(), DrawInformations(), SendCommand(), tolua_get_Preference(), tolua_set_Preference(), and UIHandleButtonDown().
1.5.6