File: edmisc.h

package info (click to toggle)
asc 2.6.1.0-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 81,740 kB
  • sloc: cpp: 158,704; sh: 11,544; ansic: 6,736; makefile: 604; perl: 138
file content (161 lines) | stat: -rw-r--r-- 5,351 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/*
    This file is part of Advanced Strategic Command; http://www.asc-hq.de
    Copyright (C) 1994-2010  Martin Bickel  and  Marc Schellenberger

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; see the file COPYING. If not, write to the 
    Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
    Boston, MA  02111-1307  USA
*/

#ifndef edmiscH
#define edmiscH

#include <string.h>
#include <stdlib.h>
#include <cstdlib>
#include <ctype.h>

#include "pgpopupmenu.h"

#include "typen.h"
#include "basegfx.h"
#include "mappolygons.h"
#include "misc.h"
#include "newfont.h"
#include "events.h"
#include "loaders.h"
#include "dlg_box.h"
#include "spfst.h"
#include "dialog.h"
#include "strtmesg.h"
#include "palette.h"
#include "mapalgorithms.h"


extern bool mousePressedOnField( const MapCoordinate& pos, const SPoint& mousePos, bool cursorChanged, int button, int prio );
extern bool mouseDraggedToField( const MapCoordinate& pos, const SPoint& mousePos, bool cursorChanged, int prio );

   class tputresources : public SearchFields {
                              int resourcetype;
                              int maxresource;
                              int minresource;
                              int maxdst;
                              MapCoordinate centerPos;
                           public:
                               void            init ( int sx , int sy, int dst, int restype, int resmax, int resmin );
                               virtual void    testfield ( const MapCoordinate& mc );
                               tputresources ( GameMap* _gamemap ) : SearchFields ( _gamemap ) {};
                            };

   class tputresourcesdlg : public tdialogbox {
               int resourcetype;
               int restp2;
               int maxresource;
               int minresource;
               int dist;
               int status;
            public:
                void init ( void );
                void run ( void );
                void buttonpressed ( int id );
    };



   extern bool mapsaved;

extern void         setstartvariables(void);
extern void         exchg(int *a1,int *a2);
extern void         k_savemap(bool saveas);
extern void         k_loadmap(void);
extern void         lines(int      x1,int      y,int      x2,int      y2);

extern void         changeunitvalues(Vehicle* ae);
extern void         changeresource(void);
extern void         changebuildingvalues( Building& b);
extern void         changeminestrength(void);
extern void         newmap(void);
extern void         cargoEditor ( ContainerBase* container );
// extern int          selectfield(int * cx ,int  * cy);
extern void 	     playerchange(void);

//extern void         setpolytemps (int value, ppolygon poly1); //* setzt in diesem Polygon den Tempvalue auf value
extern void         editpolygon (Poly_gon& poly);
// extern int        getpolygon(ppolygon *poly); //return Fehlerstatus

extern MapField* getactfield();


extern void selectunitsetfilter ( void );
extern void movebuilding();
extern void unitsettransformation( void );

//! The class that manages the switching between the primary map (for editing) and the secondary map (for selecting objects and terrain)
class MapSwitcher {
        int active;
        class Mappntr {
           public:
              GameMap* map;
              bool changed;
              MapCoordinate cursorpos;
              MapCoordinate windowpos;
              Mappntr ( ) : map ( NULL ), changed ( false ) {};
        } maps[2];
     public:
        enum Action { select, set };

        Action getDefaultAction ( );
        void toggle ();
        string getName ();
        void deleteMaps();
        MapSwitcher ( ) : active ( 0 ) {};
};

extern MapSwitcher mapSwitcher;

//! replaces the terrain and the objects on a map according to a translation table
extern void transformMap();

extern void editArchivalInformation();

//! displays a textmessage comparing the resources of all players 
extern void resourceComparison ( );

//! the function to edit the vehicle type that are allowed to be build by units
extern void unitProductionLimitation();


extern void saveClipboard();
extern void readClipboard();
extern void setweatherall ( int weather  );
extern void editResearch();
extern void editResearchPoints();
extern void generateTechTree();
extern void editTechAdapter();
// extern Vehicle* selectUnitFromContainer( ContainerBase* container );
// extern Vehicle*  selectUnitFromMap();
// extern void resetPlayerData();

extern void placeCurrentItem();
extern bool removeCurrentItem();

extern void locateItemByID();
extern void mirrorMap();
extern void copyArea();
extern void pasteArea();
extern void testDebugFunction();

extern void selectAndRunLuaScript( const ASCString& filenamewildcard );

#endif