____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 <ui.h>
Public Member Functions | |
| CUserInterface () | |
| ~CUserInterface () | |
| void | Load () |
Public Attributes | |
| bool | MouseScroll |
| Enable mouse scrolling. | |
| bool | KeyScroll |
| Middle-Mouse Scroll Speed (screenpixels per mousepixel). | |
| int | MouseScrollSpeedDefault |
| Middle-Mouse Scroll Speed with Control pressed. | |
| int | MouseScrollSpeedControl |
| int | MouseWarpX |
| Cursor warp X position. | |
| int | MouseWarpY |
| Cursor warp Y position. | |
| std::string | NormalFontColor |
| Color for normal text displayed. | |
| std::string | ReverseFontColor |
| Color for reverse text displayed. | |
| std::vector< CFiller > | Fillers |
| Filler graphics. | |
| CResourceInfo | Resources [MaxCosts] |
| Icon+Text of all resources. | |
| CInfoPanel | InfoPanel |
| Info panel. | |
| CUIButton * | SingleSelectedButton |
| Button for single selected unit. | |
| std::vector< CUIButton > | SelectedButtons |
| Selected buttons. | |
| CFont * | MaxSelectedFont |
| Font type to use. | |
| int | MaxSelectedTextX |
| position to place '+#' text | |
| int | MaxSelectedTextY |
| if > maximum units selected | |
| CUIButton * | SingleTrainingButton |
| Button for single training. | |
| std::string | SingleTrainingText |
| Text for single training. | |
| CFont * | SingleTrainingFont |
| Font for single traning. | |
| int | SingleTrainingTextX |
| X text position single training. | |
| int | SingleTrainingTextY |
| Y text position single training. | |
| std::vector< CUIButton > | TrainingButtons |
| Training buttons. | |
| std::string | TrainingText |
| Multiple Training Text. | |
| CFont * | TrainingFont |
| Multiple Training Font. | |
| int | TrainingTextX |
| Multiple Training X Text position. | |
| int | TrainingTextY |
| Multiple Training Y Text position. | |
| std::vector< CUIButton > | TransportingButtons |
| Button info for transporting. | |
| SDL_Color | CompletedBarColorRGB |
| color for completed bar | |
| Uint32 | CompletedBarColor |
| color for completed bar | |
| bool | CompletedBarShadow |
| should complete bar have shadow | |
| CButtonPanel | ButtonPanel |
| CPieMenu | PieMenu |
| ViewportModeType | ViewportMode |
| Current viewport mode. | |
| CViewport * | MouseViewport |
| Viewport containing mouse. | |
| CViewport * | SelectedViewport |
| Current selected active viewport. | |
| int | NumViewports |
| # Viewports currently used | |
| CViewport | Viewports [MAX_NUM_VIEWPORTS] |
| Parameters of all viewports. | |
| CMapArea | MapArea |
| geometry of the whole map area | |
| CFont * | MessageFont |
| Font used for messages. | |
| int | MessageScrollSpeed |
| Scroll speed in seconds for messages. | |
| CUIButton | MenuButton |
| menu button | |
| CUIButton | NetworkMenuButton |
| network menu button | |
| CUIButton | NetworkDiplomacyButton |
| network diplomacy button | |
| CMinimap | Minimap |
| minimap | |
| Uint32 | ViewportCursorColor |
| minimap cursor color | |
| CStatusLine | StatusLine |
| status line | |
| CUITimer | Timer |
| game timer | |
| int | Offset640X |
| Offset for 640x480 X position. | |
| int | Offset480Y |
| Offset for 640x480 Y position. | |
| CursorConfig | Point |
| General pointing cursor. | |
| CursorConfig | Glass |
| HourGlass, system is waiting. | |
| CursorConfig | Cross |
| Multi-select cursor. | |
| CursorConfig | YellowHair |
| Yellow action,attack cursor. | |
| CursorConfig | GreenHair |
| Green action,attack cursor. | |
| CursorConfig | RedHair |
| Red action,attack cursor. | |
| CursorConfig | Scroll |
| Cursor for scrolling map around. | |
| CursorConfig | ArrowE |
| Cursor pointing east. | |
| CursorConfig | ArrowNE |
| Cursor pointing north east. | |
| CursorConfig | ArrowN |
| Cursor pointing north. | |
| CursorConfig | ArrowNW |
| Cursor pointing north west. | |
| CursorConfig | ArrowW |
| Cursor pointing west. | |
| CursorConfig | ArrowSW |
| Cursor pointing south west. | |
| CursorConfig | ArrowS |
| Cursor pointing south. | |
| CursorConfig | ArrowSE |
| Cursor pointing south east. | |
| CGraphic * | VictoryBackgroundG |
| Victory background graphic. | |
| CGraphic * | DefeatBackgroundG |
| Defeat background graphic. | |
Definition at line 342 of file ui.h.
| CUserInterface::CUserInterface | ( | ) |
Definition at line 67 of file ui.cpp.
References ArrowE, ArrowN, ArrowNE, ArrowNW, ArrowS, ArrowSE, ArrowSW, ArrowW, CompletedBarColorRGB, Cross, Glass, GreenHair, CursorConfig::Name, NormalFontColor, Point, RedHair, ReverseFontColor, Scroll, and YellowHair.
| CUserInterface::~CUserInterface | ( | ) |
| void CUserInterface::Load | ( | void | ) |
Load the user interface graphics.
Definition at line 151 of file ui.cpp.
References ArrowE, ArrowN, ArrowNE, ArrowNW, ArrowS, ArrowSE, ArrowSW, ArrowW, ButtonPanel, Cross, Fillers, CPieMenu::G, CButtonPanel::G, CResourceInfo::G, Glass, GreenHair, int(), CursorConfig::Load(), CGraphic::Load(), MaxCosts, PieMenu, Point, RedHair, Resources, Scroll, CGraphic::UseDisplayFormat(), and YellowHair.
Referenced by CreateGame(), LoadModules(), and PreMenuSetup().
Enable mouse scrolling.
Definition at line 351 of file ui.h.
Referenced by EditorMainLoop(), GetMouseScroll(), and SetMouseScroll().
Middle-Mouse Scroll Speed (screenpixels per mousepixel).
Enable keyboard scrolling
Definition at line 352 of file ui.h.
Referenced by EditorMainLoop(), GetKeyScroll(), and SetKeyScroll().
Middle-Mouse Scroll Speed with Control pressed.
Definition at line 355 of file ui.h.
Referenced by CclSetMouseScrollSpeedDefault(), and MouseScrollMap().
Definition at line 356 of file ui.h.
Referenced by CclSetMouseScrollSpeedControl(), and MouseScrollMap().
Cursor warp X position.
Definition at line 358 of file ui.h.
Referenced by InitVideoSdl(), MouseScrollMap(), RestrictCursorToMinimap(), RestrictCursorToViewport(), SdlDoEvent(), and UIHandleMouseMove().
Cursor warp Y position.
Definition at line 359 of file ui.h.
Referenced by InitVideoSdl(), MouseScrollMap(), RestrictCursorToMinimap(), RestrictCursorToViewport(), SdlDoEvent(), and UIHandleMouseMove().
| std::string CUserInterface::NormalFontColor |
Color for normal text displayed.
Definition at line 361 of file ui.h.
Referenced by CreateGame(), CUserInterface(), and LoadModules().
| std::string CUserInterface::ReverseFontColor |
Color for reverse text displayed.
Definition at line 362 of file ui.h.
Referenced by CreateGame(), CUserInterface(), and LoadModules().
| std::vector<CFiller> CUserInterface::Fillers |
Filler graphics.
Definition at line 364 of file ui.h.
Referenced by CleanUserInterface(), EditorUpdateDisplay(), HandleMouseOn(), Load(), and UpdateDisplay().
| CResourceInfo CUserInterface::Resources[MaxCosts] |
Icon+Text of all resources.
Definition at line 366 of file ui.h.
Referenced by CleanUserInterface(), DrawCosts(), DrawPopup(), and Load().
Info panel.
Definition at line 368 of file ui.h.
Referenced by DrawEditorPanel(), DrawInfoPanelNoneSelected(), DrawPatchIcons(), DrawPlayers(), DrawUnitIcons(), DrawUnitInfo(), DrawUnitStats(), EditorCallbackMouse(), and UpdateDisplay().
Button for single selected unit.
Definition at line 370 of file ui.h.
Referenced by CleanUserInterface(), DrawEditorPanel(), DrawUnitInfo(), and HandleMouseOn().
| std::vector<CUIButton> CUserInterface::SelectedButtons |
Selected buttons.
Definition at line 372 of file ui.h.
Referenced by CleanUserInterface(), DrawInfoPanelMultipleSelected(), and HandleMouseOn().
Font type to use.
Definition at line 373 of file ui.h.
Referenced by DrawInfoPanelMultipleSelected().
position to place '+#' text
Definition at line 374 of file ui.h.
Referenced by DrawInfoPanelMultipleSelected().
if > maximum units selected
Definition at line 375 of file ui.h.
Referenced by DrawInfoPanelMultipleSelected().
Button for single training.
Definition at line 377 of file ui.h.
Referenced by CleanUserInterface(), DrawTrainingUnits(), and HandleMouseOn().
| std::string CUserInterface::SingleTrainingText |
Text for single training.
Definition at line 378 of file ui.h.
Referenced by CleanUserInterface(), and DrawTrainingUnits().
X text position single training.
Definition at line 380 of file ui.h.
Referenced by DrawTrainingUnits().
Y text position single training.
Definition at line 381 of file ui.h.
Referenced by DrawTrainingUnits().
| std::vector<CUIButton> CUserInterface::TrainingButtons |
Training buttons.
Definition at line 383 of file ui.h.
Referenced by CleanUserInterface(), DrawTrainingUnits(), and HandleMouseOn().
| std::string CUserInterface::TrainingText |
Multiple Training Text.
Definition at line 384 of file ui.h.
Referenced by CleanUserInterface(), and DrawTrainingUnits().
Multiple Training X Text position.
Definition at line 386 of file ui.h.
Referenced by DrawTrainingUnits().
Multiple Training Y Text position.
Definition at line 387 of file ui.h.
Referenced by DrawTrainingUnits().
| std::vector<CUIButton> CUserInterface::TransportingButtons |
Button info for transporting.
Definition at line 389 of file ui.h.
Referenced by CleanUserInterface(), DrawTransportingUnits(), and HandleMouseOn().
| SDL_Color CUserInterface::CompletedBarColorRGB |
color for completed bar
Definition at line 392 of file ui.h.
Referenced by CUserInterface(), and InitUserInterface().
Definition at line 397 of file ui.h.
Referenced by CalculateVisibleIcons(), CancelBuildingMode(), CleanUserInterface(), CButtonPanel::DoClicked(), CButtonPanel::DoKey(), CButtonPanel::Draw(), DrawPatchIcons(), DrawPieMenu(), DrawPopup(), CIcon::DrawUnitIcon(), DrawUnitIcons(), EditorCallbackMouse(), EditorMainLoop(), EditorUpdateDisplay(), HandleActionTrain(), HandleKeyDown(), HandleMouseOn(), HandlePieMenuMouseSelection(), Load(), SelectedUnitChanged(), SelectionChanged(), SendCommand(), UIHandleButtonDown(), UISelectStateButtonDown(), UpdateButtonPanelMultipleUnits(), UpdateButtonPanelSingleUnit(), and UpdateDisplay().
Definition at line 400 of file ui.h.
Referenced by CleanUserInterface(), DrawPieMenu(), GetPieUnderCursor(), Load(), UIHandleButtonDown(), and UIHandleMouseMove().
Current viewport mode.
Definition at line 403 of file ui.h.
Referenced by CclDefineViewports(), CycleViewportMode(), SaveViewports(), SetViewportMode(), and UiToggleBigMap().
Viewport containing mouse.
Definition at line 404 of file ui.h.
Referenced by DrawBuildingCursor(), DrawCursor(), DrawMapCursor(), EditorCallbackButtonDown(), EditorCallbackMouse(), FinishViewportModeConfiguration(), HandleMouseOn(), MouseScrollMap(), SelectUnitsByType(), ToggleUnitsByType(), UIHandleButtonDown(), UIHandleButtonUp(), UIHandleMouseMove(), and UISelectStateButtonDown().
Current selected active viewport.
Definition at line 405 of file ui.h.
Referenced by CalculateStereo(), CclCenterMap(), CenterOnMessage(), CreateGame(), DoScrollArea(), CViewport::DrawBorder(), CMinimap::DrawCursor(), DrawPieMenu(), DrawVisibleRectangleCursor(), EditorCallbackButtonDown(), EditorCallbackKeyDown(), EditorCallbackMouse(), EditorMainLoop(), EditorUpdateDisplay(), FinishViewportModeConfiguration(), InitUserInterface(), PlayMissileSound(), RestrictCursorToViewport(), SelectUnitsInRectangle(), UiCenterOnGroup(), UiCenterOnSelected(), UiFindIdleWorker(), UIHandleButtonDown(), UIHandleMouseMove(), UiRecallMapPosition(), UiSaveMapPosition(), UISelectStateButtonDown(), UiTrackUnit(), UpdateDisplay(), ViewPointDistance(), and ViewPointDistanceToUnit().
# Viewports currently used
Definition at line 406 of file ui.h.
Referenced by CclDefineViewports(), CViewport::DrawBorder(), DrawMapArea(), DrawStartLocations(), FinishViewportModeConfiguration(), GetViewport(), CUnit::IsVisibleOnScreen(), and SaveViewports().
| CViewport CUserInterface::Viewports[MAX_NUM_VIEWPORTS] |
Parameters of all viewports.
Definition at line 407 of file ui.h.
Referenced by CclDefineViewports(), CreateGame(), DrawMapArea(), DrawStartLocations(), EditorMainLoop(), FinishViewportModeConfiguration(), GetViewport(), HandleMouseOn(), InitUserInterface(), CUnit::IsVisibleOnScreen(), SaveViewports(), and UIHandleButtonDown().
geometry of the whole map area
Definition at line 408 of file ui.h.
Referenced by MessagesDisplay::AddMessage(), ClipViewport(), MessagesDisplay::DrawMessages(), EditorCallbackMouse(), HandleMouseOn(), InitSoundClient(), InitUserInterface(), CViewport::Set(), SetViewportModeQuad(), SetViewportModeSingle(), SetViewportModeSplitHoriz(), SetViewportModeSplitHoriz3(), SetViewportModeSplitVert(), and UiToggleBigMap().
Font used for messages.
Definition at line 409 of file ui.h.
Referenced by MessagesDisplay::AddMessage(), MessagesDisplay::DrawMessages(), and MessagesDisplay::UpdateMessages().
Scroll speed in seconds for messages.
Definition at line 410 of file ui.h.
Referenced by MessagesDisplay::AddMessage(), and MessagesDisplay::UpdateMessages().
menu button
Definition at line 413 of file ui.h.
Referenced by DrawMenuButtonArea(), EditorCallbackButtonUp(), EditorCallbackMouse(), EditorUpdateDisplay(), HandleMouseOn(), and UIHandleButtonUp().
network menu button
Definition at line 414 of file ui.h.
Referenced by DrawMenuButtonArea(), HandleMouseOn(), and UIHandleButtonUp().
network diplomacy button
Definition at line 415 of file ui.h.
Referenced by DrawMenuButtonArea(), HandleMouseOn(), and UIHandleButtonUp().
minimap
Definition at line 418 of file ui.h.
Referenced by CclSetMinimapTerrain(), CMap::Clean(), CreateGame(), DrawUnitOn(), EditorCallbackButtonDown(), EditorCallbackMouse(), EditorMainLoop(), EditorUpdateDisplay(), GameMainLoop(), HandleMouseOn(), LoadModules(), CPlayer::Notify(), ReloadOpenGL(), CVideo::ResizeScreen(), RestrictCursorToMinimap(), UIHandleButtonDown(), UIHandleMouseMove(), UISelectStateButtonDown(), UiToggleTerrain(), and UpdateDisplay().
minimap cursor color
Definition at line 419 of file ui.h.
Referenced by CMinimap::DrawCursor(), and InitUserInterface().
status line
Definition at line 422 of file ui.h.
Referenced by CancelBuildingMode(), CButtonPanel::DoClicked(), DoSelectionButtons(), DrawCosts(), DrawInfoPanelMultipleSelected(), DrawInfoPanelSingleSelected(), DrawTransportingUnits(), EditorActionRemoveUnit(), EditorCallbackButtonDown(), EditorCallbackKeyDown(), EditorCallbackMouse(), EditorUpdateDisplay(), InputKey(), SelectionChanged(), ShowInput(), ShowPatchInfo(), ShowUnitInfo(), MenuScreen::stop(), UiDecreaseGameSpeed(), UiFindIdleWorker(), UIHandleButtonUp(), UiIncreaseGameSpeed(), UISelectStateButtonDown(), UiToggleBigMap(), UiToggleGrabMouse(), UiToggleMusic(), UiTogglePause(), UiToggleSound(), UiToggleTerrain(), UpdateDisplay(), and UpdateStatusLineForButton().
Offset for 640x480 X position.
Definition at line 428 of file ui.h.
Referenced by InitUserInterface().
Offset for 640x480 Y position.
Definition at line 429 of file ui.h.
Referenced by InitUserInterface().
General pointing cursor.
Definition at line 434 of file ui.h.
Referenced by CUserInterface(), CButtonPanel::DoClicked(), EditorCallbackButtonUp(), EditorCallbackMouse(), EditorMainLoop(), GameMainLoop(), HandleMouseExit(), Load(), MenuLoop(), PatchEditorCallbackMouse(), MenuScreen::run(), SelectionChanged(), UIHandleButtonDown(), UIHandleButtonUp(), UIHandleMouseMove(), and UISelectStateButtonDown().
HourGlass, system is waiting.
Definition at line 435 of file ui.h.
Referenced by CUserInterface(), Load(), and UIHandleMouseMove().
Multi-select cursor.
Definition at line 436 of file ui.h.
Referenced by CUserInterface(), Load(), and UIHandleButtonDown().
Yellow action,attack cursor.
Definition at line 437 of file ui.h.
Referenced by CUserInterface(), CButtonPanel::DoClicked(), Load(), and UIHandleMouseMove().
Green action,attack cursor.
Definition at line 438 of file ui.h.
Referenced by CUserInterface(), Load(), and UIHandleMouseMove().
Red action,attack cursor.
Definition at line 439 of file ui.h.
Referenced by CUserInterface(), Load(), and UIHandleMouseMove().
Cursor for scrolling map around.
Definition at line 440 of file ui.h.
Referenced by CUserInterface(), EditorCallbackButtonDown(), EditorCallbackButtonUp(), EditorCallbackMouse(), Load(), UIHandleButtonDown(), UIHandleButtonUp(), and UIHandleMouseMove().
Cursor pointing east.
Definition at line 442 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing north east.
Definition at line 443 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing north.
Definition at line 444 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing north west.
Definition at line 445 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing west.
Definition at line 446 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing south west.
Definition at line 447 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing south.
Definition at line 448 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Cursor pointing south east.
Definition at line 449 of file ui.h.
Referenced by CUserInterface(), HandleMouseScrollArea(), and Load().
Victory background graphic.
Definition at line 457 of file ui.h.
Referenced by CleanUserInterface().
1.5.6