____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 <ctype.h>
#include "stratagus.h"
#include "video.h"
#include "map.h"
#include "sound.h"
#include "unitsound.h"
#include "unittype.h"
#include "player.h"
#include "unit.h"
#include "missile.h"
#include "commands.h"
#include "minimap.h"
#include "font.h"
#include "cursor.h"
#include "interface.h"
#include "menus.h"
#include "ui.h"
#include "network.h"
#include "spells.h"
#include "widgets.h"
Go to the source code of this file.
Defines | |
| #define | ICON_SIZE_X (UI.ButtonPanel.Buttons[0].Style->Width) |
| #define | ICON_SIZE_Y (UI.ButtonPanel.Buttons[0].Style->Height) |
| #define | LongSelected (MouseButtons & ((LeftButton << MouseHoldShift))) |
Functions | |
| static void | HandlePieMenuMouseSelection (void) |
| void | CancelBuildingMode (void) |
| Draw menu button area. | |
| void | DoRightButton (int sx, int sy) |
| < Called if right mouse button is pressed | |
| static bool | OnButton (int x, int y, CUIButton *button) |
| static bool | OnGraphic (int x, int y, CGraphic *g, int gx, int gy) |
| static void | HandleMouseOn (int x, int y) |
| void | HandleMouseExit (void) |
| Update KeyModifiers if a key is pressed. | |
| void | RestrictCursorToViewport (void) |
| Restrict mouse cursor to minimap. | |
| void | RestrictCursorToMinimap (void) |
| Get viewport for screen pixel position. | |
| void | MouseScrollMap (int x, int y) |
| Check if mouse scrolling is enabled. | |
| void | UIHandleMouseMove (int x, int y) |
| Called if any mouse button is pressed down. | |
| static int | SendRepair (int sx, int sy) |
| static int | SendMove (int sx, int sy) |
| static int | SendAttack (int sx, int sy) |
| static int | SendAttackGround (int sx, int sy) |
| static int | SendPatrol (int sx, int sy) |
| static int | SendResource (int sx, int sy) |
| static int | SendUnload (int sx, int sy) |
| static int | SendSpellCast (int sx, int sy) |
| static void | SendCommand (int sx, int sy) |
| static void | DoSelectionButtons (int num, unsigned button) |
| static void | UISelectStateButtonDown (unsigned button) |
| void | UIHandleButtonDown (unsigned button) |
| Called if any mouse button is released up. | |
| void | UIHandleButtonUp (unsigned button) |
| Restrict mouse cursor to viewport. | |
| static int | GetPieUnderCursor (void) |
| void | DrawPieMenu (void) |
| Handle the mouse in scroll area. | |
Variables | |
| int | MouseButtons |
| Current pressed mouse buttons. | |
| int | KeyModifiers |
| Current keyboard modifiers. | |
| CUnit * | UnitUnderCursor |
| Unit under cursor. | |
| int | ButtonAreaUnderCursor = -1 |
| Button area under cursor. | |
| int | ButtonUnderCursor = -1 |
| Button under cursor. | |
| bool | GameMenuButtonClicked |
| Menu button was clicked. | |
| bool | GameDiplomacyButtonClicked |
| Diplomacy button was clicked. | |
| bool | LeaveStops |
| Mouse leaves windows stops scroll. | |
| enum _cursor_on_ | CursorOn = CursorOnUnknown |
| Cursor on field. | |
Definition in file mouse.cpp.
| #define ICON_SIZE_X (UI.ButtonPanel.Buttons[0].Style->Width) |
| #define ICON_SIZE_Y (UI.ButtonPanel.Buttons[0].Style->Height) |
| #define LongSelected (MouseButtons & ((LeftButton << MouseHoldShift))) |
Referenced by UIHandleButtonDown().
| void CancelBuildingMode | ( | void | ) |
Draw menu button area.
Cancel building cursor mode.
Definition at line 88 of file mouse.cpp.
References CUserInterface::ButtonPanel, CStatusLine::Clear(), ClearCosts(), CurrentButtonLevel, CursorBuilding, CUserInterface::StatusLine, UI, and CButtonPanel::Update().
Referenced by DoActionMove(), CUnit::Remove(), and UIHandleButtonDown().
| void DoRightButton | ( | int | sx, | |
| int | sy | |||
| ) |
< Called if right mouse button is pressed
Called when right button is pressed
| sx | X map position in pixels. | |
| sy | Y map position in pixels. |
Definition at line 103 of file mouse.cpp.
References Assert, CUnit::Blink, CUnitType::CanCastSpell, CUnitType::CanHarvestFrom, CanMove(), CanSelectMultipleUnits, CanTarget(), CanTransport(), CUnitType::CanTransport, CYCLES_PER_SECOND, DebugPrint, CUnitType::Decoration, GameCycle, CUnitType::Harvester, HP_INDEX, CPlayer::Index, CUnit::IsAllied(), CUnit::IsEnemy(), CUnit::IsTeamed(), KeyModifiers, CVariable::Max, ModifierControl, ModifierShift, CUnitType::MouseAction, MouseActionAttack, MouseActionHarvest, MouseActionMove, MouseActionSail, MouseActionSpellCast, NoUnitP, NumSelected, CUnit::Orders, CUnit::Player, PlayerNumNeutral, PlayUnitSound(), Preference, CUnitType::RepairHP, CUnitType::RepairRange, RightButtonAttacks, Selected, SendCommandAttack(), SendCommandBoard(), SendCommandFollow(), SendCommandMove(), SendCommandRepair(), SendCommandResource(), SendCommandSpellCast(), SendCommandStopUnit(), CPreference::ShowOrders, ShowOrdersCount, SpellTypeTable, ThisPlayer, TileSizeX, TileSizeY, CUnit::Type, UnitActionBuilt, CVariable::Value, CUnit::Variable, VoiceAcknowledging, and y.
Referenced by UIHandleButtonDown().
| static void DoSelectionButtons | ( | int | num, | |
| unsigned | button | |||
| ) | [static] |
Mouse button press on selection/group area.
| num | Button number. | |
| button | Mouse Button pressed. |
Definition at line 1173 of file mouse.cpp.
References AddGroupFromUnitToSelection(), CStatusLine::Clear(), ClearCosts(), CurrentButtonLevel, GameObserve, GamePaused, KeyModifiers, LeftButton, ModifierAlt, ModifierControl, ModifierShift, MouseButtons, MouseDoubleShift, NumSelected, Selected, SelectGroupFromUnit(), SelectionChanged(), SelectSingleUnit(), SelectUnitsByType(), CUserInterface::StatusLine, ToggleSelectUnit(), ToggleUnitsByType(), and UI.
Referenced by UIHandleButtonDown().
| void DrawPieMenu | ( | void | ) |
Handle the mouse in scroll area.
Draw Pie Menu
Definition at line 1825 of file mouse.cpp.
References CUserInterface::ButtonPanel, CButtonPanel::Buttons, CurrentButtons, CursorStartX, CursorStartY, CursorState, CursorStatePieMenu, CursorStatePoint, CGraphic::DrawFrameClip(), CIcon::DrawIcon(), CViewport::EndX, CViewport::EndY, CPieMenu::G, GameFont, GetPieUnderCursor(), CGraphic::Height, IconConfig::Icon, ButtonAction::Icon, ICON_SIZE_X, ICON_SIZE_Y, int(), KeyState, KeyStateInput, CUserInterface::PieMenu, CUnit::Player, PopClipping(), PushClipping(), Selected, CUserInterface::SelectedViewport, SetClipping(), CButtonPanel::ShowCommandKey, UI, UpdateStatusLineForButton(), VideoDrawTextClip(), CGraphic::Width, CPieMenu::X, CViewport::X, CPieMenu::Y, y, and CViewport::Y.
Referenced by UpdateDisplay().
| static int GetPieUnderCursor | ( | void | ) | [static] |
Get pie menu under the cursor
Definition at line 1809 of file mouse.cpp.
References CursorStartX, CursorStartY, CursorX, CursorY, ICON_SIZE_X, ICON_SIZE_Y, CUserInterface::PieMenu, UI, CPieMenu::X, CPieMenu::Y, and y.
Referenced by DrawPieMenu(), and HandlePieMenuMouseSelection().
| void HandleMouseExit | ( | void | ) |
Update KeyModifiers if a key is pressed.
Handle cursor exits the game window (only for some videomodes)
Definition at line 570 of file mouse.cpp.
References CursorConfig::Cursor, CursorOn, CursorOnUnknown, CursorX, CursorY, GameCursor, CVideo::Height, KeyScrollState, LeaveStops, MouseScrollState, CUserInterface::Point, ScrollNone, UI, Video, and CVideo::Width.
Referenced by InitGameCallbacks(), and initGuichan().
| static void HandleMouseOn | ( | int | x, | |
| int | y | |||
| ) | [static] |
Set flag on which area is the cursor.
| x | X coordinate. | |
| y | Y coordinate. |
Definition at line 401 of file mouse.cpp.
References _C_, Assert, BigMapMode, CUnit::BoardCount, ButtonAreaButton, ButtonAreaMenu, ButtonAreaSelected, ButtonAreaTraining, ButtonAreaTransporting, ButtonAreaUnderCursor, CUserInterface::ButtonPanel, CButtonPanel::Buttons, ButtonUnderCursor, ButtonUnderMenu, ButtonUnderNetworkDiplomacy, ButtonUnderNetworkMenu, CurrentButtons, CursorOn, CursorOnButton, CursorOnMap, CursorOnMinimap, CursorOnUnknown, DebugPrint, CMapArea::EndX, CMapArea::EndY, CUserInterface::Fillers, GetViewport(), CMinimap::H, HandleMouseScrollArea(), int(), IsNetworkGame, CUserInterface::MapArea, CUserInterface::MenuButton, CUserInterface::Minimap, MouseScrollState, CUserInterface::MouseViewport, CUserInterface::NetworkDiplomacyButton, CUserInterface::NetworkMenuButton, NumSelected, OnButton(), OnGraphic(), CUnit::OrderCount, ScrollNone, Selected, CUserInterface::SelectedButtons, CUserInterface::SingleSelectedButton, CUserInterface::SingleTrainingButton, CUserInterface::TrainingButtons, CUserInterface::TransportingButtons, UI, UnitActionTrain, CUserInterface::Viewports, CMinimap::W, CMapArea::X, CMinimap::X, CUIButton::X, CMapArea::Y, and CMinimap::Y.
Referenced by UIHandleButtonDown(), and UIHandleMouseMove().
| static void HandlePieMenuMouseSelection | ( | void | ) | [static] |
Handle pie menu mouse selection
Definition at line 1887 of file mouse.cpp.
References ButtonButton, CUserInterface::ButtonPanel, CurrentButtons, CursorOn, CursorOnUnknown, CursorStartX, CursorStartY, CursorState, CursorStatePieMenu, CursorStatePoint, CursorX, CursorY, CButtonPanel::DoClicked(), GetPieUnderCursor(), UI, and UIHandleMouseMove().
Referenced by UIHandleButtonDown(), and UIHandleButtonUp().
| void MouseScrollMap | ( | int | x, | |
| int | y | |||
| ) |
Check if mouse scrolling is enabled.
Use the mouse to scroll the map
| x | Screen X position. | |
| y | Screen Y position. |
Definition at line 647 of file mouse.cpp.
References CursorStartX, CursorStartY, KeyModifiers, CViewport::MapX, CViewport::MapY, ModifierControl, CUserInterface::MouseScrollSpeedControl, CUserInterface::MouseScrollSpeedDefault, CUserInterface::MouseViewport, CUserInterface::MouseWarpX, CUserInterface::MouseWarpY, CViewport::OffsetX, CViewport::OffsetY, CViewport::Set(), and UI.
Referenced by EditorCallbackMouse(), and UIHandleMouseMove().
| static bool OnButton | ( | int | x, | |
| int | y, | |||
| CUIButton * | button | |||
| ) | [inline, static] |
Check if the mouse is on a button
| x | X coordinate. | |
| y | Y coordinate. | |
| button | Button to check. |
Definition at line 368 of file mouse.cpp.
References ButtonStyle::Height, CUIButton::Style, ButtonStyle::Width, CUIButton::X, and CUIButton::Y.
Referenced by HandleMouseOn().
| static bool OnGraphic | ( | int | x, | |
| int | y, | |||
| CGraphic * | g, | |||
| int | gx, | |||
| int | gy | |||
| ) | [inline, static] |
Check if the mouse is on a graphic
| x | X coordinate. | |
| y | Y coordinate. | |
| g | Graphic. | |
| gx | Graphic X coordinate. | |
| gy | Graphic Y coordinate. |
Definition at line 385 of file mouse.cpp.
References CGraphic::TransparentPixel().
Referenced by HandleMouseOn().
| void RestrictCursorToMinimap | ( | void | ) |
Get viewport for screen pixel position.
Restrict mouse cursor to minimap
Definition at line 618 of file mouse.cpp.
References CursorOn, CursorOnMinimap, CursorStartX, CursorStartY, CursorX, CursorY, CMinimap::H, CUserInterface::Minimap, CUserInterface::MouseWarpX, CUserInterface::MouseWarpY, UI, CMinimap::W, CMinimap::X, and CMinimap::Y.
Referenced by EditorCallbackMouse(), and UIHandleMouseMove().
| void RestrictCursorToViewport | ( | void | ) |
Restrict mouse cursor to minimap.
Restrict mouse cursor to viewport.
Definition at line 592 of file mouse.cpp.
References CursorOn, CursorOnMap, CursorStartX, CursorStartY, CursorX, CursorY, CViewport::EndX, CViewport::EndY, CUserInterface::MouseWarpX, CUserInterface::MouseWarpY, CUserInterface::SelectedViewport, UI, CViewport::X, and CViewport::Y.
Referenced by EditorCallbackMouse().
| static int SendAttack | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send the current selected group attacking.
To empty field: Move to this field attacking all enemy units in reaction range.
To unit: Move to unit attacking and tracing the unit until dead.
| sx | X screen map position. | |
| sy | Y screen map position. |
Definition at line 921 of file mouse.cpp.
References CUnit::Blink, CUnitType::CanAttack, CanMove(), CanTarget(), CUnitType::Decoration, KeyModifiers, ModifierShift, NumSelected, Selected, SendCommandAttack(), SendCommandMove(), TileSizeX, TileSizeY, and CUnit::Type.
Referenced by SendCommand().
| static int SendAttackGround | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send the current selected group ground attacking.
| sx | X screen map position. | |
| sy | Y screen map position. |
Definition at line 961 of file mouse.cpp.
References CUnitType::CanAttack, KeyModifiers, ModifierShift, NumSelected, Selected, SendCommandAttackGround(), SendCommandMove(), TileSizeX, TileSizeY, and CUnit::Type.
Referenced by SendCommand().
| static void SendCommand | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send a command to selected units.
| sx | X screen map position | |
| sy | Y screen map position |
Definition at line 1116 of file mouse.cpp.
References _C_, ButtonAttack, ButtonAttackGround, ButtonHarvest, ButtonMove, CUserInterface::ButtonPanel, ButtonPatrol, ButtonRepair, ButtonSpellCast, ButtonUnload, CurrentButtonLevel, CursorAction, CYCLES_PER_SECOND, DebugPrint, GameCycle, NumSelected, PlayUnitSound(), Preference, Selected, SendAttack(), SendAttackGround(), SendMove(), SendPatrol(), SendRepair(), SendResource(), SendSpellCast(), SendUnload(), CPreference::ShowOrders, ShowOrdersCount, UI, CButtonPanel::Update(), and VoiceAcknowledging.
Referenced by UISelectStateButtonDown().
| static int SendMove | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send selected units to point.
| sx | X screen tile position. | |
| sy | Y screen tile position. |
Definition at line 863 of file mouse.cpp.
References CUnit::Blink, CanTransport(), CUnitType::CanTransport, KeyModifiers, ModifierShift, NumSelected, Selected, SendCommandBoard(), SendCommandFollow(), SendCommandMove(), SendCommandStopUnit(), TileSizeX, TileSizeY, and CUnit::Type.
Referenced by SendCommand().
| static int SendPatrol | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Let units patrol between current postion and the selected.
| sx | X screen map position. | |
| sy | Y screen map position. |
Definition at line 986 of file mouse.cpp.
References KeyModifiers, ModifierShift, NumSelected, Selected, SendCommandPatrol(), TileSizeX, and TileSizeY.
Referenced by SendCommand().
| static int SendRepair | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send selected units to repair
| sx | X screen map position. | |
| sy | Y screen map position. |
Definition at line 831 of file mouse.cpp.
References DebugPrint, HP_INDEX, CPlayer::IsAllied(), KeyModifiers, CVariable::Max, ModifierShift, NumSelected, CUnit::Player, CUnitType::RepairHP, CUnitType::RepairRange, Selected, SendCommandRepair(), ThisPlayer, TileSizeX, TileSizeY, CUnit::Type, CVariable::Value, and CUnit::Variable.
Referenced by SendCommand().
| static int SendResource | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Let units harvest wood/mine gold/haul oil
| sx | X screen map position | |
| sy | Y screen map position |
Definition at line 1007 of file mouse.cpp.
References CUnit::Blink, CUnitType::CanHarvestFrom, CanMove(), CUnitType::Harvester, KeyModifiers, ModifierShift, NumSelected, Selected, SendCommandMove(), SendCommandResource(), TileSizeX, TileSizeY, CUnit::Type, and y.
Referenced by SendCommand().
| static int SendSpellCast | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send the current selected group for spell cast.
To empty field: To unit: Spell cast on unit or on map spot.
| sx | X screen map position. | |
| sy | Y screen map position. |
Definition at line 1077 of file mouse.cpp.
References _C_, CUnitType::CanCastSpell, CursorValue, DebugPrint, KeyModifiers, ModifierShift, CUnitType::Name, NumSelected, Selected, SendCommandSpellCast(), CUnit::Slot, TileSizeX, TileSizeY, and CUnit::Type.
Referenced by SendCommand().
| static int SendUnload | ( | int | sx, | |
| int | sy | |||
| ) | [static] |
Send selected units to unload passengers.
| sx | X screen map position. | |
| sy | Y screen map position. |
Definition at line 1052 of file mouse.cpp.
References KeyModifiers, ModifierShift, NoUnitP, NumSelected, Selected, SendCommandUnload(), TileSizeX, and TileSizeY.
Referenced by SendCommand().
| void UIHandleButtonDown | ( | unsigned | button | ) |
Called if any mouse button is released up.
Called if mouse button pressed down.
| button | Button pressed down. |
Detect long selection click, FIXME: tempory hack to test the feature.
Definition at line 1300 of file mouse.cpp.
References _C_, Assert, CUnit::Blink, CUnit::Boarded, ButtonAreaButton, ButtonAreaMenu, ButtonAreaSelected, ButtonAreaTraining, ButtonAreaTransporting, ButtonAreaUnderCursor, CUserInterface::ButtonPanel, ButtonUnderCursor, ButtonUnderMenu, ButtonUnderNetworkDiplomacy, ButtonUnderNetworkMenu, CanBuildUnitType(), CancelBuildingMode(), CViewport::Center(), GameSound::Click, ClickMissile, CUserInterface::Cross, CursorConfig::Cursor, CursorBuilding, CursorOn, CursorOnButton, CursorOnMap, CursorOnMinimap, CursorStartScrMapX, CursorStartScrMapY, CursorStartX, CursorStartY, CursorState, CursorStatePieMenu, CursorStatePoint, CursorStateRectangle, CursorStateSelect, CursorX, CursorY, DebugPrint, CUnitType::Decoration, CButtonPanel::DoClicked(), DoRightButton(), DoSelectionButtons(), GameCursor, GameDiplomacyButtonClicked, GameMenuButtonClicked, GameObserve, GamePaused, GameSounds, HandleMouseOn(), HandlePieMenuMouseSelection(), CMap::IsFieldExplored(), CViewport::IsInsideMapArea(), CPlayer::IsTeamed(), KeyModifiers, LeftButton, LongSelected, MakeLocalMissile(), Map, CViewport::MapX, CViewport::MapY, MaxSampleVolume, MiddleButton, CUserInterface::Minimap, MissileTypeByIdent(), ModifierAlt, ModifierShift, CPieMenu::MouseButton, MouseButtons, CUserInterface::MouseViewport, CUnit::NextContained, NumSelected, CViewport::OffsetX, CViewport::OffsetY, CUserInterface::PieMenu, GameSound::PlacementError, GameSound::PlacementSuccess, PlayGameSound(), CUserInterface::Point, Preference, ReplayRevealMap, RightButton, CMinimap::Screen2MapX(), CMinimap::Screen2MapY(), CUserInterface::Scroll, Selected, CUserInterface::SelectedViewport, SendCommandBuildBuilding(), SendCommandCancelTraining(), SendCommandUnload(), CPreference::ShowAttackRange, CPreference::ShowReactionRange, CPreference::ShowSightRange, SoundConfig::Sound, ThisPlayer, CUnitType::TileHeight, TileSizeX, TileSizeY, CUnitType::TileWidth, CUnit::Type, UI, UISelectStateButtonDown(), CViewport::Unit, UnitActionTrain, CUnit::UnitInside, UnitOnMapTile(), CViewport::Viewport2MapX(), CViewport::Viewport2MapY(), CUserInterface::Viewports, CViewport::X, CViewport::Y, and y.
Referenced by HandleButtonDown().
| void UIHandleButtonUp | ( | unsigned | button | ) |
Restrict mouse cursor to viewport.
Called if mouse button released.
| button | Button released. |
Definition at line 1586 of file mouse.cpp.
References _, LuaActionListener::action(), AddGroupFromUnitToSelection(), AddSelectedAirUnitsInRectangle(), AddSelectedGroundUnitsInRectangle(), AddSelectedUnitsInRectangle(), CUnitType::Building, ButtonAreaMenu, ButtonAreaUnderCursor, ButtonUnderCursor, ButtonUnderMenu, ButtonUnderNetworkDiplomacy, ButtonUnderNetworkMenu, CUIButton::Callback, CStatusLine::Clear(), ClearCosts(), GameSound::Click, CurrentButtonLevel, CursorConfig::Cursor, CursorStartScrMapX, CursorStartScrMapY, CursorStartX, CursorStartY, CursorState, CursorStatePieMenu, CursorStatePoint, CursorStateRectangle, CursorX, CursorY, GameCursor, GameDiplomacyButtonClicked, GameMenuButtonClicked, GamePaused, GameSounds, HandlePieMenuMouseSelection(), CMap::IsFieldVisible(), IsNetworkGame, CPlayer::IsTeamed(), KeyModifiers, CUnit::LastGroup, LeftButton, Map, CViewport::MapX, CViewport::MapY, MaxSampleVolume, CUserInterface::MenuButton, ModifierAlt, ModifierControl, ModifierShift, MouseButtons, MouseDoubleShift, CUserInterface::MouseViewport, CUnitType::Name, CUserInterface::NetworkDiplomacyButton, CUserInterface::NetworkMenuButton, NumSelected, CViewport::OffsetX, CViewport::OffsetY, CUnit::Player, PlayerNeutral, PlayGameSound(), PlayUnitSound(), CUserInterface::Point, ReplayRevealMap, CUserInterface::Scroll, SelectAirUnitsInRectangle(), Selected, SelectGroundUnitsInRectangle(), SelectGroupFromUnit(), SelectionChanged(), SelectSingleUnit(), SelectUnitsByType(), SelectUnitsInRectangle(), CStatusLine::Set(), CUnitType::Slot, SoundConfig::Sound, SoundForName(), sprintf_s(), CUserInterface::StatusLine, ThisPlayer, TileSizeX, TileSizeY, ToggleSelectUnit(), ToggleUnitsByType(), CPlayer::Type, CUnit::Type, UI, UnitActionBuilt, UnitOnScreen(), CViewport::Viewport2MapX(), CViewport::Viewport2MapY(), VoiceBuilding, VoiceSelected, CViewport::X, and CViewport::Y.
Referenced by HandleButtonUp().
| void UIHandleMouseMove | ( | int | x, | |
| int | y | |||
| ) |
Called if any mouse button is pressed down.
Handle movement of the cursor.
| x | Screen X position. | |
| y | Screen Y position. |
Definition at line 670 of file mouse.cpp.
References CViewport::Center(), CursorConfig::Cursor, CursorOn, CursorOnMap, CursorOnMinimap, CursorStartX, CursorStartY, CursorState, CursorStatePieMenu, CursorStateRectangle, CursorStateSelect, CursorX, CursorY, CUnitType::Decoration, CViewport::EndX, CViewport::EndY, GameCursor, GameDiplomacyButtonClicked, GameMenuButtonClicked, CUserInterface::Glass, CUserInterface::GreenHair, HandleMouseOn(), CPlayer::Index, CPlayer::IsAllied(), CMap::IsFieldExplored(), CViewport::IsInsideMapArea(), CUnit::IsVisible(), CUnit::IsVisibleAsGoal(), LeftButton, Map, CViewport::MapX, CViewport::MapY, CUserInterface::Minimap, MouseButtons, MouseScrollMap(), CUserInterface::MouseViewport, CUserInterface::MouseWarpX, CUserInterface::MouseWarpY, CViewport::OffsetX, CViewport::OffsetY, CUserInterface::PieMenu, CUnit::Player, PlayerNumNeutral, CUserInterface::Point, CUserInterface::RedHair, ReplayRevealMap, RestrictCursorToMinimap(), RightButton, CMinimap::Screen2MapX(), CMinimap::Screen2MapY(), CUserInterface::Scroll, CUserInterface::SelectedViewport, ThisPlayer, TileSizeX, TileSizeY, CUnit::Type, UI, UnitOnMapTile(), UnitOnScreen(), CViewport::Viewport2MapX(), CViewport::Viewport2MapY(), CPieMenu::X, CViewport::X, CPieMenu::Y, CViewport::Y, and CUserInterface::YellowHair.
Referenced by HandleMouseMove(), HandlePieMenuMouseSelection(), and MenuScreen::stop().
| static void UISelectStateButtonDown | ( | unsigned | button | ) | [static] |
Handle mouse button pressed in select state.
Select state is used for target of patrol, attack, move, ....
| button | Button pressed down. |
Definition at line 1219 of file mouse.cpp.
References ButtonAreaButton, ButtonAreaUnderCursor, CUserInterface::ButtonPanel, ButtonUnderCursor, CViewport::Center(), CStatusLine::Clear(), ClearCosts(), ClickMissile, CurrentButtonLevel, CursorConfig::Cursor, CursorOn, CursorOnButton, CursorOnMap, CursorOnMinimap, CursorState, CursorStatePoint, CursorX, CursorY, CButtonPanel::DoClicked(), GameCursor, GameObserve, GamePaused, CViewport::IsInsideMapArea(), LeftButton, MakeLocalMissile(), CViewport::MapX, CViewport::MapY, CUserInterface::Minimap, MissileTypeByIdent(), MouseButtons, CUserInterface::MouseViewport, CViewport::OffsetX, CViewport::OffsetY, CUserInterface::Point, CMinimap::Screen2MapX(), CMinimap::Screen2MapY(), CUserInterface::SelectedViewport, SendCommand(), CUserInterface::StatusLine, TileSizeX, TileSizeY, UI, CButtonPanel::Update(), CViewport::X, and CViewport::Y.
Referenced by UIHandleButtonDown().
| int ButtonAreaUnderCursor = -1 |
Button area under cursor.
button number under the cursor
Definition at line 72 of file mouse.cpp.
Referenced by CButtonPanel::Draw(), DrawInfoPanelMultipleSelected(), DrawInfoPanelSingleSelected(), DrawMenuButtonArea(), DrawTrainingUnits(), DrawTransportingUnits(), DrawUnitInfo(), EditorCallbackButtonDown(), EditorCallbackMouse(), EditorUpdateDisplay(), GetButtonStatus(), HandleMouseOn(), UIHandleButtonDown(), UIHandleButtonUp(), and UISelectStateButtonDown().
| int ButtonUnderCursor = -1 |
Button under cursor.
menu button was clicked down
Definition at line 73 of file mouse.cpp.
Referenced by CButtonPanel::Draw(), DrawEditorPanel(), DrawInfoPanelMultipleSelected(), DrawInfoPanelSingleSelected(), DrawMenuButtonArea(), DrawPopup(), DrawTrainingUnits(), DrawTransportingUnits(), DrawUnitInfo(), EditorCallbackButtonDown(), EditorCallbackButtonUp(), EditorCallbackMouse(), EditorUpdateDisplay(), GetButtonStatus(), HandleMouseOn(), MenuLoop(), UIHandleButtonDown(), UIHandleButtonUp(), and UISelectStateButtonDown().
| enum _cursor_on_ CursorOn = CursorOnUnknown |
Cursor on field.
vladi: used for unit buttons sub-menus etc
Definition at line 78 of file mouse.cpp.
Referenced by DrawCursor(), EditorCallbackButtonDown(), EditorCallbackMouse(), EditorMainLoop(), EditorUpdateDisplay(), HandleMouseExit(), HandleMouseOn(), HandleMouseScrollArea(), HandlePieMenuMouseSelection(), RestrictCursorToMinimap(), RestrictCursorToViewport(), MenuScreen::run(), UIHandleButtonDown(), UIHandleMouseMove(), and UISelectStateButtonDown().
Diplomacy button was clicked.
Mouse leaves windows stops scroll.
Definition at line 75 of file mouse.cpp.
Referenced by DrawMenuButtonArea(), UIHandleButtonDown(), UIHandleButtonUp(), and UIHandleMouseMove().
Menu button was clicked.
diplomacy button was clicked down
Definition at line 74 of file mouse.cpp.
Referenced by DrawMenuButtonArea(), EditorCallbackButtonDown(), EditorCallbackButtonUp(), EditorUpdateDisplay(), UIHandleButtonDown(), UIHandleButtonUp(), and UIHandleMouseMove().
| int KeyModifiers |
Current keyboard modifiers.
current interface state
Definition at line 69 of file mouse.cpp.
Referenced by CommandKey(), CButtonPanel::DoClicked(), DoRightButton(), DoSelectionButtons(), CViewport::Draw(), EditorCallbackKeyDown(), EditorCallbackKeyRepeated(), EditorMainLoop(), GameMainLoop(), HandleCommandKey(), HandleKeyDown(), HandleKeyModifiersDown(), HandleKeyModifiersUp(), InputKeyButtonPress(), MouseScrollMap(), PatchEditorCallbackKeyDown(), SendAttack(), SendAttackGround(), SendMove(), SendPatrol(), SendRepair(), SendResource(), SendSpellCast(), SendUnload(), UIHandleButtonDown(), UIHandleButtonUp(), and UiToggleGrabMouse().
| bool LeaveStops |
Mouse leaves windows stops scroll.
current CursorOn field
Definition at line 76 of file mouse.cpp.
Referenced by GetLeaveStops(), HandleMouseExit(), and SetLeaveStops().
| int MouseButtons |
Current pressed mouse buttons.
current active modifiers
Definition at line 67 of file mouse.cpp.
Referenced by DoSelectionButtons(), DrawInfoPanelMultipleSelected(), DrawTrainingUnits(), DrawTransportingUnits(), DrawUnitInfo(), EditorCallbackButtonDown(), EditorCallbackMouse(), EditorMainLoop(), GetButtonStatus(), InputMouseButtonPress(), InputMouseButtonRelease(), InputMouseTimeout(), UIHandleButtonDown(), UIHandleButtonUp(), UIHandleMouseMove(), and UISelectStateButtonDown().
Unit under cursor.
button area under the cursor
Definition at line 71 of file mouse.cpp.
Referenced by CleanCursors(), CleanGame(), CreateGame(), DrawInfoPanelNoneSelected(), DrawMapCursor(), DrawUnitSelection(), EditorCallbackKeyDown(), EditorCallbackMouse(), and CUnit::Remove().
1.5.6