Skip to content

Commit 934fcf2

Browse files
committed
VSModTools Beta Release 1
SPRTLY2PNG: Rewritten to render in WPF, putting an end to the slow WinForms. Added new palette, zoom mode and transparent color options. Checks for errors and gives feedback to the user.
1 parent d231cd7 commit 934fcf2

33 files changed

+1489
-1038
lines changed

Graphics/menu.pal

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
JASC-PAL
2+
0100
3+
256
4+
0 255 0
5+
255 0 128
6+
255 0 128
7+
255 0 128
8+
255 0 128
9+
255 0 128
10+
255 0 128
11+
255 0 128
12+
255 0 128
13+
255 0 128
14+
3 3 2
15+
8 12 19
16+
5 20 5
17+
1 23 23
18+
22 9 3
19+
21 14 16
20+
23 19 11
21+
22 24 20
22+
11 9 34
23+
2 26 35
24+
0 31 49
25+
26 28 34
26+
1 41 2
27+
2 34 26
28+
0 56 2
29+
1 51 24
30+
23 37 11
31+
27 36 26
32+
21 55 7
33+
25 52 22
34+
0 39 39
35+
2 41 54
36+
7 51 44
37+
0 54 54
38+
27 37 40
39+
29 41 51
40+
27 51 38
41+
25 54 54
42+
45 17 8
43+
34 29 34
44+
38 39 10
45+
40 35 26
46+
42 51 11
47+
40 52 22
48+
58 34 10
49+
54 39 24
50+
55 54 5
51+
55 52 25
52+
39 39 38
53+
39 44 50
54+
40 53 41
55+
41 52 54
56+
52 43 37
57+
50 45 50
58+
57 52 41
59+
56 56 54
60+
9 53 73
61+
27 61 100
62+
28 63 104
63+
37 47 64
64+
41 56 68
65+
35 59 83
66+
55 60 68
67+
50 62 81
68+
2 67 3
69+
1 69 57
70+
43 78 24
71+
52 74 51
72+
54 97 29
73+
60 98 36
74+
0 76 76
75+
27 65 104
76+
1 99 99
77+
56 72 78
78+
56 80 101
79+
59 97 77
80+
59 101 119
81+
74 19 5
82+
76 27 32
83+
76 41 14
84+
71 55 45
85+
107 15 3
86+
112 18 39
87+
109 45 7
88+
104 46 42
89+
66 61 66
90+
122 49 64
91+
80 73 18
92+
81 74 53
93+
86 99 20
94+
82 102 48
95+
115 71 22
96+
102 86 54
97+
113 105 14
98+
113 103 57
99+
84 80 71
100+
75 89 104
101+
84 101 80
102+
86 101 112
103+
100 90 73
104+
100 94 97
105+
112 103 78
106+
113 112 109
107+
53 91 128
108+
56 93 129
109+
57 96 132
110+
62 97 128
111+
83 109 136
112+
105 120 135
113+
104 126 161
114+
95 129 50
115+
122 132 15
116+
120 133 50
117+
86 136 102
118+
122 130 79
119+
122 131 107
120+
93 128 148
121+
118 133 143
122+
114 137 168
123+
140 3 2
124+
146 14 52
125+
135 54 8
126+
141 47 47
127+
172 2 1
128+
180 17 50
129+
171 55 18
130+
171 51 47
131+
151 18 65
132+
145 51 70
133+
167 14 68
134+
176 43 70
135+
141 73 20
136+
144 84 42
137+
144 107 13
138+
141 110 54
139+
175 80 20
140+
164 91 44
141+
174 111 16
142+
171 105 53
143+
135 74 70
144+
135 120 82
145+
132 123 105
146+
175 84 73
147+
174 116 68
148+
170 120 106
149+
197 1 1
150+
212 28 43
151+
198 57 19
152+
197 55 53
153+
242 55 52
154+
214 49 83
155+
226 51 88
156+
226 63 96
157+
204 84 23
158+
205 89 35
159+
210 105 23
160+
206 112 48
161+
237 88 20
162+
249 91 34
163+
233 112 16
164+
247 116 37
165+
204 74 81
166+
202 120 69
167+
203 113 106
168+
236 67 76
169+
227 83 102
170+
227 125 70
171+
227 101 113
172+
130 126 129
173+
140 141 19
174+
150 134 51
175+
153 166 22
176+
153 165 50
177+
180 137 14
178+
173 134 50
179+
171 174 21
180+
170 174 51
181+
143 132 89
182+
148 140 112
183+
154 164 79
184+
156 161 116
185+
171 143 83
186+
163 152 120
187+
180 168 86
188+
172 167 115
189+
182 197 39
190+
184 197 88
191+
184 197 110
192+
216 143 8
193+
204 138 52
194+
219 172 5
195+
197 165 47
196+
236 146 19
197+
245 142 38
198+
237 172 21
199+
245 165 46
200+
211 136 72
201+
204 144 107
202+
201 170 89
203+
205 177 104
204+
238 144 77
205+
236 148 110
206+
248 172 82
207+
247 181 101
208+
205 203 58
209+
232 192 17
210+
201 213 84
211+
216 196 108
212+
209 226 111
213+
250 202 84
214+
238 207 113
215+
234 235 93
216+
254 233 121
217+
142 141 139
218+
145 153 165
219+
155 165 134
220+
155 162 170
221+
167 156 131
222+
176 169 138
223+
173 173 172
224+
157 172 194
225+
177 184 199
226+
183 197 151
227+
189 205 162
228+
183 194 212
229+
188 203 224
230+
204 156 136
231+
195 183 151
232+
198 186 168
233+
255 154 129
234+
243 180 139
235+
201 204 147
236+
201 209 170
237+
214 231 143
238+
214 232 181
239+
243 214 138
240+
230 213 180
241+
254 249 135
242+
248 243 176
243+
205 205 205
244+
211 218 229
245+
219 226 239
246+
231 219 200
247+
226 222 225
248+
239 242 203
249+
249 249 246
250+
255 0 128
251+
255 0 128
252+
255 0 128
253+
255 0 128
254+
255 0 128
255+
255 0 128
256+
255 0 128
257+
255 0 128
258+
255 0 128
259+
255 0 128

Tools/HELP2CSV/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
5+
</startup>
6+
</configuration>

Tools/HELP2CSV/HELP2CSV.csproj

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{2EE2503B-3456-44DD-982D-383D460B887D}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>HELP2CSV</RootNamespace>
10+
<AssemblyName>HELP2CSV</AssemblyName>
11+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Program.cs" />
47+
<Compile Include="Properties\AssemblyInfo.cs" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="App.config" />
51+
</ItemGroup>
52+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53+
</Project>

Tools/HELP2CSV/Program.cs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Text;
5+
6+
namespace HELP2TXT
7+
{
8+
class Program
9+
{
10+
static string outputFilename = "HelpTooltips.CSV";
11+
static string[] inputFilenames = new string[] { "help.dat", "help.idx", "tooltips.dat", "tooltips.idx" };
12+
static void Main(string[] args)
13+
{
14+
Console.WriteLine("HELP2CSV for 1998 Gangsters: Organized Crime");
15+
Console.WriteLine("This tool will convert Help and Tooltips DAT/IDX files to CSV.");
16+
Console.WriteLine("----------------------------------------------------------------------");
17+
18+
var dir = AppDomain.CurrentDomain.BaseDirectory;
19+
Console.WriteLine("Target dir: " + dir);
20+
21+
var data = new List<BinaryReader>(4);
22+
var swriter = new StringWriter();
23+
24+
foreach (var file in inputFilenames)
25+
if (!File.Exists(dir + file))
26+
{
27+
Console.WriteLine(file + " file not found!!! Check if the folder containing the HELP2CSV tool is the right one.");
28+
Console.WriteLine("Press any key to exit...");
29+
Console.ReadKey(true);
30+
return;
31+
}
32+
else
33+
data.Add(new BinaryReader(File.OpenRead(dir + file), System.Text.Encoding.GetEncoding(1252)));
34+
35+
if (data[1].ReadUInt32() != 3452764707 || data[3].ReadUInt32() != 3452764707 || data[1].ReadUInt16() != data[3].ReadUInt16())
36+
throw new InvalidDataException("Header of index files are wrong");
37+
38+
if (data[1].BaseStream.Length != data[3].BaseStream.Length)
39+
throw new InvalidDataException("Indexes dont have same size");
40+
41+
int indexSize = (int)((data[1].BaseStream.Length - data[1].BaseStream.Position) / 4);
42+
int charsToRead;
43+
44+
swriter.WriteLine("Id;Tooltip Text;Help Window Contents");
45+
46+
for (int i = 0; i < indexSize; i++)
47+
{
48+
swriter.Write(i);
49+
swriter.Write(";"); //Tab
50+
data[2].BaseStream.Position = data[3].ReadUInt16();
51+
charsToRead = data[3].ReadUInt16();
52+
swriter.Write(data[2].ReadChars(charsToRead));
53+
swriter.Write(";"); //Tab
54+
data[0].BaseStream.Position = data[1].ReadUInt16();
55+
charsToRead = data[1].ReadUInt16();
56+
swriter.Write(data[0].ReadChars(charsToRead));
57+
swriter.WriteLine();
58+
}
59+
System.IO.File.WriteAllText(outputFilename, swriter.ToString());
60+
Console.WriteLine("All done! Generated output: " + outputFilename);
61+
Console.WriteLine("Press any key to exit...");
62+
Console.ReadKey(true);
63+
}
64+
}
65+
}

0 commit comments

Comments
 (0)