Skip to content

Commit 39f3be6

Browse files
committed
Initial commit for version 2.0.
- Relicensed from GPLv3 to GPLv2. - Updated Starkku.Utilities.dll. - Updated LCW.cs implementation. - Moved map tool & map file logic from MapTool project to new one called MapTool.Logic. - Moved general map file logic from MapTool to a new class called MapFile. - Refactored map object handling, now parsed as objects. - MapTool.UI no longer launches the command-line map tool but calls MapFileTool class directly. - Added context menus to list boxes & logger text box in UI with options like show in file explorer, open file etc. - Changing tabs while maps are processing is no longer allowed. - Logger text box retains focus for as long as maps are processing. - Select main tab when adding maps to list via drag & drop. - Closing application while maps are being processed now prompts with a message box before closing with an option to cancel. - Fixed an issue with calculating value ranges for tile / overlay conversion rules when only a first value declares a range. - Tile conversion rules now accept two additional value ranges for current sub-tile indices & new sub-tile indices. Old sub-tile index override takes priority over latter if set. - Object conversion rules now accept comma-separated list of upgrade filters, separated from the values by +. * is a wildcard and None matches an empty upgrade slot.
1 parent 24f3ed7 commit 39f3be6

38 files changed

+4538
-2513
lines changed

Build.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools\MSBuild\Cu
4444

4545
rd /S /Q Compiled\Profiles
4646

47-
xcopy /y MapTool.UI\bin\Release\MapTool.exe Compiled\MapTool.exe*
47+
xcopy /y MapTool\bin\Release\MapTool.exe Compiled\MapTool.exe*
4848
xcopy /y MapTool.UI\bin\Release\MapTool.UI.exe Compiled\MapTool.UI.exe*
49-
xcopy /y MapTool.UI\bin\Release\StarkkuUtils.dll Compiled\StarkkuUtils.dll*
49+
xcopy /y MapTool\bin\Release\MapTool.Logic.dll Compiled\MapTool.Logic.dll*
50+
xcopy /y MapTool\bin\Release\Starkku.Utilities.dll Compiled\Starkku.Utilities.dll*
5051
xcopy /y /i MapTool.UI\bin\Release\Profiles Compiled\Profiles

COPYING.txt

Lines changed: 0 additions & 674 deletions
This file was deleted.

Conversion-Profile-Documentation.md

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ If set to yes / true, removes all clear tiles at lowest elevation level (0). Sin
8585

8686
### TileRules
8787

88-
A list of tile index conversion rules, each on it's own line with | as separator between source and destination value, as well as optional height override and sub-tile index override values. Can also be prefixed by a tile coordinate filter in brackets, _f.ex (X,Y)_.
88+
A list of tile index conversion rules, each on its own line with | as separator between source and destination value, as well as optional height override and sub-tile index override values. Can also be prefixed by a tile coordinate filter in brackets, _f.ex (X,Y)_.
8989

9090
To assist in figuring out the numbers to use, MapTool can be run with command line parameter *-l* with a game theater configuration INI (such as temperat(md).ini) as input file to extract a listing of tiles and their tile indices to a plaintext output file.
9191

@@ -157,12 +157,24 @@ This randomly assigns new tile index from range 25 to 45 to tiles 0-15, as well
157157
(32,*)16-20|50-54
158158
</pre>
159159

160-
Tiles 0-15 will get converted to tiles 25-40, respectively, but only at specific tile coordinate X = 25, Y = 50.
161-
Tiles 16-20 will get converted to tiles 50-54, respectively, but only at specific tile coordinates where X = 32.
160+
Tiles 0-15 will get converted to tiles 25-40, respectively, but only at specific tile coordinate X = 25, Y = 50.
161+
Tiles 16-20 will get converted to tiles 50-54, respectively, but only at specific tile coordinates where X = 32.
162+
163+
**Example #9:**
164+
<pre>
165+
[TileRules]
166+
0-15|25-40|*|*|*|0-3|1-1
167+
16-20|50-54|*|*|*|1|2
168+
21|60|3|*|*|1|2
169+
</pre>
170+
171+
Tiles 0-15 will get converted to tiles 25-40 but only for tiles using sub-tiles 0-3, which will also get converted to using sub-tile 1.
172+
Tiles 16-20 will get converted to tiles 50-54 but only for tiles using sub-tile 1, which will also get converted to using sub-tile 2.
173+
Tile 21 will get converted to tile 60 but only for tiles using sub-tile 1, which gets converted to sub-tile 3 because sub-tile index override has been defined and takes precedence over the target sub-tile range which has been set to 2.
162174

163175
### OverlayRules
164176

165-
A list of overlay ID conversion rules, each on it's own line with a | as a separator between source and destination value. Can also be prefixed by a tile coordinate filter in brackets, _f.ex (X,Y)_.
177+
A list of overlay ID conversion rules, each on its own line with a | as a separator between source and destination value. Can also be prefixed by a tile coordinate filter in brackets, _f.ex (X,Y)_.
166178

167179
**Example:**
168180
<pre>
@@ -176,78 +188,92 @@ A list of overlay ID conversion rules, each on it's own line with a | as a separ
176188
(32,*)31|53
177189
</pre>
178190

179-
Overlays with ID 0 are converted to overlays with ID 5.
180-
Overlays with ID 15 are randomly assigned new ID from range of 20 to 30, likewise for overlays with ID in range of 16 to 19.
181-
Overlays with ID 6 will have their frame data for frames 0 to 2 changed to 12.
182-
Overlays with ID 8 will have their frame data for frames 0 to 255 changed to randomly assigned value from 0 to 50.
183-
Overlay with ID 20 will be converted to overlay with ID 52, but only at tile coordinate where X = 25 and Y = 50.
184-
Overlay with ID 31 will be converted to overlay with ID 64, but only at tile coordinates where X = 32.
191+
Overlays with ID 0 are converted to overlays with ID 5.
192+
Overlays with ID 15 are randomly assigned new ID from range of 20 to 30, likewise for overlays with ID in range of 16 to 19.
193+
Overlays with ID 6 will have their frame data for frames 0 to 2 changed to 12.
194+
Overlays with ID 8 will have their frame data for frames 0 to 255 changed to randomly assigned value from 0 to 50.
195+
Overlay with ID 20 will be converted to overlay with ID 52, but only at tile coordinate where X = 25 and Y = 50.
196+
Overlay with ID 31 will be converted to overlay with ID 64, but only at tile coordinates where X = 32.
185197

186198
ID values from 0 to 254 are available for for regular use. Using 255 as destination ID will remove overlays. 255 as a source ID is ignored unless tile coordinate filter is in use. Frame values from 0 to 255 are available for use as both source and destination values.
187199

188200
### ObjectRules
189201

190-
A list of object ID conversion rules, each on it's own line with a | as a separator between source and destination value.
202+
A list of object ID conversion rules, each on its own line with a | as a separator between source and destination value.
191203

192204
**Example #1:**
193205
<pre>
194206
[ObjectRules]
195207
GACNST|YACNST
196208
</pre>
197209

198-
Will convert any objects, be it Infantry, Building, Aircraft, Vehicle or Terrain with ID GACNST on the processed maps to an object of same type with ID YACNST.
210+
All objects with ID `GACNST`, be it Infantry, Building, Aircraft, Vehicle or Terrain are replaced by an object of same type with ID `YACNST`.
199211

200212
**Example #2**
201213
<pre>
202214
[ObjectRules]
203215
GACNST
204216
</pre>
205217

206-
Will remove any objects, be it Infantry, Building, Aircraft, Vehicle or Terrain with ID GACNST on the processed maps.
218+
All objects with ID `GACNST`, be it Infantry, Building, Aircraft, Vehicle or Terrain are removed.
219+
220+
**Example #3**
221+
<pre>
222+
[ObjectRules]
223+
GAPOWR+GAPOWRUP|NAPOWR
224+
GAPOWR+GAPOWRUP,GAPOWRUP|NAAPWR
225+
GACTWR+*|GACTWR+GAVULC
226+
GAPLUG+GAPLUG3|GAPLUG+None,None,None
227+
</pre>
207228

229+
All buildings with ID `GAPOWR` with upgrade with ID `GAPOWRUP` in first upgrade slot are replaced with building with ID `NAPOWR`.
230+
All buildings with ID `GAPOWR` with upgrade with ID `GAPOWRUP` in both first and second upgrade slots are replaced with building with ID `NAAPWR`.
231+
All buildings with ID `GACTWR` with any upgrade or no upgrade in the first upgrade slot with building are replaced with building with ID `GACTWR` with upgrade with ID `GAVULC` in first upgrade slot.
232+
All buildings with ID `GAPLUG` with upgrade with ID `GAPLUG3` in the first upgrade slot with building are replaced with building with ID `GAPLUG` with no upgrades in any slot.
233+
208234
### SectionRules
209235

210-
A list of section name, keys and values conversion rules, each on it's own line with | as a separator between section name, key and value information.
236+
A list of section name, keys and values conversion rules, each on its own line with | as a separator between section name, key and value information.
211237

212238
**Example #1:**
213239
<pre>
214240
[SectionRules]
215241
Basic|Official|no
216242
</pre>
217243

218-
Sets the value for key 'Official' under section 'Basic' to 'no'.
244+
Sets the value for key `Official` under section `Basic` to `no`.
219245

220246
**Example #2:**
221247
<pre>
222248
[SectionRules]
223249
Basic|Official=
224250
</pre>
225251

226-
Removes key 'Official' under section 'Basic'.
252+
Removes key `Official` under section `Basic`.
227253

228254
**Example #3:**
229255
<pre>
230256
[SectionRules]
231257
Basic=
232258
</pre>
233259

234-
Removes section 'Basic' altogether.
260+
Removes section `Basic` altogether.
235261

236262
**Example #4:**
237263
<pre>
238264
[SectionRules]
239265
Basic=NotSoBasic|Official=Unofficial|Yes
240266
</pre>
241267

242-
Changes name of section 'Basic' to 'NotSoBasic', name of key 'Official' under said section to 'Unofficial' and it's value to 'Yes'.
268+
Changes name of section `Basic` to `NotSoBasic`, name of key `Official` under said section to `Unofficial` and its value to `Yes`.
243269

244270
**Example #5:**
245271
<pre>
246272
[SectionRules]
247273
Basic|Official|$GETVAL(SpecialFlags,DestroyableBridges)
248274
</pre>
249275

250-
Sets the value of key 'Official' under section 'Basic' to the value of key 'DestroyableBridges' under section 'SpecialFlags'.
276+
Sets the value of key `Official` under section `Basic` to the value of key `DestroyableBridges` under section `SpecialFlags`.
251277

252278
**Example #6:**
253279
<pre>
@@ -259,12 +285,12 @@ Lighting|IonBlue|$GETVAL(Lighting,Green,/,0.25)
259285
Lighting|IonLevel|$GETVAL(Lighting,Level,*,0.2515,false)
260286
</pre>
261287

262-
Sets the value of following keys under 'Lighting' to:
288+
Sets the value of following keys under `Lighting` to:
263289

264-
'IonAmbient' to value of 'Ambient' plus 0.1.
265-
'IonRed' to value of 'Red' minus 0.1.
266-
'IonGreen' to value of 'Green' multiplied by 0.25.
267-
'IonBlue' to value of 'Blue' divided by 0.
268-
'IonLevel' to value of 'Level' multiplied by 0.2515 with fractional part of the result truncated.
290+
`IonAmbient` to value of `Ambient` plus 0.1.
291+
`IonRed` to value of `Red` minus 0.1.
292+
`IonGreen` to value of `Green` multiplied by 0.25.
293+
`IonBlue` to value of `Blue` divided by 0.
294+
`IonLevel` to value of `Level` multiplied by 0.2515 with fractional part of the result truncated.
269295

270296
Negative values can be used for the operand. With / operator, using 0 is treated same way as 1.

0 commit comments

Comments
 (0)