edmisc.h

Go to the documentation of this file.
00001 /*
00002     This file is part of Advanced Strategic Command; http://www.asc-hq.de
00003     Copyright (C) 1994-2010  Martin Bickel  and  Marc Schellenberger
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program; see the file COPYING. If not, write to the 
00017     Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
00018     Boston, MA  02111-1307  USA
00019 */
00020 
00021 #ifndef edmiscH
00022 #define edmiscH
00023 
00024 #include <string.h>
00025 #include <stdlib.h>
00026 #include <cstdlib>
00027 #include <ctype.h>
00028 
00029 #include "pgpopupmenu.h"
00030 
00031 #include "typen.h"
00032 #include "basegfx.h"
00033 #include "mappolygons.h"
00034 #include "misc.h"
00035 #include "newfont.h"
00036 #include "events.h"
00037 #include "loaders.h"
00038 #include "dlg_box.h"
00039 #include "spfst.h"
00040 #include "dialog.h"
00041 #include "strtmesg.h"
00042 #include "palette.h"
00043 #include "mapalgorithms.h"
00044 
00045 
00046 extern bool mousePressedOnField( const MapCoordinate& pos, const SPoint& mousePos, bool cursorChanged, int button, int prio );
00047 extern bool mouseDraggedToField( const MapCoordinate& pos, const SPoint& mousePos, bool cursorChanged, int prio );
00048 
00049    class tputresources : public SearchFields {
00050                               int resourcetype;
00051                               int maxresource;
00052                               int minresource;
00053                               int maxdst;
00054                               MapCoordinate centerPos;
00055                            public:
00056                                void            init ( int sx , int sy, int dst, int restype, int resmax, int resmin );
00057                                virtual void    testfield ( const MapCoordinate& mc );
00058                                tputresources ( GameMap* _gamemap ) : SearchFields ( _gamemap ) {};
00059                             };
00060 
00061    class tputresourcesdlg : public tdialogbox {
00062                int resourcetype;
00063                int restp2;
00064                int maxresource;
00065                int minresource;
00066                int dist;
00067                int status;
00068             public:
00069                 void init ( void );
00070                 void run ( void );
00071                 void buttonpressed ( int id );
00072     };
00073 
00074 
00075 
00076    extern bool mapsaved;
00077 
00078 extern void         setstartvariables(void);
00079 extern void         exchg(int *a1,int *a2);
00080 extern void         k_savemap(char saveas);
00081 extern void         k_loadmap(void);
00082 extern void         lines(int      x1,int      y,int      x2,int      y2);
00083 
00084 extern void         changeunitvalues(Vehicle* ae);
00085 extern void         changeresource(void);
00086 extern void         changebuildingvalues( Building& b);
00087 extern void         changeminestrength(void);
00088 extern void         newmap(void);
00089 extern void         cargoEditor ( ContainerBase* container );
00090 // extern int          selectfield(int * cx ,int  * cy);
00091 extern void          playerchange(void);
00092 
00093 //extern void         setpolytemps (int value, ppolygon poly1); //* setzt in diesem Polygon den Tempvalue auf value
00094 extern void         editpolygon (Poly_gon& poly);
00095 // extern int        getpolygon(ppolygon *poly); //return Fehlerstatus
00096 
00097 extern MapField* getactfield();
00098 
00099 
00100 extern void selectunitsetfilter ( void );
00101 extern void movebuilding();
00102 extern void unitsettransformation( void );
00103 
00105 class MapSwitcher {
00106         int active;
00107         class Mappntr {
00108            public:
00109               GameMap* map;
00110               bool changed;
00111               MapCoordinate cursorpos;
00112               MapCoordinate windowpos;
00113               Mappntr ( ) : map ( NULL ), changed ( false ) {};
00114         } maps[2];
00115      public:
00116         enum Action { select, set };
00117 
00118         Action getDefaultAction ( );
00119         void toggle ();
00120         string getName ();
00121         void deleteMaps();
00122         MapSwitcher ( ) : active ( 0 ) {};
00123 };
00124 
00125 extern MapSwitcher mapSwitcher;
00126 
00128 extern void transformMap();
00129 
00130 extern void editArchivalInformation();
00131 
00133 extern void resourceComparison ( );
00134 
00136 extern void unitProductionLimitation();
00137 
00138 
00139 extern void saveClipboard();
00140 extern void readClipboard();
00141 extern void setweatherall ( int weather  );
00142 extern void editResearch();
00143 extern void editResearchPoints();
00144 extern void generateTechTree();
00145 extern void editTechAdapter();
00146 // extern Vehicle* selectUnitFromContainer( ContainerBase* container );
00147 // extern Vehicle*  selectUnitFromMap();
00148 // extern void resetPlayerData();
00149 
00150 extern void placeCurrentItem();
00151 extern bool removeCurrentItem();
00152 
00153 extern void locateItemByID();
00154 extern void mirrorMap();
00155 extern void copyArea();
00156 extern void pasteArea();
00157 extern void testDebugFunction();
00158 
00159 extern void selectAndRunLuaScript( const ASCString& filenamewildcard );
00160 
00161 #endif

Generated on Mon May 21 01:26:32 2012 for Advanced Strategic Command by  doxygen 1.5.1