____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 <sstream>
#include <deque>
#include "stratagus.h"
#include "unittype.h"
#include "unit_cache.h"
#include "video.h"
#include "map.h"
#include "patch.h"
#include "patch_type.h"
#include "minimap.h"
#include "settings.h"
#include "network.h"
#include "sound_server.h"
#include "ui.h"
#include "interface.h"
#include "font.h"
#include "widgets.h"
#include "editor.h"
#include "results.h"
#include "menus.h"
#include "sound.h"
#include "iolib.h"
#include "iocompat.h"
#include "replay.h"
#include "guichan.h"
#include "script.h"
Go to the source code of this file.
Classes | |
| struct | EditorAction |
| class | EditorUnitSliderListener |
| class | EditorPatchSliderListener |
Defines | |
| #define | IconSpacing (IconWidth + 2) |
| #define | UNIT_ICON_X (IconSpacing) |
| Unit mode icon. | |
| #define | UNIT_ICON_Y (0) |
| Unit mode icon. | |
| #define | PATCH_ICON_X (IconSpacing * 2) |
| Tile mode icon. | |
| #define | PATCH_ICON_Y (0) |
| Tile mode icon. | |
| #define | START_ICON_X (IconSpacing * 3) |
| Start mode icon. | |
| #define | START_ICON_Y (0) |
| Start mode icon. | |
Enumerations | |
| enum | _mode_buttons_ { SelectButton = 201, UnitButton, PatchButton, StartButton } |
| enum | EditorActionType { EditorActionTypePlaceUnit, EditorActionTypeRemoveUnit } |
Functions | |
| void | DoScrollArea (int state, bool fast) |
| void | DrawGuichanWidgets () |
| void | CleanGame () |
| static void | EditorUndoAction () |
| static void | EditorRedoAction () |
| static void | EditorAddUndoAction (EditorAction action) |
| void | InitDefinedVariables () |
| void | SetEditorSelectIcon (const std::string &icon) |
| void | SetEditorUnitsIcon (const std::string &icon) |
| void | SetEditorPatchIcon (const std::string &icon) |
| void | SetEditorStartUnit (const std::string &name) |
| Start the editor. | |
| static void | EditorActionPlaceUnit (int x, int y, CUnitType *type, CPlayer *player) |
| static void | EditorPlaceUnit (int x, int y, CUnitType *type, CPlayer *player) |
| static void | EditorActionRemoveUnit (CUnit *unit) |
| static void | EditorRemoveUnit (CUnit *unit) |
| static int | CalculateVisibleIcons () |
| static void | CalculateMaxIconSize () |
| static void | RecalculateShownUnits () |
| static void | CleanEditAi () |
| static void | DrawPlayers () |
| static void | DrawUnitIcons () |
| static void | DrawPatchIcons () |
| static void | DrawEditorPanel () |
| static void | DrawMapCursor () |
| static void | DrawStartLocations () |
| static void | ShowUnitInfo (const CUnit *unit) |
| static void | ShowPatchInfo (const CPatch *patch) |
| static void | EditorUpdateDisplay () |
| static void | EditorCallbackButtonUp (unsigned button) |
| static void | EditorCallbackButtonDown (unsigned button) |
| static void | EditorCallbackKeyDown (unsigned key, unsigned keychar) |
| static void | EditorCallbackKeyUp (unsigned key, unsigned keychar) |
| static void | EditorCallbackKeyRepeated (unsigned key, unsigned keychar) |
| static void | EditorCallbackMouse (int x, int y) |
| static void | EditorCallbackExit () |
| static void | CreatePatchIcons () |
| static void | CleanPatchIcons () |
| int | EditorSaveMap (const std::string &file) |
| Start the patch editor. | |
| static void | EditorMainLoop () |
| void | StartEditor (const std::string &filename) |
| Save a map from editor. | |
Variables | |
| CEditor | Editor |
| const char * | EditorStartFile |
| Editor CCL start file. | |
| static int | IconWidth |
| Icon width in panels. | |
| static int | IconHeight |
| Icon height in panels. | |
| static int | ButtonPanelWidth |
| static int | ButtonPanelHeight |
| static CPatch * | PatchUnderCursor |
| Patch under cursor. | |
| static int | PatchOffsetX |
| static int | PatchOffsetY |
| static bool | UnitPlacedThisPress = false |
| Only allow one unit per press. | |
| static bool | PatchPlacedThisPress = false |
| Only allow one patch per press. | |
| static bool | UpdateMinimap = false |
| Update units on the minimap. | |
| static bool | UpdateMinimapTerrain = false |
| Terrain has changed, minimap needs updating. | |
| static bool | DraggingPatch = false |
| The user is currently dragging a patch. | |
| static int | VisibleIcons |
| Number of icons that are visible at a time. | |
| static std::deque< EditorAction > | EditorUndoActions |
| static std::deque< EditorAction > | EditorRedoActions |
| gcn::Gui * | Gui |
| A Gui object - binds it all together. | |
| static gcn::Container * | editorContainer |
| static gcn::Slider * | editorUnitSlider |
| static gcn::Slider * | editorPatchSlider |
| static EditorUnitSliderListener * | editorUnitSliderListener |
| static EditorPatchSliderListener * | editorPatchSliderListener |
| static MenuScreen * | editAiMenu |
| static gcn::Label * | editAiLabel |
| static gcn::CheckBox * | editAiCheckBox |
| static gcn::Button * | editAiOKButton |
| static gcn::Button * | editAiCancelButton |
Definition in file editloop.cpp.
| #define IconSpacing (IconWidth + 2) |
Definition at line 74 of file editloop.cpp.
| #define PATCH_ICON_X (IconSpacing * 2) |
Tile mode icon.
Definition at line 77 of file editloop.cpp.
Referenced by DrawEditorPanel(), and EditorCallbackMouse().
| #define PATCH_ICON_Y (0) |
Tile mode icon.
Definition at line 78 of file editloop.cpp.
Referenced by DrawEditorPanel(), and EditorCallbackMouse().
| #define START_ICON_X (IconSpacing * 3) |
Start mode icon.
Definition at line 79 of file editloop.cpp.
Referenced by DrawEditorPanel(), and EditorCallbackMouse().
| #define START_ICON_Y (0) |
Start mode icon.
Definition at line 80 of file editloop.cpp.
Referenced by DrawEditorPanel(), and EditorCallbackMouse().
| #define UNIT_ICON_X (IconSpacing) |
Unit mode icon.
Definition at line 75 of file editloop.cpp.
Referenced by DrawEditorPanel(), and EditorCallbackMouse().
| #define UNIT_ICON_Y (0) |
Unit mode icon.
Definition at line 76 of file editloop.cpp.
Referenced by DrawEditorPanel(), and EditorCallbackMouse().
| enum _mode_buttons_ |
| SelectButton | Select mode button. |
| UnitButton | Unit mode button. |
| PatchButton | Patch mode button. |
| StartButton |
Definition at line 106 of file editloop.cpp.
| enum EditorActionType |
Definition at line 113 of file editloop.cpp.
| static void CalculateMaxIconSize | ( | ) | [static] |
Calculate the max height and the max width of icons, and assign them to IconHeight and IconWidth
Definition at line 432 of file editloop.cpp.
References Assert, CIcon::G, CGraphic::Height, IconConfig::Icon, CUnitType::Icon, IconHeight, IconWidth, int(), UnitTypeByIdent(), CEditor::UnitTypes, and CGraphic::Width.
Referenced by CEditor::Init().
| static int CalculateVisibleIcons | ( | ) | [static] |
Calculate the number of icons that can be displayed
Definition at line 405 of file editloop.cpp.
References CUserInterface::ButtonPanel, ButtonPanelHeight, ButtonPanelWidth, IconHeight, IconWidth, UI, CButtonPanel::X, and CButtonPanel::Y.
Referenced by CEditor::Init().
| static void CleanEditAi | ( | ) | [static] |
| void CleanGame | ( | void | ) |
Cleanup game.
Call each module to clean up. Contrary to CleanModules, maps can be restarted without reloading all lua files.
Definition at line 343 of file stratagus.cpp.
References CMap::Clean(), CleanAi(), CleanGroups(), CleanMessages(), CleanMissiles(), CleanReplayLog(), CleanSelections(), CleanTriggers(), CleanUnits(), CursorBuilding, EndReplayLog(), FreePathfinder(), FreeVisionTable(), Map, and UnitUnderCursor.
Referenced by StartEditor(), and StartMap().
| static void CleanPatchIcons | ( | ) | [static] |
Clean up the patch icons
Definition at line 1716 of file editloop.cpp.
References CGraphic::Free(), and CEditor::ShownPatchTypes.
Referenced by StartEditor().
| static void CreatePatchIcons | ( | ) | [static] |
Create the patch icons
Definition at line 1691 of file editloop.cpp.
References CGraphic::Clone(), CPatchType::getGraphic(), CPatchManager::getPatchType(), CPatchManager::getPatchTypeNames(), IconHeight, IconWidth, CPatchManager::loadAll(), Map, CMap::PatchManager, CGraphic::Resize(), and CEditor::ShownPatchTypes.
Referenced by CEditor::Init().
| void DoScrollArea | ( | int | state, | |
| bool | fast | |||
| ) |
Handle scrolling area.
| state | Scroll direction/state. | |
| fast | Flag scroll faster. |
Definition at line 100 of file mainloop.cpp.
References CursorX, CursorY, FRAMES_PER_SECOND, HandleMouseMove(), CViewport::MapHeight, CViewport::MapWidth, CViewport::MapX, CViewport::MapY, CViewport::OffsetX, CViewport::OffsetY, ScrollDown, ScrollLeft, ScrollNone, ScrollRight, ScrollUp, CUserInterface::SelectedViewport, CViewport::Set(), SkipFrames, TileSizeX, TileSizeY, UI, and VideoSyncSpeed.
Referenced by EditorMainLoop(), and GameMainLoop().
| static void DrawEditorPanel | ( | ) | [static] |
Draw the editor panels.
Definition at line 677 of file editloop.cpp.
References ButtonUnderCursor, DrawPatchIcons(), DrawPlayers(), CIcon::DrawUnitIcon(), DrawUnitIcons(), EditorEditPatch, EditorEditUnit, EditorSelecting, EditorSetStartLocation, CUnitType::Icon, IconConfig::Icon, IconActive, IconSelected, CUserInterface::InfoPanel, CEditor::Patch, PATCH_ICON_X, PATCH_ICON_Y, Players, CEditor::Select, SelectButton, CUserInterface::SingleSelectedButton, START_ICON_X, START_ICON_Y, StartButton, CEditor::StartUnit, CEditor::State, CUIButton::Style, UI, UNIT_ICON_X, UNIT_ICON_Y, UnitButton, CEditor::Units, CInfoPanel::X, CInfoPanel::Y, and y.
Referenced by EditorUpdateDisplay().
| void DrawGuichanWidgets | ( | ) |
Definition at line 160 of file widgets.cpp.
Referenced by EditorUpdateDisplay(), PatchEditorUpdateDisplay(), and UpdateDisplay().
| static void DrawMapCursor | ( | ) | [static] |
Draw special cursor on map.
Definition at line 734 of file editloop.cpp.
References ColorWhite, CursorBuilding, CursorX, CursorY, CVideo::DrawRectangleClip(), EditorEditPatch, EditorEditUnit, EditorSelecting, EditorSetStartLocation, CViewport::EndX, CViewport::EndY, CPatchType::getTileHeight(), CPatchType::getTileWidth(), CViewport::Map2ViewportX(), CViewport::Map2ViewportY(), CUserInterface::MouseViewport, PopClipping(), PushClipping(), CEditor::SelectedPatchIndex, CEditor::SelectedUnitIndex, SetClipping(), CEditor::ShownPatchTypes, CEditor::ShownUnitTypes, CEditor::StartUnit, CEditor::State, TileSizeX, TileSizeY, UI, UnitUnderCursor, Video, CViewport::Viewport2MapX(), CViewport::Viewport2MapY(), CViewport::X, CViewport::Y, and y.
Referenced by EditorUpdateDisplay().
| static void DrawPatchIcons | ( | ) | [static] |
Draw patch icons.
Definition at line 624 of file editloop.cpp.
References CUserInterface::ButtonPanel, ButtonPanelHeight, ButtonPanelWidth, ColorGray, ColorGreen, ColorWhite, CEditor::CursorPatchIndex, CGraphic::DrawClip(), CVideo::DrawRectangleClip(), IconHeight, IconWidth, CUserInterface::InfoPanel, CEditor::PatchIndex, CEditor::SelectedPatchIndex, CEditor::ShownPatchTypes, UI, Video, CButtonPanel::X, CInfoPanel::X, CButtonPanel::Y, CInfoPanel::Y, and y.
Referenced by DrawEditorPanel().
| static void DrawPlayers | ( | ) | [static] |
Draw a table with the players
Definition at line 508 of file editloop.cpp.
References _, ColorGray, ColorGreen, ColorWhite, CEditor::CursorPlayer, CVideo::DrawRectangle(), CVideo::FillRectangle(), GameFont, IconHeight, CMap::Info, CUserInterface::InfoPanel, Map, PlayerComputer, PlayerMax, PlayerNeutral, PlayerNobody, PlayerPerson, PlayerRescueActive, PlayerRescuePassive, Players, CMapInfo::PlayerType, CEditor::SelectedPlayer, SmallFont, UI, Video, VideoDrawText(), VideoDrawTextCentered(), CInfoPanel::X, CInfoPanel::Y, and y.
Referenced by DrawEditorPanel().
| static void DrawStartLocations | ( | ) | [static] |
Draw the start locations of all active players on the map
Definition at line 803 of file editloop.cpp.
References DrawUnitType(), CMap::Info, Map, CUserInterface::NumViewports, PlayerMax, PlayerNeutral, PlayerNobody, Players, CMapInfo::PlayerType, PopClipping(), PushClipping(), SetClipping(), CUnitType::Sprite, CEditor::StartUnit, UI, CUserInterface::Viewports, and y.
Referenced by EditorUpdateDisplay().
| static void DrawUnitIcons | ( | ) | [static] |
Draw unit icons.
Definition at line 571 of file editloop.cpp.
References CUserInterface::ButtonPanel, ButtonPanelHeight, ButtonPanelWidth, ColorGray, ColorGreen, ColorWhite, CEditor::CursorUnitIndex, CIcon::DrawIcon(), CVideo::DrawRectangleClip(), CIcon::G, CGraphic::Height, IconHeight, IconWidth, CUserInterface::InfoPanel, Players, CEditor::SelectedPlayer, CEditor::SelectedUnitIndex, CEditor::ShownUnitTypes, UI, CEditor::UnitIndex, Video, CGraphic::Width, CButtonPanel::X, CInfoPanel::X, CButtonPanel::Y, CInfoPanel::Y, and y.
Referenced by DrawEditorPanel().
Place unit.
| x | X map tile coordinate. | |
| y | Y map tile coordinate. | |
| type | Unit type to edit. | |
| player | Player owning the unit. |
Definition at line 240 of file editloop.cpp.
References DebugPrint, MakeUnitAndPlace(), CUnitType::Neutral, NoUnitP, OnTopDetails(), CBuildRestrictionOnTop::Parent, PlayerNumNeutral, Players, CUnit::Release(), CUnit::Remove(), CBuildRestrictionOnTop::ReplaceOnBuild, CUnit::ResourcesHeld, CUnitCache::Select(), UnitCache, UnitClearOrders(), UnitLost(), UnitMax, and UpdateMinimap.
Referenced by EditorPlaceUnit(), EditorRedoAction(), and EditorUndoAction().
| static void EditorActionRemoveUnit | ( | CUnit * | unit | ) | [static] |
Remove a unit
Definition at line 306 of file editloop.cpp.
References _, CUnit::Release(), CUnit::Remove(), CStatusLine::Set(), CUserInterface::StatusLine, UI, UnitClearOrders(), UnitLost(), and UpdateMinimap.
Referenced by EditorRedoAction(), EditorRemoveUnit(), and EditorUndoAction().
| static void EditorAddUndoAction | ( | EditorAction | action | ) | [static] |
Definition at line 390 of file editloop.cpp.
References EditorRedoActions, and EditorUndoActions.
Referenced by EditorPlaceUnit(), and EditorRemoveUnit().
| static void EditorCallbackButtonDown | ( | unsigned | button | ) | [static] |
Called if mouse button pressed down.
| button | Mouse button number (0 left, 1 middle, 2 right) |
Definition at line 966 of file editloop.cpp.
References _, CPatchManager::add(), ButtonAreaMenu, ButtonAreaUnderCursor, ButtonUnderCursor, CanBuildUnitType(), CStatusLine::Clear(), GameSound::Click, CursorConfig::Cursor, CursorBuilding, CursorOn, CursorOnButton, CursorOnMap, CursorOnMinimap, CEditor::CursorPatchIndex, CEditor::CursorPlayer, CursorStartX, CursorStartY, CEditor::CursorUnitIndex, CursorX, CursorY, DraggingPatch, EditorEditPatch, EditorEditUnit, EditorPlaceUnit(), EditorSelecting, EditorSetStartLocation, GameCursor, GameMenuButtonClicked, GameSounds, CPatchType::getName(), GetViewport(), CPatch::getX(), CPatch::getY(), CMap::Info, LeftButton, Map, CViewport::MapHeight, CViewport::MapWidth, MaxSampleVolume, MiddleButton, CUserInterface::Minimap, MouseButtons, MouseHoldShift, CUserInterface::MouseViewport, CMap::PatchManager, PatchOffsetX, PatchOffsetY, PatchPlacedThisPress, GameSound::PlacementError, GameSound::PlacementSuccess, PlayerNobody, Players, CMapInfo::PlayerType, PlayGameSound(), CMinimap::Screen2MapX(), CMinimap::Screen2MapY(), CUserInterface::Scroll, SelectButton, CEditor::SelectedPatchIndex, CEditor::SelectedPlayer, CEditor::SelectedUnitIndex, CUserInterface::SelectedViewport, CStatusLine::Set(), CViewport::Set(), gcn::Widget::setVisible(), CEditor::ShownPatchTypes, CEditor::ShownUnitTypes, CEditor::ShowPatchOutlines, SoundConfig::Sound, StartButton, CPlayer::StartX, CPlayer::StartY, CEditor::State, CUserInterface::StatusLine, ThisPlayer, TileSizeX, TileSizeY, UI, UnitButton, UnitPlacedThisPress, UpdateMinimapTerrain, CViewport::Viewport2MapX(), and CViewport::Viewport2MapY().
Referenced by EditorMainLoop(), and CEditor::Init().
| static void EditorCallbackButtonUp | ( | unsigned | button | ) | [static] |
Callback for input.
Definition at line 933 of file editloop.cpp.
References LuaActionListener::action(), ButtonUnderCursor, ButtonUnderMenu, CUIButton::Callback, CursorConfig::Cursor, DraggingPatch, GameCursor, GameMenuButtonClicked, LeftButton, CUserInterface::MenuButton, PatchPlacedThisPress, CUserInterface::Point, CUserInterface::Scroll, UI, and UnitPlacedThisPress.
Referenced by CEditor::Init().
| static void EditorCallbackExit | ( | ) | [static] |
| static void EditorCallbackKeyDown | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) | [static] |
Handle key down.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 1167 of file editloop.cpp.
References _, CUnit::ChangeOwner(), CursorX, CursorY, CycleViewportMode(), EditorRedoAction(), EditorRemoveUnit(), EditorUndoAction(), Exit(), CPatchManager::getPatch(), HandleCommandKey(), HandleKeyModifiersDown(), CMap::Info, KeyModifiers, KeyScrollState, Map, ModifierAlt, ModifierControl, CMap::PatchManager, PlayerNobody, Players, CMapInfo::PlayerType, CPatchManager::remove(), ScrollDown, ScrollLeft, ScrollRight, ScrollUp, CUserInterface::SelectedViewport, CStatusLine::Set(), CUserInterface::StatusLine, ToggleFullScreen(), UI, UnitUnderCursor, UpdateMinimap, UpdateMinimapTerrain, CViewport::Viewport2MapX(), and CViewport::Viewport2MapY().
Referenced by CEditor::Init().
| static void EditorCallbackKeyRepeated | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) | [static] |
Callback for input.
Definition at line 1306 of file editloop.cpp.
References EditorRedoAction(), EditorUndoAction(), KeyModifiers, and ModifierControl.
Referenced by CEditor::Init().
| static void EditorCallbackKeyUp | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) | [static] |
Handle key up.
| key | Key scancode. | |
| keychar | Character code. |
Definition at line 1273 of file editloop.cpp.
References HandleKeyModifiersUp(), KeyScrollState, ScrollDown, ScrollLeft, ScrollRight, and ScrollUp.
Referenced by CEditor::Init().
| static void EditorCallbackMouse | ( | int | x, | |
| int | y | |||
| ) | [static] |
Callback for input movement of the cursor.
| x | Screen X position. | |
| y | Screen Y position. |
Definition at line 1331 of file editloop.cpp.
References _, ButtonAreaMenu, ButtonAreaUnderCursor, CUserInterface::ButtonPanel, ButtonPanelHeight, ButtonUnderCursor, ButtonUnderMenu, CanBuildUnitType(), CStatusLine::Clear(), CursorConfig::Cursor, CursorBuilding, CursorOn, CursorOnButton, CursorOnMap, CursorOnMinimap, CursorOnUnknown, CEditor::CursorPatchIndex, CEditor::CursorPlayer, CEditor::CursorUnitIndex, CursorX, CursorY, EditorEditPatch, EditorEditUnit, EditorPlaceUnit(), EditorSelecting, EditorSetStartLocation, CMapArea::EndX, CViewport::EndX, CMapArea::EndY, CViewport::EndY, GameCursor, CPatchType::getName(), CPatchManager::getPatch(), CPatchType::getTileHeight(), CPatchType::getTileWidth(), GetViewport(), CMinimap::H, HandleCursorMove(), HandleMouseScrollArea(), IconHeight, IconWidth, CMap::Info, CUserInterface::InfoPanel, LeftButton, Map, CUserInterface::MapArea, CViewport::MapHeight, CViewport::MapWidth, CViewport::MapX, CViewport::MapY, CUserInterface::MenuButton, CUserInterface::Minimap, MouseButtons, MouseScrollMap(), MouseScrollState, CUserInterface::MouseViewport, CPatchManager::move(), CViewport::OffsetX, CViewport::OffsetY, PATCH_ICON_X, PATCH_ICON_Y, CEditor::PatchIndex, CMap::PatchManager, PatchOffsetX, PatchOffsetY, PlayerMax, PlayerNobody, Players, CMapInfo::PlayerType, CUserInterface::Point, RestrictCursorToMinimap(), RestrictCursorToViewport(), CMinimap::Screen2MapX(), CMinimap::Screen2MapY(), CUserInterface::Scroll, ScrollNone, SelectButton, CEditor::SelectedPlayer, CUserInterface::SelectedViewport, CStatusLine::Set(), CViewport::Set(), CEditor::ShownPatchTypes, CEditor::ShownUnitTypes, ShowPatchInfo(), ShowUnitInfo(), START_ICON_X, START_ICON_Y, StartButton, CEditor::State, CUserInterface::StatusLine, TileSizeX, TileSizeY, UI, UNIT_ICON_X, UNIT_ICON_Y, UnitButton, CEditor::UnitIndex, UnitOnScreen(), UnitPlacedThisPress, UnitUnderCursor, UpdateMinimapTerrain, CViewport::Viewport2MapX(), CViewport::Viewport2MapY(), CMinimap::W, CViewport::X, CMapArea::X, CUIButton::X, CInfoPanel::X, CButtonPanel::X, CMinimap::X, CViewport::Y, CMapArea::Y, CUIButton::Y, CInfoPanel::Y, CButtonPanel::Y, and CMinimap::Y.
Referenced by CEditor::Init().
| static void EditorMainLoop | ( | ) | [static] |
Editor main event loop.
Definition at line 1876 of file editloop.cpp.
References gcn::Container::add(), gcn::Widget::addActionListener(), CUserInterface::ButtonPanel, CheckMusicFinished(), CleanModules(), CVideo::ClearScreen(), CommandLogDisabled, CursorConfig::Cursor, CursorOn, CursorOnMap, DoScrollArea(), DraggingPatch, EditorCallbackButtonDown(), EditorCallbacks, EditorEditing, EditorEditUnit, EditorSelecting, EditorUpdateDisplay(), FrameCounter, FRAMES_PER_SECOND, GameCursor, GetCallbacks(), gcn::Gui::getTop(), CVideo::Height, IfaceStateMenu, IfaceStateNormal, CEditor::Init(), InitDefinedVariables(), InterfaceState, Invalidate(), KeyModifiers, CUserInterface::KeyScroll, KeyScrollState, LeftButton, LoadCcl(), CEditor::MapLoaded, CUserInterface::Minimap, ModifierControl, MouseButtons, CUserInterface::MouseScroll, MouseScrollState, CUserInterface::Point, PreMenuSetup(), CEditor::Running, ScrollNone, CUserInterface::SelectedViewport, gcn::Widget::setBackgroundColor(), gcn::Widget::setBaseColor(), SetCallbacks(), gcn::Widget::setDimension(), gcn::Widget::setForegroundColor(), gcn::Container::setOpaque(), gcn::Widget::setSize(), gcn::Gui::setTop(), SetVideoSync(), gcn::Widget::setVisible(), CEditor::State, UI, CMinimap::Update(), UpdateMinimap, UpdateMinimapTerrain, CMinimap::UpdateTerrain(), Video, CUserInterface::Viewports, WaitEventsOneFrame(), CVideo::Width, CButtonPanel::X, and CButtonPanel::Y.
Referenced by StartEditor().
Edit unit.
| x | X map tile coordinate. | |
| y | Y map tile coordinate. | |
| type | Unit type to edit. | |
| player | Player owning the unit. |
Definition at line 290 of file editloop.cpp.
References EditorActionPlaceUnit(), EditorActionTypePlaceUnit, EditorAddUndoAction(), EditorAction::Player, EditorAction::Type, EditorAction::UnitType, EditorAction::X, and EditorAction::Y.
Referenced by EditorCallbackButtonDown(), and EditorCallbackMouse().
| static void EditorRedoAction | ( | ) | [static] |
Definition at line 363 of file editloop.cpp.
References EditorActionPlaceUnit(), EditorActionRemoveUnit(), EditorActionTypePlaceUnit, EditorActionTypeRemoveUnit, EditorRedoActions, EditorUndoActions, EditorAction::Player, EditorAction::Type, UnitOnMapTile(), CUnitType::UnitType, EditorAction::UnitType, EditorAction::X, and EditorAction::Y.
Referenced by EditorCallbackKeyDown(), and EditorCallbackKeyRepeated().
| static void EditorRemoveUnit | ( | CUnit * | unit | ) | [static] |
Remove a unit
Definition at line 319 of file editloop.cpp.
References EditorActionRemoveUnit(), EditorActionTypeRemoveUnit, EditorAddUndoAction(), CUnit::Player, EditorAction::Player, CUnit::Type, EditorAction::Type, EditorAction::UnitType, CUnit::X, EditorAction::X, CUnit::Y, and EditorAction::Y.
Referenced by EditorCallbackKeyDown().
| int EditorSaveMap | ( | const std::string & | file | ) |
Start the patch editor.
Save a map from editor.
| file | Save the level to this file. |
Definition at line 1855 of file editloop.cpp.
References Map, SaveStratagusMap(), and StratagusLibPath.
Referenced by tolua_stratagus_EditorSaveMap00().
| static void EditorUndoAction | ( | ) | [static] |
Definition at line 336 of file editloop.cpp.
References EditorActionPlaceUnit(), EditorActionRemoveUnit(), EditorActionTypePlaceUnit, EditorActionTypeRemoveUnit, EditorRedoActions, EditorUndoActions, EditorAction::Player, EditorAction::Type, UnitOnMapTile(), CUnitType::UnitType, EditorAction::UnitType, EditorAction::X, and EditorAction::Y.
Referenced by EditorCallbackKeyDown(), and EditorCallbackKeyRepeated().
| static void EditorUpdateDisplay | ( | ) | [static] |
Update editor display.
Definition at line 865 of file editloop.cpp.
References ButtonAreaMenu, ButtonAreaUnderCursor, CUserInterface::ButtonPanel, ButtonUnderCursor, ButtonUnderMenu, CursorOn, CursorOnMap, CStatusLine::Draw(), CMinimap::Draw(), CGraphic::DrawClip(), DrawCursor(), CMinimap::DrawCursor(), DrawEditorPanel(), DrawGuichanWidgets(), DrawMapArea(), DrawMapCursor(), DrawMenuButton(), DrawStartLocations(), CUserInterface::Fillers, CButtonPanel::G, GameMenuButtonClicked, gcn::Gui::getTop(), int(), Invalidate(), CViewport::MapX, CViewport::MapY, CUserInterface::MenuButton, MI_FLAGS_ACTIVE, MI_FLAGS_CLICKED, CUserInterface::Minimap, RealizeVideoMemory(), CUserInterface::SelectedViewport, CUserInterface::StatusLine, CUIButton::Style, CUIButton::Text, UI, CButtonPanel::X, CUIButton::X, CButtonPanel::Y, and CUIButton::Y.
Referenced by EditorMainLoop().
| void InitDefinedVariables | ( | ) |
Define already variables, useful for drawing now.
Definition at line 1351 of file script_unittype.cpp.
Referenced by EditorMainLoop(), and UnitTypeCclRegister().
| static void RecalculateShownUnits | ( | ) | [static] |
Recalculate the shown units.
Definition at line 459 of file editloop.cpp.
References CEditor::CursorUnitIndex, int(), CEditor::SelectedUnitIndex, CEditor::ShownUnitTypes, CEditor::UnitIndex, UnitTypeByIdent(), CEditor::UnitTypes, and VisibleIcons.
Referenced by CEditor::Init().
| void SetEditorPatchIcon | ( | const std::string & | icon | ) |
Set the editor's patch icon
| icon | The icon to use. |
Definition at line 213 of file editloop.cpp.
References IconConfig::Name, and CEditor::Patch.
Referenced by tolua_stratagus_SetEditorPatchIcon00().
| void SetEditorSelectIcon | ( | const std::string & | icon | ) |
Set the editor's select icon
| icon | The icon to use. |
Definition at line 193 of file editloop.cpp.
References IconConfig::Name, and CEditor::Select.
Referenced by tolua_stratagus_SetEditorSelectIcon00().
| void SetEditorStartUnit | ( | const std::string & | name | ) |
Start the editor.
Set the editor's start location unit
| name | The name of the unit to use. |
Definition at line 223 of file editloop.cpp.
References CEditor::StartUnitName.
Referenced by tolua_stratagus_SetEditorStartUnit00().
| void SetEditorUnitsIcon | ( | const std::string & | icon | ) |
Set the editor's units icon
| icon | The icon to use. |
Definition at line 203 of file editloop.cpp.
References IconConfig::Name, and CEditor::Units.
Referenced by tolua_stratagus_SetEditorUnitsIcon00().
| static void ShowPatchInfo | ( | const CPatch * | patch | ) | [static] |
Show info about a patch.
| patch | Patch pointer. |
Definition at line 852 of file editloop.cpp.
References _, CPatchType::getName(), CPatch::getType(), CPatch::getX(), CPatch::getY(), CStatusLine::Set(), CUserInterface::StatusLine, and UI.
Referenced by EditorCallbackMouse().
| static void ShowUnitInfo | ( | const CUnit * | unit | ) | [static] |
Show info about unit.
| unit | Unit pointer. |
Definition at line 830 of file editloop.cpp.
References _, CUnitType::CanHarvestFrom, CYCLES_PER_SECOND, DefaultResourceNames, CPlayer::Index, CUnitType::Name, CUnit::Player, CUnitType::ProductionCosts, CUnit::ResourcesHeld, CStatusLine::Set(), CUserInterface::StatusLine, CUnit::Type, UI, and UnitNumber.
Referenced by EditorCallbackMouse().
| void StartEditor | ( | const std::string & | filename | ) |
Save a map from editor.
Start the editor
| filename | Map to load, empty string to create a new map |
Definition at line 2007 of file editloop.cpp.
References _C_, CleanEditAi(), CleanGame(), CleanPatchIcons(), CleanPlayers(), CVideo::ClearScreen(), CurrentMapPath, DebugPrint, CMapInfo::Description, EditorMainLoop(), GetDefaultTextColors(), CMap::Info, Invalidate(), Map, CMapInfo::MapHeight, CMapInfo::MapWidth, MaxMapHeight, MaxMapWidth, SetDefaultTextColors(), strcpy_s(), and Video.
Referenced by tolua_stratagus_StartEditor00().
int ButtonPanelHeight [static] |
Definition at line 94 of file editloop.cpp.
Referenced by CalculateVisibleIcons(), DrawPatchIcons(), DrawUnitIcons(), EditorCallbackMouse(), and CEditor::Init().
int ButtonPanelWidth [static] |
Definition at line 93 of file editloop.cpp.
Referenced by CalculateVisibleIcons(), DrawPatchIcons(), DrawUnitIcons(), and CEditor::Init().
bool DraggingPatch = false [static] |
The user is currently dragging a patch.
Definition at line 103 of file editloop.cpp.
Referenced by EditorCallbackButtonDown(), EditorCallbackButtonUp(), and EditorMainLoop().
gcn::Button* editAiCancelButton [static] |
Definition at line 485 of file editloop.cpp.
gcn::CheckBox* editAiCheckBox [static] |
Definition at line 483 of file editloop.cpp.
gcn::Label* editAiLabel [static] |
Definition at line 482 of file editloop.cpp.
MenuScreen* editAiMenu [static] |
Definition at line 481 of file editloop.cpp.
gcn::Button* editAiOKButton [static] |
Definition at line 484 of file editloop.cpp.
Definition at line 86 of file editloop.cpp.
Referenced by DrawBuildingCursor(), DrawCursor(), DrawGuichanWidgets(), CViewport::DrawMapBackgroundInViewport(), DrawUnitOn(), DrawUnitSelection(), HideCursor(), MenuScreen::stop(), tolua_get_Editor(), tolua_set_Editor(), UpdateDisplay(), and WaitEventsOneFrame().
gcn::Container* editorContainer [static] |
Definition at line 136 of file editloop.cpp.
gcn::Slider* editorPatchSlider [static] |
Definition at line 138 of file editloop.cpp.
Definition at line 180 of file editloop.cpp.
std::deque<EditorAction> EditorRedoActions [static] |
Definition at line 129 of file editloop.cpp.
Referenced by EditorAddUndoAction(), EditorRedoAction(), EditorUndoAction(), and CEditor::Init().
| const char* EditorStartFile |
Editor CCL start file.
Definition at line 88 of file editloop.cpp.
Referenced by CEditor::Init(), and main().
std::deque<EditorAction> EditorUndoActions [static] |
Definition at line 128 of file editloop.cpp.
Referenced by EditorAddUndoAction(), EditorRedoAction(), EditorUndoAction(), and CEditor::Init().
gcn::Slider* editorUnitSlider [static] |
Definition at line 137 of file editloop.cpp.
Definition at line 159 of file editloop.cpp.
A Gui object - binds it all together.
Definition at line 51 of file widgets.cpp.
Referenced by initGuichan().
int IconHeight [static] |
Icon height in panels.
Definition at line 91 of file editloop.cpp.
Referenced by CalculateMaxIconSize(), CalculateVisibleIcons(), CreatePatchIcons(), DrawPatchIcons(), DrawPlayers(), DrawUnitIcons(), and EditorCallbackMouse().
int IconWidth [static] |
Icon width in panels.
Definition at line 90 of file editloop.cpp.
Referenced by CalculateMaxIconSize(), CalculateVisibleIcons(), CreatePatchIcons(), DrawPatchIcons(), DrawUnitIcons(), and EditorCallbackMouse().
int PatchOffsetX [static] |
Definition at line 97 of file editloop.cpp.
Referenced by EditorCallbackButtonDown(), and EditorCallbackMouse().
int PatchOffsetY [static] |
Definition at line 98 of file editloop.cpp.
Referenced by EditorCallbackButtonDown(), and EditorCallbackMouse().
bool PatchPlacedThisPress = false [static] |
Only allow one patch per press.
Definition at line 100 of file editloop.cpp.
Referenced by EditorCallbackButtonDown(), and EditorCallbackButtonUp().
CPatch* PatchUnderCursor [static] |
bool UnitPlacedThisPress = false [static] |
Only allow one unit per press.
Definition at line 99 of file editloop.cpp.
Referenced by EditorCallbackButtonDown(), EditorCallbackButtonUp(), and EditorCallbackMouse().
bool UpdateMinimap = false [static] |
Update units on the minimap.
Definition at line 101 of file editloop.cpp.
Referenced by EditorActionPlaceUnit(), EditorActionRemoveUnit(), EditorCallbackKeyDown(), and EditorMainLoop().
bool UpdateMinimapTerrain = false [static] |
Terrain has changed, minimap needs updating.
Definition at line 102 of file editloop.cpp.
Referenced by EditorCallbackButtonDown(), EditorCallbackKeyDown(), EditorCallbackMouse(), and EditorMainLoop().
int VisibleIcons [static] |
Number of icons that are visible at a time.
Definition at line 104 of file editloop.cpp.
Referenced by EditorPatchSliderListener::action(), EditorUnitSliderListener::action(), CEditor::Init(), and RecalculateShownUnits().
1.5.6