____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 "video.h"
#include "sound.h"
#include "sound_server.h"
#include "unittype.h"
#include "player.h"
#include "unit.h"
#include "interface.h"
#include "cursor.h"
#include "ui.h"
#include "menus.h"
#include "script.h"
#include "map.h"
#include "minimap.h"
#include "network.h"
#include "font.h"
#include "results.h"
#include "iolib.h"
#include "replay.h"
#include "ai.h"
#include "widgets.h"
#include "particle.h"
Go to the source code of this file.
Defines | |
| #define | SCROLL_UP 15 |
| < Scrolling area (<= 15 y) | |
| #define | SCROLL_DOWN (Video.Height - 16) |
| Scrolling area (<= 15 y). | |
| #define | SCROLL_LEFT 15 |
| Scrolling area (>= VideoWidth - 16 x). | |
| #define | SCROLL_RIGHT (Video.Width - 16) |
Enumerations | |
| enum | { InitialMouseState, ClickedMouseState } |
Functions | |
| static void | ShowInput (void) |
| static void | UiBeginInput (void) |
| static void | UiUnselectAll (void) |
| static void | UiCenterOnGroup (unsigned group) |
| static void | UiSelectGroup (unsigned group) |
| static void | UiAddGroupToSelection (unsigned group) |
| static void | UiDefineGroup (unsigned group) |
| static void | UiAddToGroup (unsigned group) |
| static void | UiToggleSound (void) |
| static void | UiToggleMusic (void) |
| void | UiTogglePause (void) |
| Handle cheats. | |
| static void | UiToggleBigMap (void) |
| static void | UiIncreaseGameSpeed (void) |
| static void | UiDecreaseGameSpeed (void) |
| static void | UiCenterOnSelected (void) |
| static void | UiSaveMapPosition (unsigned position) |
| static void | UiRecallMapPosition (unsigned position) |
| static void | UiToggleTerrain (void) |
| static void | UiFindIdleWorker (void) |
| static void | UiToggleGrabMouse (void) |
| static void | UiTrackUnit (void) |
| bool | HandleCommandKey (int key) |
| static bool | CommandKey (int key) |
| int | HandleCheats (const std::string &input) |
| Call the lua function HandleCommandKey. | |
| static int | InputKey (int key) |
| static void | Screenshot (void) |
| int | HandleKeyModifiersDown (unsigned key, unsigned keychar) |
| Update KeyModifiers if a key is released. | |
| int | HandleKeyModifiersUp (unsigned key, unsigned keychar) |
| Called if a key is pressed. | |
| static bool | IsKeyPad (unsigned key, unsigned *kp) |
| void | HandleKeyDown (unsigned key, unsigned keychar) |
| Called when a key is released. | |
| void | HandleKeyUp (unsigned key, unsigned keychar) |
| Called when a key is repeated. | |
| void | HandleKeyRepeat (unsigned key, unsigned keychar) |
| int | HandleMouseScrollArea (int x, int y) |
| void | HandleCursorMove (int *x, int *y) |
| Called if the mouse is moved. | |
| void | HandleMouseMove (int x, int y) |
| Called if the mouse exits the game window (only for some videomodes). | |
| void | HandleButtonDown (unsigned button) |
| < Called if any mouse button is pressed down | |
| void | HandleButtonUp (unsigned button) |
| Keep coordinates in window and update cursor position. | |
| void | InputMouseButtonPress (const EventCallback *callbacks, unsigned ticks, unsigned button) |
| void | InputMouseButtonRelease (const EventCallback *callbacks, unsigned ticks, unsigned button) |
| void | InputMouseMove (const EventCallback *callbacks, unsigned ticks, int x, int y) |
| void | InputMouseExit (const EventCallback *callbacks, unsigned ticks) |
| void | InputMouseTimeout (const EventCallback *callbacks, unsigned ticks) |
| void | InputKeyButtonPress (const EventCallback *callbacks, unsigned ticks, unsigned ikey, unsigned ikeychar) |
| void | InputKeyButtonRelease (const EventCallback *callbacks, unsigned ticks, unsigned ikey, unsigned ikeychar) |
| void | InputKeyTimeout (const EventCallback *callbacks, unsigned ticks) |
| int | GetDoubleClickDelay (void) |
| Set double click delay. | |
| void | SetDoubleClickDelay (int delay) |
| Get hold click delay. | |
| int | GetHoldClickDelay (void) |
| Set hold click delay. | |
| void | SetHoldClickDelay (int delay) |
| Toggle pause mode. | |
Variables | |
| static int | SavedMapPositionX [3] |
| Saved map position X. | |
| static int | SavedMapPositionY [3] |
| Saved map position Y. | |
| static char | Input [80] |
| line input for messages/long commands | |
| static int | InputIndex |
| current index into input | |
| static char | InputStatusLine [99] |
| Last input status line. | |
| std::string | DefaultGroupKeys = "0123456789`" |
| Default group keys. | |
| std::string | UiGroupKeys = DefaultGroupKeys |
| Up to 11 keys, last unselect. Default for qwerty. | |
| bool | GameRunning |
| Current running state. | |
| bool | GamePaused |
| Current pause state. | |
| bool | GameObserve |
| Observe mode. | |
| char | SkipGameCycle |
| Skip the next game cycle. | |
| char | BigMapMode |
| Show only the map. | |
| enum _iface_state_ | InterfaceState |
| Current interface state. | |
| bool | GodMode |
| Invincibility cheat. | |
| enum _key_state_ | KeyState |
| current key state | |
| int | DoubleClickDelay = 300 |
| Time to detect double clicks. | |
| int | HoldClickDelay = 1000 |
| Time to detect hold clicks. | |
| static enum { ... } | MouseState |
| Current state of mouse. | |
| static int | MouseX |
| Last mouse X position. | |
| static int | MouseY |
| Last mouse Y position. | |
| static unsigned | LastMouseButton |
| last mouse button handled | |
| static unsigned | StartMouseTicks |
| Ticks of first click. | |
| static unsigned | LastMouseTicks |
| Ticks of last mouse event. | |
| static int | HoldKeyDelay = 250 |
| Time to detect hold key. | |
| static int | HoldKeyAdditionalDelay = 50 |
| Time to detect additional hold key. | |
| static unsigned | LastIKey |
| last key handled | |
| static unsigned | LastIKeyChar |
| last keychar handled | |
| static unsigned | LastKeyTicks |
| Ticks of last key. | |
| static unsigned | DoubleKey |
| last key pressed | |
Definition in file interface.cpp.
| #define SCROLL_DOWN (Video.Height - 16) |
Scrolling area (<= 15 y).
Definition at line 70 of file interface.cpp.
Referenced by HandleMouseScrollArea().
| #define SCROLL_LEFT 15 |
Scrolling area (>= VideoWidth - 16 x).
Definition at line 72 of file interface.cpp.
Referenced by HandleMouseScrollArea().
| #define SCROLL_RIGHT (Video.Width - 16) |
| #define SCROLL_UP 15 |
< Scrolling area (<= 15 y)
Scrolling area (>= VideoHeight - 16 y)
Definition at line 68 of file interface.cpp.
Referenced by HandleMouseScrollArea().
| anonymous enum |
Definition at line 1209 of file interface.cpp.
| static bool CommandKey | ( | int | key | ) | [static] |
Handle keys in command mode.
| key | Key scancode. |
Definition at line 505 of file interface.cpp.
References CenterOnMessage(), CycleViewportMode(), HandleCommandKey(), KeyModifiers, KeyScrollState, ModifierAlt, ModifierControl, ModifierDoublePress, ModifierShift, SavePreferences(), ScrollDown, ScrollLeft, ScrollRight, ScrollUp, ToggleFullScreen(), UiAddGroupToSelection(), UiAddToGroup(), UiBeginInput(), UiCenterOnGroup(), UiCenterOnSelected(), UiDecreaseGameSpeed(), UiDefineGroup(), UiFindIdleWorker(), UiGroupKeys, UiIncreaseGameSpeed(), UiRecallMapPosition(), UiSaveMapPosition(), UiSelectGroup(), UiToggleBigMap(), UiToggleGrabMouse(), UiToggleMusic(), UiTogglePause(), UiToggleSound(), UiToggleTerrain(), UiTrackUnit(), and UiUnselectAll().
Referenced by HandleKeyDown().
| int GetDoubleClickDelay | ( | void | ) |
Set double click delay.
Get double click delay
Definition at line 1418 of file interface.cpp.
Referenced by tolua_stratagus_GetDoubleClickDelay00().
| int GetHoldClickDelay | ( | void | ) |
Set hold click delay.
Get hold click delay
Definition at line 1436 of file interface.cpp.
Referenced by tolua_stratagus_GetHoldClickDelay00().
| 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) |
Definition at line 1184 of file interface.cpp.
References UIHandleButtonDown().
Referenced by InitGameCallbacks().
| void HandleButtonUp | ( | unsigned | button | ) |
Keep coordinates in window and update cursor position.
Called if mouse button released.
| button | Mouse button number (0 left, 1 middle, 2 right) |
Definition at line 1197 of file interface.cpp.
References UIHandleButtonUp().
Referenced by InitGameCallbacks().
| int HandleCheats | ( | const std::string & | input | ) |
Call the lua function HandleCommandKey.
Handle cheats
Definition at line 693 of file interface.cpp.
References CPlayer::Ai, CPlayer::AiEnabled, AiInit(), DebugPrint, Lua, LuaCall(), LuaToBoolean(), PlayerComputer, PlayerPerson, SetMessage(), ThisPlayer, and CPlayer::Type.
Referenced by DoNextReplay(), and InputKey().
| bool HandleCommandKey | ( | int | key | ) |
Call the lua function HandleCommandKey
Definition at line 472 of file interface.cpp.
References DebugPrint, KeyModifiers, Lua, LuaCall(), LuaError, LuaToBoolean(), ModifierAlt, ModifierControl, ModifierShift, and SdlKey2Str().
Referenced by CommandKey(), EditorCallbackKeyDown(), and PatchEditorCallbackKeyDown().
| void HandleCursorMove | ( | int * | x, | |
| int * | y | |||
| ) |
Called if the mouse is moved.
Keep coordinates in window and update cursor position
| x | screen pixel X position. | |
| y | screen pixel Y position. |
Definition at line 1147 of file interface.cpp.
References CursorX, CursorY, CVideo::Height, Video, and CVideo::Width.
Referenced by EditorCallbackMouse(), HandleMouseMove(), MenuHandleMouseMove(), and PatchEditorCallbackMouse().
| void HandleKeyDown | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) |
Called when a key is released.
Handle key down.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 1016 of file interface.cpp.
References CUserInterface::ButtonPanel, CommandKey(), CButtonPanel::DoKey(), GameObserve, GamePaused, HandleKeyModifiersDown(), InputKey(), IsKeyPad(), KeyModifiers, KeyState, KeyStateInput, ModifierAlt, ModifierControl, ModifierSuper, and UI.
Referenced by InitGameCallbacks().
| int HandleKeyModifiersDown | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) |
Update KeyModifiers if a key is released.
Update KeyModifiers if a key is pressed.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 907 of file interface.cpp.
References _, GameRunning, IfaceStateNormal, InterfaceState, KeyModifiers, ModifierAlt, ModifierControl, ModifierShift, ModifierSuper, Screenshot(), SelectedUnitChanged(), and SetMessage().
Referenced by EditorCallbackKeyDown(), HandleKeyDown(), MenuHandleKeyDown(), MenuHandleKeyRepeat(), and PatchEditorCallbackKeyDown().
| int HandleKeyModifiersUp | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) |
Called if a key is pressed.
Update KeyModifiers if a key is released.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 953 of file interface.cpp.
References IfaceStateNormal, InterfaceState, KeyModifiers, ModifierAlt, ModifierControl, ModifierShift, ModifierSuper, and SelectedUnitChanged().
Referenced by EditorCallbackKeyUp(), HandleKeyUp(), MenuHandleKeyUp(), and PatchEditorCallbackKeyUp().
| void HandleKeyRepeat | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) |
Handle key up.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 1082 of file interface.cpp.
References InputKey(), KeyState, and KeyStateInput.
Referenced by InitGameCallbacks().
| void HandleKeyUp | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) |
Called when a key is repeated.
Handle key up.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 1048 of file interface.cpp.
References HandleKeyModifiersUp(), KeyScrollState, ScrollDown, ScrollLeft, ScrollRight, and ScrollUp.
Referenced by InitGameCallbacks().
| void HandleMouseMove | ( | int | x, | |
| int | y | |||
| ) |
Called if the mouse exits the game window (only for some videomodes).
Handle movement of the cursor.
| x | screen pixel X position. | |
| y | screen pixel Y position. |
Definition at line 1173 of file interface.cpp.
References HandleCursorMove(), and UIHandleMouseMove().
Referenced by DoScrollArea(), and InitGameCallbacks().
| int HandleMouseScrollArea | ( | int | x, | |
| int | y | |||
| ) |
Handle the mouse in scroll area
| x | Screen X position. | |
| y | Screen Y position. |
Definition at line 1097 of file interface.cpp.
References CUserInterface::ArrowE, CUserInterface::ArrowN, CUserInterface::ArrowNE, CUserInterface::ArrowNW, CUserInterface::ArrowS, CUserInterface::ArrowSE, CUserInterface::ArrowSW, CUserInterface::ArrowW, CursorConfig::Cursor, CursorOn, CursorOnScrollDown, CursorOnScrollLeft, CursorOnScrollLeftDown, CursorOnScrollLeftUp, CursorOnScrollRight, CursorOnScrollRightDown, CursorOnScrollRightUp, CursorOnScrollUp, GameCursor, MouseScrollState, SCROLL_DOWN, SCROLL_LEFT, SCROLL_RIGHT, SCROLL_UP, ScrollDown, ScrollLeft, ScrollLeftDown, ScrollLeftUp, ScrollRight, ScrollRightDown, ScrollRightUp, ScrollUp, and UI.
Referenced by EditorCallbackMouse(), HandleMouseOn(), and PatchEditorCallbackMouse().
| static int InputKey | ( | int | key | ) | [static] |
Handle keys in input mode.
| key | Key scancode. |
Definition at line 746 of file interface.cpp.
References CclCommand(), CStatusLine::Clear(), CommandLog(), FastForwardCycle, FlushCommands, GameObserve, GamePaused, HandleCheats(), CPlayer::Index, Input, InputIndex, IsNetworkGame, KeyState, KeyStateCommand, CPlayer::Name, NetworkChatMessage(), NoUnitP, PlayerColorNames, PlayerMax, PlayerPerson, Players, ReplayGameType, ReplayNone, ShowInput(), sprintf_s(), CUserInterface::StatusLine, strcat_s(), strcpy_s(), ThisPlayer, gcn::Key::toString(), UI, and UTF8GetPrev().
Referenced by HandleKeyDown(), and HandleKeyRepeat().
| void InputKeyButtonPress | ( | const EventCallback * | callbacks, | |
| unsigned | ticks, | |||
| unsigned | ikey, | |||
| unsigned | ikeychar | |||
| ) |
Handle keyboard key press.
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system | |
| ikey | Key scancode. | |
| ikeychar | Character code. |
Definition at line 1368 of file interface.cpp.
References KeyModifiers, _event_callback_::KeyPressed, and ModifierDoublePress.
| void InputKeyButtonRelease | ( | const EventCallback * | callbacks, | |
| unsigned | ticks, | |||
| unsigned | ikey, | |||
| unsigned | ikeychar | |||
| ) |
Handle keyboard key release.
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system | |
| ikey | Key scancode. | |
| ikeychar | Character code. |
Definition at line 1391 of file interface.cpp.
References _event_callback_::KeyReleased.
| void InputKeyTimeout | ( | const EventCallback * | callbacks, | |
| unsigned | ticks | |||
| ) |
Called each frame to handle keyboard timeouts.
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system |
Definition at line 1407 of file interface.cpp.
References _event_callback_::KeyRepeated.
| void InputMouseButtonPress | ( | const EventCallback * | callbacks, | |
| unsigned | ticks, | |||
| unsigned | button | |||
| ) |
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. |
Definition at line 1231 of file interface.cpp.
References _event_callback_::ButtonPressed, ClickedMouseState, InitialMouseState, MouseButtons, MouseDoubleShift, and MouseState.
| void InputMouseButtonRelease | ( | const EventCallback * | callbacks, | |
| unsigned | ticks, | |||
| unsigned | button | |||
| ) |
Called if any mouse button is released up
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system | |
| button | Mouse button released. |
Definition at line 1264 of file interface.cpp.
References _event_callback_::ButtonReleased, ClickedMouseState, InitialMouseState, MouseButtons, MouseDoubleShift, MouseDragShift, MouseHoldShift, and MouseState.
| void InputMouseExit | ( | const EventCallback * | callbacks, | |
| unsigned | ticks | |||
| ) |
Called if the mouse exits the game window (when supported by videomode)
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system |
Definition at line 1323 of file interface.cpp.
References _event_callback_::MouseExit.
| void InputMouseMove | ( | const EventCallback * | callbacks, | |
| unsigned | ticks, | |||
| int | x, | |||
| int | y | |||
| ) |
Called if the mouse is moved
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system | |
| x | X movement | |
| y | Y movement |
Definition at line 1303 of file interface.cpp.
References InitialMouseState, _event_callback_::MouseMoved, and MouseState.
| void InputMouseTimeout | ( | const EventCallback * | callbacks, | |
| unsigned | ticks | |||
| ) |
Called each frame to handle mouse timeouts.
| callbacks | Callback structure for events. | |
| ticks | Denotes time-stamp of video-system |
Definition at line 1336 of file interface.cpp.
References _event_callback_::ButtonPressed, InitialMouseState, MouseButtons, MouseHoldShift, and MouseState.
| static bool IsKeyPad | ( | unsigned | key, | |
| unsigned * | kp | |||
| ) | [static] |
Check if a key is from the keypad and convert to ascii
Definition at line 985 of file interface.cpp.
Referenced by HandleKeyDown().
| static void Screenshot | ( | void | ) | [static] |
Save a screenshot.
Definition at line 882 of file interface.cpp.
References CL_OPEN_READ, CFile::close(), CFile::open(), SaveScreenshotPNG(), and sprintf_s().
Referenced by HandleKeyModifiersDown().
| void SetDoubleClickDelay | ( | int | delay | ) |
Get hold click delay.
Set double click delay
| delay | Double click delay |
Definition at line 1428 of file interface.cpp.
Referenced by tolua_stratagus_SetDoubleClickDelay00().
| void SetHoldClickDelay | ( | int | delay | ) |
Toggle pause mode.
Set hold click delay
| delay | Hold click delay |
Definition at line 1446 of file interface.cpp.
Referenced by tolua_stratagus_SetHoldClickDelay00().
| static void ShowInput | ( | void | ) | [static] |
Show input.
Definition at line 103 of file interface.cpp.
References _, CStatusLine::Clear(), CStatusLine::Font, Input, InputStatusLine, KeyState, KeyStateCommand, KeyStateInput, CStatusLine::Set(), sprintf_s(), CUserInterface::StatusLine, UI, CStatusLine::Width, and CFont::Width().
Referenced by InputKey(), and UiBeginInput().
| static void UiAddGroupToSelection | ( | unsigned | group | ) | [static] |
Add group to current selection.
| group | Group number to add. |
Definition at line 191 of file interface.cpp.
References GetNumberUnitsOfGroup(), GetUnitsOfGroup(), NumUnits, Selected, SelectionChanged(), and SelectUnit().
Referenced by CommandKey().
| static void UiAddToGroup | ( | unsigned | group | ) | [static] |
Add to group. The current selected units are added to the group.
| group | Group number to be expanded. |
Definition at line 236 of file interface.cpp.
References AddToGroup(), NumSelected, and Selected.
Referenced by CommandKey().
| static void UiBeginInput | ( | void | ) | [static] |
Begin input.
Definition at line 122 of file interface.cpp.
References ClearCosts(), Input, InputIndex, KeyState, KeyStateInput, and ShowInput().
Referenced by CommandKey().
| static void UiCenterOnGroup | ( | unsigned | group | ) | [static] |
Center on group.
| group | Group number to center on. |
Definition at line 153 of file interface.cpp.
References CViewport::Center(), GetNumberUnitsOfGroup(), GetUnitsOfGroup(), CUserInterface::SelectedViewport, TileSizeX, TileSizeY, UI, CUnit::X, CUnit::Y, and y.
Referenced by CommandKey().
| static void UiCenterOnSelected | ( | void | ) | [static] |
Center on the selected units.
Definition at line 376 of file interface.cpp.
References CViewport::Center(), NumSelected, Selected, CUserInterface::SelectedViewport, TileSizeX, TileSizeY, UI, CUnit::X, CUnit::Y, and y.
Referenced by CommandKey().
| static void UiDecreaseGameSpeed | ( | void | ) | [static] |
Decrease game speed.
Definition at line 354 of file interface.cpp.
References _, FastForwardCycle, GameCycle, CStatusLine::Set(), SetVideoSync(), CUserInterface::StatusLine, UI, and VideoSyncSpeed.
Referenced by CommandKey().
| static void UiDefineGroup | ( | unsigned | group | ) | [static] |
Define a group. The current selected units become a new group.
| group | Group number to create. |
Definition at line 226 of file interface.cpp.
References NumSelected, Selected, and SetGroup().
Referenced by CommandKey().
| static void UiFindIdleWorker | ( | void | ) | [static] |
Find the next idle worker, select it, and center on it
Definition at line 431 of file interface.cpp.
References CViewport::Center(), CStatusLine::Clear(), ClearCosts(), CurrentButtonLevel, FindIdleWorker(), NoUnitP, PlayUnitSound(), Selected, CUserInterface::SelectedViewport, SelectionChanged(), SelectSingleUnit(), CUserInterface::StatusLine, ThisPlayer, TileSizeX, TileSizeY, UI, VoiceSelected, CUnit::X, and CUnit::Y.
Referenced by CommandKey().
| static void UiIncreaseGameSpeed | ( | void | ) | [static] |
Increase game speed.
Definition at line 341 of file interface.cpp.
References _, FastForwardCycle, GameCycle, CStatusLine::Set(), SetVideoSync(), CUserInterface::StatusLine, UI, and VideoSyncSpeed.
Referenced by CommandKey().
| static void UiRecallMapPosition | ( | unsigned | position | ) | [static] |
Recall map position.
| position | Map position slot. |
Definition at line 409 of file interface.cpp.
References SavedMapPositionX, SavedMapPositionY, CUserInterface::SelectedViewport, CViewport::Set(), TileSizeX, TileSizeY, and UI.
Referenced by CommandKey().
| static void UiSaveMapPosition | ( | unsigned | position | ) | [static] |
Save current map position.
| position | Map position slot. |
Definition at line 398 of file interface.cpp.
References CViewport::MapX, CViewport::MapY, SavedMapPositionX, SavedMapPositionY, CUserInterface::SelectedViewport, and UI.
Referenced by CommandKey().
| static void UiSelectGroup | ( | unsigned | group | ) | [static] |
Select group.
| group | Group number to select. |
Definition at line 180 of file interface.cpp.
References SelectGroup(), and SelectionChanged().
Referenced by CommandKey().
| static void UiToggleBigMap | ( | void | ) | [static] |
Toggle big map mode.
Definition at line 304 of file interface.cpp.
References _, BigMapMode, CMapArea::EndX, CMapArea::EndY, CVideo::Height, CUserInterface::MapArea, CStatusLine::Set(), SetViewportMode(), CUserInterface::StatusLine, UI, Video, CUserInterface::ViewportMode, CVideo::Width, CMapArea::X, and CMapArea::Y.
Referenced by CommandKey().
| static void UiToggleGrabMouse | ( | void | ) | [static] |
Toggle grab mouse on/off.
Definition at line 450 of file interface.cpp.
References _, _C_, DebugPrint, KeyModifiers, CStatusLine::Set(), CUserInterface::StatusLine, ToggleGrabMouse(), and UI.
Referenced by CommandKey().
| static void UiToggleMusic | ( | void | ) | [static] |
Toggle music on / off.
Definition at line 269 of file interface.cpp.
References _, GetMusicVolume(), CStatusLine::Set(), SetMusicVolume(), SoundEnabled(), CUserInterface::StatusLine, and UI.
Referenced by CommandKey().
| void UiTogglePause | ( | void | ) |
Handle cheats.
Toggle pause on / off.
Definition at line 287 of file interface.cpp.
References _, GamePaused, IsNetworkGame, CStatusLine::Set(), CUserInterface::StatusLine, and UI.
Referenced by CommandKey(), and SdlDoEvent().
| static void UiToggleSound | ( | void | ) | [static] |
Toggle sound on / off.
Definition at line 244 of file interface.cpp.
References _, CheckMusicFinished(), IsEffectsEnabled(), CStatusLine::Set(), SetEffectsEnabled(), SetMusicEnabled(), SoundEnabled(), CUserInterface::StatusLine, and UI.
Referenced by CommandKey().
| static void UiToggleTerrain | ( | void | ) | [static] |
Toggle terrain display on/off.
Definition at line 418 of file interface.cpp.
References _, CUserInterface::Minimap, CStatusLine::Set(), CUserInterface::StatusLine, UI, and CMinimap::WithTerrain.
Referenced by CommandKey().
| static void UiTrackUnit | ( | void | ) | [static] |
Track unit, the viewport follows the unit.
Definition at line 460 of file interface.cpp.
References Selected, CUserInterface::SelectedViewport, UI, and CViewport::Unit.
Referenced by CommandKey().
| static void UiUnselectAll | ( | void | ) | [static] |
Unselect all currently selected units.
Definition at line 138 of file interface.cpp.
References NetworkSendSelection(), SelectionChanged(), and UnSelectAll().
Referenced by CommandKey().
| char BigMapMode |
Show only the map.
pressed mouse buttons (normal,double,dragged,long)
Definition at line 91 of file interface.cpp.
Referenced by HandleMouseOn(), UiToggleBigMap(), and UpdateDisplay().
| std::string DefaultGroupKeys = "0123456789`" |
| int DoubleClickDelay = 300 |
Time to detect double clicks.
Time to detect hold clicks.
Definition at line 1206 of file interface.cpp.
unsigned DoubleKey [static] |
| bool GameObserve |
Observe mode.
Flag telling not to advance to the next game cycle.
Definition at line 89 of file interface.cpp.
Referenced by CleanReplayLog(), DoSelectionButtons(), HandleKeyDown(), InputKey(), LoadReplay(), ReplayEachCycle(), tolua_get_GameObserve(), tolua_set_GameObserve(), UIHandleButtonDown(), and UISelectStateButtonDown().
| bool GamePaused |
Current pause state.
Flag telling if the game is in observe mode.
Definition at line 88 of file interface.cpp.
Referenced by CreateGame(), DoSelectionButtons(), GameMainLoop(), GetGamePaused(), HandleKeyDown(), InputKey(), SdlDoEvent(), SetGamePaused(), MenuScreen::stop(), StopGame(), TriggersEachCycle(), UIHandleButtonDown(), UIHandleButtonUp(), UISelectStateButtonDown(), and UiTogglePause().
| bool GameRunning |
Current running state.
< Flag telling if the game is running
Definition at line 87 of file interface.cpp.
Referenced by DrawCursor(), DrawGuichanWidgets(), GameMainLoop(), HandleKeyModifiersDown(), HideCursor(), NetworkProcessServerRequest(), SelectUnit(), SelectUnitsByType(), MenuScreen::stop(), StopGame(), tolua_get_GameRunning(), tolua_set_GameRunning(), UpdateDisplay(), and WaitEventsOneFrame().
| bool GodMode |
Invincibility cheat.
Whether the map is the only thing displayed or not.
Definition at line 93 of file interface.cpp.
Referenced by CclGetGodMode(), CclSetGodMode(), GameMainLoop(), HitUnit(), and SaveCcl().
| int HoldClickDelay = 1000 |
int HoldKeyAdditionalDelay = 50 [static] |
int HoldKeyDelay = 250 [static] |
char Input[80] [static] |
line input for messages/long commands
Definition at line 82 of file interface.cpp.
Referenced by InputKey(), ShowInput(), and UiBeginInput().
int InputIndex [static] |
current index into input
Definition at line 83 of file interface.cpp.
Referenced by InputKey(), and UiBeginInput().
char InputStatusLine[99] [static] |
Current interface state.
current scroll state of keyboard
Definition at line 92 of file interface.cpp.
Referenced by EditorMainLoop(), HandleKeyModifiersDown(), HandleKeyModifiersUp(), MenuLoop(), NetworkParseSetupEvent(), and StartMap().
| enum _key_state_ KeyState |
current key state
pointer to unit under the cursor
Definition at line 94 of file interface.cpp.
Referenced by CStatusLine::Clear(), CButtonPanel::Draw(), DrawPieMenu(), HandleKeyDown(), HandleKeyRepeat(), InputKey(), CStatusLine::Set(), ShowInput(), and UiBeginInput().
unsigned LastIKey [static] |
unsigned LastIKeyChar [static] |
unsigned LastKeyTicks [static] |
unsigned LastMouseButton [static] |
unsigned LastMouseTicks [static] |
enum { ... } MouseState [static] |
Current state of mouse.
Referenced by InputMouseButtonPress(), InputMouseButtonRelease(), InputMouseMove(), and InputMouseTimeout().
int MouseX [static] |
int MouseY [static] |
int SavedMapPositionX[3] [static] |
Saved map position X.
Definition at line 80 of file interface.cpp.
Referenced by UiRecallMapPosition(), and UiSaveMapPosition().
int SavedMapPositionY[3] [static] |
Saved map position Y.
Definition at line 81 of file interface.cpp.
Referenced by UiRecallMapPosition(), and UiSaveMapPosition().
| char SkipGameCycle |
Skip the next game cycle.
Invincibility cheat.
Definition at line 90 of file interface.cpp.
Referenced by GameMainLoop(), and WaitEventsOneFrame().
unsigned StartMouseTicks [static] |
| std::string UiGroupKeys = DefaultGroupKeys |
Up to 11 keys, last unselect. Default for qwerty.
Up to 11 keys used for group selection.
Definition at line 86 of file interface.cpp.
Referenced by CclSetGroupKeys(), and CommandKey().
1.5.6