Advanced Strategic Command
Classes | Functions | Variables
edmisc.cpp File Reference

various functions for the mapeditor More...

#include <string>
#include <iostream>
#include <math.h>
#include "sdl/graphics.h"
#include "vehicletype.h"
#include "buildingtype.h"
#include "edmisc.h"
#include "loadbi3.h"
#include "edgen.h"
#include "edselfnt.h"
#include "edglobal.h"
#include "dialogs/pwd_dlg.h"
#include "mapdisplay.h"
#include "graphicset.h"
#include "itemrepository.h"
#include "textfileparser.h"
#include "textfile_evaluation.h"
#include "textfiletags.h"
#include "clipboard.h"
#include "dialogs/cargowidget.h"
#include "dialogs/fieldmarker.h"
#include "dialogs/newmap.h"
#include "stack.h"
#include "unitset.h"
#include "maped-mainscreen.h"
#include "gameevents.h"
#include "gameevent_dialogs.h"
#include "dialogs/fileselector.h"
#include "pgeventsupplier.h"
#include "dialogs/edittechadapter.h"
#include "spfst-legacy.h"
#include "lua/luarunner.h"
#include "lua/luastate.h"
#include "widgets/multilistbox.h"
Include dependency graph for edmisc.cpp:

Go to the source code of this file.

Classes

class  tplayerchange
 
class  ShowPolygonUsingTemps
 
class  PolygonEditor
 
class  BuildingValues
 
class  StringSelector
 
class  EditAiParam
 
class  tres
 
class  tminestrength
 
class  SelectUnitSetFilter
 
class  UnitTypeTransformation
 
class  EditArchivalInformation
 
class  ItemLocator
 
class  MirrorMap
 
class  CopyMap
 

Functions

void placeCurrentItem ()
 
bool removeCurrentItem ()
 
bool mousePressedOnField (const MapCoordinate &pos, const SPoint &mousePos, bool cursorChanged, int button, int prio)
 
bool mouseDraggedToField (const MapCoordinate &pos, const SPoint &mousePos, bool cursorChanged, int prio)
 
Uint8 checkobject (MapField *pf)
 
void lines (int x1, int y1, int x2, int y2)
 
void playerchange (void)
 
void exchg (int *a1, int *a2)
 
void k_savemap (bool saveas)
 
void k_loadmap (void)
 
void selectUnitFromMap (GameMap *gamemap, MapCoordinate &pos)
 
void setstartvariables (void)
 
void editpolygon (Poly_gon &poly)
 
void newmap (void)
 
void changebuildingvalues (Building &b)
 
int selectString (int lc, const char *title, const char **text, int itemNum)
 
void unitAiProperties (Vehicle *veh)
 
void changeresource (void)
 
void changeminestrength (void)
 
void movebuilding (void)
 
void selectunitsetfilter (void)
 
void unitsettransformation (void)
 
VehicleTypetransform (int id, const vector< int > &translation)
 
void transformMap ()
 replaces the terrain and the objects on a map according to a translation table More...
 
void editArchivalInformation ()
 
void resourceComparison ()
 displays a textmessage comparing the resources of all players More...
 
void readClipboard ()
 
void saveClipboard ()
 
void setweatherall (int weather)
 
ASCString printTech (int id)
 
void editResearch ()
 
void editResearchPoints ()
 
void generateTechTree ()
 
void editTechAdapter ()
 
MapFieldgetactfield (void)
 
void locateItemByID ()
 
void copyVehicleData (Vehicle *source, Vehicle *target, GameMap *targetMap, int *playerTranslation)
 
void copyBuildingData (Building *source, Building *target, GameMap *targetMap, int *playerTranslation, bool mirrorUnits)
 
void copyFieldStep1 (MapField *sourceField, MapField *targetField, bool mirrorTerrain, bool mirrorResources, bool mirrorWeather)
 
void copyFieldStep2 (MapField *sourceField, MapField *targetField, GameMap *targetMap, int *directionTranslation, int *playerTranslation, bool mirrorObjects, bool mirrorBuildings, bool mirrorUnits, bool mirrorMines)
 
void mirrorMap ()
 
void copyArea ()
 
void pasteArea ()
 
void selectAndRunLuaScript (const ASCString &filenamewildcard)
 
void testDebugFunction ()
 

Variables

bool mapsaved
 
MapSwitcher mapSwitcher
 
CopyMapcopyMap = NULL
 

Detailed Description

various functions for the mapeditor

Definition in file edmisc.cpp.

Function Documentation

void changebuildingvalues ( Building b)

Definition at line 1141 of file edmisc.cpp.

References displaymap(), tdialogbox::done(), BuildingValues::init(), and BuildingValues::run().

Referenced by execaction().

void changeminestrength ( void  )

Definition at line 1636 of file edmisc.cpp.

References tdialogbox::done(), getactfield(), tminestrength::init(), and tminestrength::run().

Referenced by execaction().

void changeresource ( void  )

Definition at line 1561 of file edmisc.cpp.

References tdialogbox::done(), tres::init(), and tres::run().

Referenced by execaction().

Uint8 checkobject ( MapField pf)

Definition at line 114 of file edmisc.cpp.

References MapField::objects.

void copyArea ( )

Definition at line 3735 of file edmisc.cpp.

Referenced by execaction_pg().

void copyBuildingData ( Building source,
Building target,
GameMap targetMap,
int *  playerTranslation,
bool  mirrorUnits 
)
void copyFieldStep1 ( MapField sourceField,
MapField targetField,
bool  mirrorTerrain,
bool  mirrorResources,
bool  mirrorWeather 
)
void copyFieldStep2 ( MapField sourceField,
MapField targetField,
GameMap targetMap,
int *  directionTranslation,
int *  playerTranslation,
bool  mirrorObjects,
bool  mirrorBuildings,
bool  mirrorUnits,
bool  mirrorMines 
)
void copyVehicleData ( Vehicle source,
Vehicle target,
GameMap targetMap,
int *  playerTranslation 
)
void editArchivalInformation ( )
void editpolygon ( Poly_gon poly)

Definition at line 807 of file edmisc.cpp.

Referenced by CopyMap::selectArea(), and FieldAddressing::setup().

void editResearch ( )
void editResearchPoints ( )
void editTechAdapter ( )

Definition at line 2728 of file edmisc.cpp.

References actmap, chooseString(), editTechAdapter(), Player::getName(), GameMap::player, and strrr().

Referenced by editTechAdapter().

void exchg ( int *  a1,
int *  a2 
)

Definition at line 498 of file edmisc.cpp.

void generateTechTree ( )
MapField* getactfield ( void  )
void k_loadmap ( void  )

Definition at line 629 of file edmisc.cpp.

Referenced by execaction_pg().

void k_savemap ( bool  saveas)

Definition at line 607 of file edmisc.cpp.

Referenced by execaction_pg(), and mapeditorMainThread().

void lines ( int  x1,
int  y1,
int  x2,
int  y2 
)

Definition at line 223 of file edmisc.cpp.

References darkgray, line(), and white.

void locateItemByID ( )

Definition at line 2857 of file edmisc.cpp.

References ASC_PG_Dialog::RunModal().

Referenced by execaction_pg().

void mirrorMap ( )

Definition at line 3235 of file edmisc.cpp.

References actmap, displaymap(), tdialogbox::done(), MirrorMap::init(), mapChanged, and MirrorMap::run().

Referenced by execaction_pg().

bool mouseDraggedToField ( const MapCoordinate pos,
const SPoint mousePos,
bool  cursorChanged,
int  prio 
)

Definition at line 103 of file edmisc.cpp.

References act_primaryAction, and execaction_ev().

Referenced by Maped_MainScreenWidget::Maped_MainScreenWidget().

bool mousePressedOnField ( const MapCoordinate pos,
const SPoint mousePos,
bool  cursorChanged,
int  button,
int  prio 
)

Definition at line 91 of file edmisc.cpp.

References act_primaryAction, and execaction_ev().

Referenced by Maped_MainScreenWidget::Maped_MainScreenWidget().

void movebuilding ( void  )
void newmap ( void  )

Definition at line 827 of file edmisc.cpp.

References actmap, createNewMap(), and mapChanged.

Referenced by execaction_pg().

void pasteArea ( )

Definition at line 3745 of file edmisc.cpp.

References actmap, displaymap(), and mapChanged.

Referenced by execaction_pg().

void placeCurrentItem ( )
void playerchange ( void  )

Definition at line 485 of file edmisc.cpp.

References actmap, tdialogbox::done(), tplayerchange::init(), mapChanged, and tplayerchange::run().

Referenced by execaction().

ASCString printTech ( int  id)

Definition at line 2526 of file edmisc.cpp.

References ASCString::format(), Technology::name, and technologyRepository.

Referenced by editResearch(), and generateTechTree().

void readClipboard ( )
bool removeCurrentItem ( )
void resourceComparison ( )
void saveClipboard ( )

Definition at line 2508 of file edmisc.cpp.

References clipboardFileExtension, selectFile(), and tnstream::writing.

Referenced by execaction().

void selectAndRunLuaScript ( const ASCString filenamewildcard)
int selectString ( int  lc,
const char *  title,
const char **  text,
int  itemNum 
)
void selectUnitFromMap ( GameMap gamemap,
MapCoordinate pos 
)

Definition at line 664 of file edmisc.cpp.

References ASC_PG_Dialog::RunModal(), and SelectFromMap::Show().

void selectunitsetfilter ( void  )
void setstartvariables ( void  )
void setweatherall ( int  weather)

Definition at line 2518 of file edmisc.cpp.

References actmap, GameMap::getField(), MapField::setWeather(), GameMap::xsize, and GameMap::ysize.

Referenced by execaction().

void testDebugFunction ( )
VehicleType* transform ( int  id,
const vector< int > &  translation 
)
void transformMap ( )
void unitAiProperties ( Vehicle veh)

Definition at line 1474 of file edmisc.cpp.

References Vehicle::aiparam, getid(), EditAiParam::init(), and EditAiParam::run().

void unitsettransformation ( void  )

Definition at line 1996 of file edmisc.cpp.

References UnitTypeTransformation::run().

Referenced by execaction().

Variable Documentation

CopyMap* copyMap = NULL

Definition at line 3733 of file edmisc.cpp.

bool mapsaved
MapSwitcher mapSwitcher

Definition at line 2071 of file edmisc.cpp.

Referenced by execaction(), execaction_pg(), main(), and mapeditorMainThread().