UIni.pas 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. unit UIni;
  2. interface
  3. uses IniFiles,UMyUtils;
  4. procedure ReadDifficulty;
  5. procedure RewriteDifficulty;
  6. procedure ReadRoomtypes;
  7. procedure RewriteRoomtypes;
  8. procedure RewriteOrigSizes;
  9. procedure ReadOrigSizes;
  10. procedure ReadMPSet;
  11. procedure RewriteMPSet;
  12. procedure ReadPanelConfigs;
  13. procedure RewritePanelConfigs;
  14. var
  15. ini:TMyIni;
  16. ROOMini:TMyIni;
  17. PanelIni:TMyIni;
  18. OrigSizes:array[0..55] of Real;
  19. //Form1.Left,Form1.Top,Form1.Width,Form1.Height,Form1.BorderStyle, 0..4
  20. //Round(Panel8.Left/Form1.Width),Round(Panel8.Width/Form1.Width), 5..6
  21. //Round(Panel8.Top/Form1.Height),Round(Panel8.Height/Form1.Height), 7..8
  22. //Round(Panel9.Left/Form1.Width),Round(Panel9.Width/Form1.Width), 9..10
  23. //Round(Panel9.Top/Form1.Height),Round(Panel9.Height/Form1.Height), 11..12
  24. //MenuFont.Font.Size/Form1.Height, 13..13
  25. //PlayerGoalDistFont.Font.Size/Form1.Height 14..14
  26. //MainMenu.Position.X/Form1.Width, 15..15
  27. //MainMenu.Position.Y/Form1.Height, 16..16
  28. //0,0,0,0, 17..20
  29. //GLHUDText1.Position.X/Form1.Width,GLHUDText1.Position.Y/Form1.Height,21..22
  30. //GLHUDText2.Position.X/Form1.Width,GLHUDText2.Position.Y/Form1.Height,23..24
  31. //Round(Panel13.Left/Form1.Width),Round(Panel13.Width/Form1.Width), 25..26
  32. //Round(Panel13.Top/Form1.Height),Round(Panel13.Height/Form1.Height), 27..28
  33. //Round(Panel8.Font.Size/Form1.Width), 29..29
  34. //Round(Panel9.Font.Size/Form1.Width),0, 30..31
  35. //Round(Panel11.Font.Size/Form1.Width),MenuFont.Font.Size/Form1.Width,32..33
  36. //Round(Panel13.Font.Size/Form1.Width) 34..34
  37. //RichEdit1.Left/Form1.Width,RichEdit1.Width/Form1.Width, 35..36
  38. //RichEdit1.Top/Form1.Height,RichEdit1.Height/Form1.Height 37..38
  39. //Richedit1.Font.Size/Form1.Height, 39..39
  40. //SettingsMenu.Position.X/Form1.Width, 40..40
  41. //SettingsMenu.Position.Y/Form1.Height 41..41
  42. //VideoMenu.Position.X/Form1.Width, 42..42
  43. //VideoMenu.Position.Y/Form1.Height 43..43
  44. //0,0 44..45
  45. //MPMenu.Position.X/Form1.Width, 46..46
  46. //MPMenu.Position.Y/Form1.Height, 47..47
  47. //MPHostMenu.Position.X/Form1.Width, 48..48
  48. //MPHostMenu.Position.Y/Form1.Height, 49..49
  49. //MPJoinMenu.Position.X/Form1.Width, 50..50
  50. //MPJoinMenu.Position.Y/Form1.Height, 51..51
  51. //ThrustBar.Top/Form1.Height,ThrustBar.Left/Form1.Width, 52..53
  52. //ThrustBar.Height/Form1.Height,ThrustBar.Width/Form1.Width, 54..55
  53. implementation
  54. uses Unit1,SysUtils,TypInfo,Forms,UNetwork,UCreateRaum,Windows;
  55. procedure ReadRoomtypes;
  56. var C1:Integer; S1,S2:string; C2:THeight;
  57. begin
  58. C1:=0;
  59. repeat
  60. S2:='RT_'+IntToStr(C1);
  61. ROOMini.SectionDefault:=ini.ReadString('Roomtypelist',S2,'');
  62. S1:=ini.ReadString('Roomtypelist',S2,'');
  63. if S1='' then Break;
  64. SetLength(Roomtypes,C1+1);
  65. Roomtypes[C1].ID:=C1;
  66. ROOMini.Read('Roomfrequenzy',
  67. Roomtypes[C1].Roomfrequenzy);
  68. ROOMini.Read('GreenWallsAround',
  69. Roomtypes[C1].GreenWallsAround);
  70. ROOMini.Read('ChangeWallsAtArrival',
  71. Roomtypes[C1].ChangeWallsAtArrival);
  72. ROOMini.Read('ChangeSpeedAtArrival',
  73. Roomtypes[C1].ChangeSpeedAtArrival);
  74. ROOMini.Read('TurnPlayer',
  75. Roomtypes[C1].TurnPlayer);
  76. ROOMini.Read('PortPlayerToCenter',
  77. Roomtypes[C1].PortPlayerToCenter);
  78. ROOMini.Read('ChangeOtherPlayerSpeed',
  79. Roomtypes[C1].ChangeOtherPlayerSpeed);
  80. ROOMini.Read('Contaminate',
  81. Roomtypes[C1].Contaminate);
  82. ROOMini.Read('OPTanzGegner',
  83. Roomtypes[C1].OPTanzGegner);
  84. ROOMini.Read('Passierbar',true,
  85. Roomtypes[C1].Passierbar);
  86. ROOMini.Read('NotAtSpawn',true,
  87. Roomtypes[C1].NotAtSpawn);
  88. ROOMini.Read('MaterialNameUp','Ceiling',
  89. Roomtypes[C1].MaterialName[Up]);
  90. ROOMini.Read('MaterialNameDown','Grass',
  91. Roomtypes[C1].MaterialName[Down]);
  92. ROOMini.Read('WinAtArrival',
  93. Roomtypes[C1].WinAtArrival);
  94. ROOMini.Read('WallCageTrap',
  95. Roomtypes[C1].WallCageTrap);
  96. ROOMini.Read('NotNextToSelf',
  97. Roomtypes[C1].NotNextToSelf);
  98. ROOMini.Read('SPInvisible',
  99. Roomtypes[C1].SPInvisible);
  100. for C2:=Low(THeight) to High(THeight) do begin
  101. ROOMini.Read(
  102. 'ChangeAtArrivalTo'+GetEnumName(TypeInfo(THeight), Integer(C2)),-1,
  103. Roomtypes[C1].ChangeAtArrivalTo[C2]);
  104. ROOMini.Read(
  105. 'Explode'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  106. Roomtypes[C1].Explode[C2]);
  107. ROOMini.Read(
  108. 'ExplodeOtherPlayer'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  109. Roomtypes[C1].ExplodeOtherPlayer[C2]);
  110. ROOMini.Read(
  111. 'PortTo'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  112. Roomtypes[C1].PortTo[C2]);
  113. ROOMini.Read(
  114. 'TurnToGoal'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  115. Roomtypes[C1].TurnToGoal[C2]);
  116. ROOMini.Read(
  117. 'YSNP'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  118. Roomtypes[C1].YSNP[C2]);
  119. ROOMini.Read(
  120. 'TurnRandom'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  121. Roomtypes[C1].TurnRandom[C2]);
  122. ROOMini.Read(
  123. 'PushPlayer'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  124. Roomtypes[C1].PushPlayer[C2]);
  125. ROOMini.Read(
  126. 'InkOthers'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  127. Roomtypes[C1].InkOthers[C2]);
  128. ROOMini.Read(
  129. 'ChangeSpeedRandom'+GetEnumName(TypeInfo(THeight), Integer(C2)),
  130. Roomtypes[C1].ChangeSpeedRandom[C2]);
  131. end;
  132. inc(C1);
  133. until false;
  134. end;
  135. procedure RewriteRoomtypes;
  136. begin
  137. ini.SectionDefault:='Roomtypelist';
  138. ini.Write('RT_0','empty');
  139. ini.Write('RT_1','Arrow');
  140. ini.Write('RT_2','Goal');
  141. ini.Write('RT_3','YSNP');
  142. ini.Write('RT_4','Green');
  143. ini.Write('RT_5','GreenTrap');
  144. ini.Write('RT_6','WallTrap');
  145. ini.Write('RT_7','Speed');
  146. ini.Write('RT_8','RedSpeed');
  147. ini.Write('RT_9','GreenSpeed');
  148. ini.Write('RT_10','Turner');
  149. ini.Write('RT_11','UpDownPorter');
  150. ini.Write('RT_12','UpPorter');
  151. ini.Write('RT_13','DownPorter');
  152. ini.Write('RT_14','Explosion');
  153. ini.Write('RT_15','RainbowTrap');
  154. ini.Write('RT_16','PusherDown');
  155. ini.Write('RT_17','BlackExplosion');
  156. ini.Write('RT_18','Lightning');
  157. ini.Write('RT_19','Contamination');
  158. ini.Write('RT_20','PusherUp');
  159. ini.Write('RT_21','PusherUpDown');
  160. ini.Write('RT_22','InkDown');
  161. ini.Write('RT_23','InkUp');
  162. ini.Write('RT_24','InkUpDown');
  163. ini.Write('RT_25','OPTanzGegnerraum');
  164. ini.Write('RT_26','ArrowSpawner');
  165. ini.Write('RT_27','RandomSpeed');
  166. ini.Write('RT_28','OpenUp');
  167. ini.Write('RT_29','OpenDown');
  168. ini.Write('RT_30','OpenUpDown');
  169. ini.Write('RT_31','Bonbon');
  170. ROOMini.WriteInteger('empty','ID',0);
  171. ROOMini.WriteFloat('empty','Roomfrequenzy',0);
  172. ROOMini.WriteBool('empty','NotAtSpawn',false);
  173. ROOMini.WriteString('Arrow','MaterialNameDown','Grass');
  174. ROOMini.WriteString('Arrow','MaterialNameUp','Arrow');
  175. ROOMini.WriteInteger('Arrow','ID',1);
  176. ROOMini.WriteFloat('Arrow','Roomfrequenzy',0.02);
  177. ROOMini.WriteBool('Arrow','TurnToGoalUp',true);
  178. ROOMini.WriteBool('Arrow','NotAtSpawn',false);
  179. ROOMini.WriteBool('Arrow','NotNextToSelf',true);
  180. ROOMini.WriteString('Goal','MaterialNameUp','Goal');
  181. ROOMini.WriteInteger('Goal','ID',2);
  182. ROOMini.WriteFloat('Goal','Roomfrequenzy',0);
  183. ROOMini.WriteBool('Goal','WinAtArrival',true);
  184. ROOMini.WriteBool('Goal','TurnRandomUp',true);
  185. ROOMini.WriteBool('Goal','NotAtSpawn',false);
  186. ROOMini.WriteBool('Goal','NotNextToSelf',true);
  187. ROOMini.WriteString('YSNP','MaterialNameDown','YSNP');
  188. ROOMini.WriteString('YSNP','MaterialNameUp','Ceiling');
  189. ROOMini.WriteInteger('YSNP','ID',3);
  190. ROOMini.WriteFloat('YSNP','Roomfrequenzy',0.02);
  191. ROOMini.WriteBool('YSNP','YSNPUp',true);
  192. ROOMini.WriteBool('YSNP','YSNPDown',true);
  193. ROOMini.WriteBool('YSNP','TurnPlayer',false);
  194. ROOMini.WriteBool('YSNP','PortPlayerToCenter',false);
  195. ROOMini.WriteBool('YSNP','Passierbar',false);
  196. ROOMini.WriteBool('YSNP','TurnRandomDown',true);
  197. ROOMini.WriteBool('YSNP','NotNextToSelf',true);
  198. ROOMini.WriteString('Green','MaterialNameDown','Grass');
  199. ROOMini.WriteString('Green','MaterialNameUp','Ceiling');
  200. ROOMini.WriteInteger('Green','ID',4);
  201. ROOMini.WriteFloat('Green','Roomfrequenzy',0.042);
  202. ROOMini.WriteBool('Green','YSNPUp',false);
  203. ROOMini.WriteBool('Green','YSNPDown',false);
  204. ROOMini.WriteBool('Green','GreenWallsAround',true);
  205. ROOMini.WriteBool('Green','ChangeWallsAtArrival',false);
  206. ROOMini.WriteBool('Green','TurnPlayer',false);
  207. ROOMini.WriteBool('Green','PortPlayerToCenter',false);
  208. ROOMini.WriteString('GreenTrap','MaterialNameDown','Grass');
  209. ROOMini.WriteString('GreenTrap','MaterialNameUp','Ceiling');
  210. ROOMini.WriteInteger('GreenTrap','ID',5);
  211. ROOMini.WriteFloat('GreenTrap','Roomfrequenzy',0.042);
  212. ROOMini.WriteBool('GreenTrap','YSNPUp',false);
  213. ROOMini.WriteBool('GreenTrap','YSNPDown',false);
  214. ROOMini.WriteBool('GreenTrap','GreenWallsAround',false);
  215. ROOMini.WriteInteger('GreenTrap','ChangeAtArrivalToUp',4);
  216. ROOMini.WriteInteger('GreenTrap','ChangeAtArrivalToDown',4);
  217. ROOMini.WriteBool('GreenTrap','ChangeWallsAtArrival',false);
  218. ROOMini.WriteBool('GreenTrap','TurnPlayer',true);
  219. ROOMini.WriteBool('GreenTrap','PortPlayerToCenter',true);
  220. ROOMini.WriteInteger('WallTrap','ID',6);
  221. ROOMini.WriteFloat('WallTrap','Roomfrequenzy',0.035);
  222. ROOMini.WriteBool('WallTrap','YSNPUp',false);
  223. ROOMini.WriteBool('WallTrap','YSNPDown',false);
  224. ROOMini.WriteBool('WallTrap','GreenWallsAround',false);
  225. ROOMini.WriteInteger('WallTrap','ChangeAtArrivalToUp',0);
  226. ROOMini.WriteInteger('WallTrap','ChangeAtArrivalToDown',0);
  227. ROOMini.WriteBool('WallTrap','ChangeWallsAtArrival',true);
  228. ROOMini.WriteBool('WallTrap','TurnPlayer',false);
  229. ROOMini.WriteBool('WallTrap','PortPlayerToCenter',false);
  230. ROOMini.WriteBool('WallTrap','Passierbar',false);
  231. ROOMini.WriteString('Speed','MaterialNameDown','BlueSpeed');
  232. ROOMini.WriteInteger('Speed','ID',7);
  233. ROOMini.WriteFloat('Speed','Roomfrequenzy',0.07);
  234. ROOMini.WriteBool('Speed','YSNPUp',false);
  235. ROOMini.WriteBool('Speed','YSNPDown',false);
  236. ROOMini.WriteBool('Speed','GreenWallsAround',false);
  237. ROOMini.WriteInteger('Speed','ChangeAtArrivalToUp',0);
  238. ROOMini.WriteInteger('Speed','ChangeAtArrivalToDown',0);
  239. ROOMini.WriteBool('Speed','ChangeWallsAtArrival',false);
  240. ROOMini.WriteFloat('Speed','ChangeSpeedAtArrival',2);
  241. ROOMini.WriteBool('Speed','TurnPlayer',false);
  242. ROOMini.WriteBool('Speed','PortPlayerToCenter',false);
  243. ROOMini.WriteBool('Speed','TurnRandomDown',true);
  244. ROOMini.WriteString('RedSpeed','MaterialNameDown','RedSpeed');
  245. ROOMini.WriteInteger('RedSpeed','ID',8);
  246. ROOMini.WriteFloat('RedSpeed','Roomfrequenzy',0.015);
  247. ROOMini.WriteInteger('RedSpeed','ChangeAtArrivalToUp',0);
  248. ROOMini.WriteInteger('RedSpeed','ChangeAtArrivalToDown',0);
  249. ROOMini.WriteFloat('RedSpeed','ChangeSpeedAtArrival',-10);
  250. ROOMini.WriteBool('RedSpeed','TurnRandomDown',true);
  251. ROOMini.WriteString('GreenSpeed','MaterialNameDown','GreenSpeed');
  252. ROOMini.WriteInteger('GreenSpeed','ID',9);
  253. ROOMini.WriteFloat('GreenSpeed','Roomfrequenzy',0.008);
  254. ROOMini.WriteBool('GreenSpeed','YSNPUp',false);
  255. ROOMini.WriteBool('GreenSpeed','YSNPDown',false);
  256. ROOMini.WriteBool('GreenSpeed','GreenWallsAround',false);
  257. ROOMini.WriteInteger('GreenSpeed','ChangeAtArrivalToUp',0);
  258. ROOMini.WriteInteger('GreenSpeed','ChangeAtArrivalToDown',0);
  259. ROOMini.WriteBool('GreenSpeed','ChangeWallsAtArrival',false);
  260. ROOMini.WriteFloat('GreenSpeed','ChangeSpeedAtArrival',10);
  261. ROOMini.WriteBool('GreenSpeed','TurnPlayer',false);
  262. ROOMini.WriteBool('GreenSpeed','PortPlayerToCenter',false);
  263. ROOMini.WriteBool('GreenSpeed','TurnRandomDown',true);
  264. ROOMini.WriteBool('GreenSpeed','NotNextToSelf',true);
  265. ROOMini.WriteString('Turner','MaterialNameUp','Turner');
  266. ROOMini.WriteInteger('Turner','ID',10);
  267. ROOMini.WriteFloat('Turner','Roomfrequenzy',0.1);
  268. ROOMini.WriteBool('Turner','ExplodeDown',false);
  269. ROOMini.WriteBool('Turner','ExplodeUp',false);
  270. ROOMini.WriteBool('Turner','PortToUp',false);
  271. ROOMini.WriteBool('Turner','PortToDown',false);
  272. ROOMini.WriteBool('Turner','TurnToGoalUp',false);
  273. ROOMini.WriteBool('Turner','TurnToGoalDown',false);
  274. ROOMini.WriteBool('Turner','YSNPUp',false);
  275. ROOMini.WriteBool('Turner','YSNPDown',false);
  276. ROOMini.WriteBool('Turner','GreenWallsAround',false);
  277. ROOMini.WriteBool('Turner','ChangeWallsAtArrival',false);
  278. ROOMini.WriteFloat('Turner','ChangeSpeedAtArrival',0);
  279. ROOMini.WriteBool('Turner','TurnPlayer',true);
  280. ROOMini.WriteBool('Turner','PortPlayerToCenter',true);
  281. ROOMini.WriteString('UpDownPorter','MaterialNameDown','PortDownUp');
  282. ROOMini.WriteString('UpDownPorter','MaterialNameUp','PortUpDown');
  283. ROOMini.WriteInteger('UpDownPorter','ID',11);
  284. ROOMini.WriteFloat('UpDownPorter','Roomfrequenzy',0.015);
  285. ROOMini.WriteBool('UpDownPorter','ExplodeDown',false);
  286. ROOMini.WriteBool('UpDownPorter','ExplodeUp',false);
  287. ROOMini.WriteBool('UpDownPorter','PortToUp',true);
  288. ROOMini.WriteBool('UpDownPorter','PortToDown',true);
  289. ROOMini.WriteBool('UpDownPorter','TurnToGoalUp',false);
  290. ROOMini.WriteBool('UpDownPorter','TurnToGoalDown',false);
  291. ROOMini.WriteBool('UpDownPorter','YSNPUp',false);
  292. ROOMini.WriteBool('UpDownPorter','YSNPDown',false);
  293. ROOMini.WriteBool('UpDownPorter','GreenWallsAround',false);
  294. // ROOMini.WriteInteger('UpDownPorter','ChangeAtArrivalToUp',0);
  295. // ROOMini.WriteInteger('UpDownPorter','ChangeAtArrivalToDown',0);
  296. ROOMini.WriteBool('UpDownPorter','ChangeWallsAtArrival',false);
  297. ROOMini.WriteFloat('UpDownPorter','ChangeSpeedAtArrival',0);
  298. ROOMini.WriteBool('UpDownPorter','TurnPlayer',false);
  299. ROOMini.WriteBool('UpDownPorter','PortPlayerToCenter',false);
  300. ROOMini.WriteBool('UpDownPorter','NotNextToSelf',true);
  301. ROOMini.WriteString('UpPorter','MaterialNameDown','PortDownUp');
  302. ROOMini.WriteInteger('UpPorter','ID',12);
  303. ROOMini.WriteFloat('UpPorter','Roomfrequenzy',0.03);
  304. ROOMini.WriteBool('UpPorter','ExplodeDown',false);
  305. ROOMini.WriteBool('UpPorter','ExplodeUp',false);
  306. ROOMini.WriteBool('UpPorter','PortToUp',true);
  307. ROOMini.WriteBool('UpPorter','PortToDown',false);
  308. ROOMini.WriteBool('UpPorter','TurnToGoalUp',false);
  309. ROOMini.WriteBool('UpPorter','TurnToGoalDown',false);
  310. ROOMini.WriteBool('UpPorter','YSNPUp',false);
  311. ROOMini.WriteBool('UpPorter','YSNPDown',false);
  312. ROOMini.WriteBool('UpPorter','GreenWallsAround',false);
  313. // ROOMini.WriteInteger('UpPorter','ChangeAtArrivalToDown',0);
  314. ROOMini.WriteBool('UpPorter','ChangeWallsAtArrival',false);
  315. ROOMini.WriteFloat('UpPorter','ChangeSpeedAtArrival',0);
  316. ROOMini.WriteBool('UpPorter','TurnPlayer',false);
  317. ROOMini.WriteBool('UpPorter','PortPlayerToCenter',false);
  318. ROOMini.WriteBool('UpPorter','NotNextToSelf',true);
  319. ROOMini.WriteString('DownPorter','MaterialNameUp','PortUpDown');
  320. ROOMini.WriteInteger('DownPorter','ID',13);
  321. ROOMini.WriteFloat('DownPorter','Roomfrequenzy',0.03);
  322. ROOMini.WriteBool('DownPorter','ExplodeDown',false);
  323. ROOMini.WriteBool('DownPorter','ExplodeUp',false);
  324. ROOMini.WriteBool('DownPorter','PortToUp',false);
  325. ROOMini.WriteBool('DownPorter','PortToDown',true);
  326. ROOMini.WriteBool('DownPorter','TurnToGoalUp',false);
  327. ROOMini.WriteBool('DownPorter','TurnToGoalDown',false);
  328. ROOMini.WriteBool('DownPorter','YSNPUp',false);
  329. ROOMini.WriteBool('DownPorter','YSNPDown',false);
  330. ROOMini.WriteBool('DownPorter','GreenWallsAround',false);
  331. // ROOMini.WriteInteger('DownPorter','ChangeAtArrivalToUp',0);
  332. ROOMini.WriteBool('DownPorter','ChangeWallsAtArrival',false);
  333. ROOMini.WriteFloat('DownPorter','ChangeSpeedAtArrival',0);
  334. ROOMini.WriteBool('DownPorter','TurnPlayer',false);
  335. ROOMini.WriteBool('DownPorter','PortPlayerToCenter',false);
  336. ROOMini.WriteBool('DownPorter','NotNextToSelf',true);
  337. ROOMini.WriteString('Explosion','MaterialNameDown','Explosion');
  338. ROOMini.WriteInteger('Explosion','ID',14);
  339. ROOMini.WriteFloat('Explosion','Roomfrequenzy',0.005);
  340. ROOMini.WriteBool('Explosion','ExplodeDown',true);
  341. ROOMini.WriteBool('Explosion','ExplodeUp',true);
  342. ROOMini.WriteInteger('Explosion','ChangeAtArrivalToUp',0);
  343. ROOMini.WriteInteger('Explosion','ChangeAtArrivalToDown',0);
  344. ROOMini.WriteBool('Explosion','ChangeWallsAtArrival',false);
  345. ROOMini.WriteFloat('Explosion','ChangeSpeedAtArrival',0);
  346. ROOMini.WriteBool('Explosion','TurnRandomDown',true);
  347. ROOMini.WriteInteger('RainbowTrap','ID',15);
  348. ROOMini.WriteFloat('RainbowTrap','Roomfrequenzy',0.05);
  349. ROOMini.WriteBool('RainbowTrap','PortToUp',true);
  350. ROOMini.WriteBool('RainbowTrap','PortToDown',true);
  351. ROOMini.WriteInteger('RainbowTrap','ChangeAtArrivalToUp',0);
  352. ROOMini.WriteInteger('RainbowTrap','ChangeAtArrivalToDown',0);
  353. ROOMini.WriteString('PusherDown','MaterialNameDown','PusherDown');
  354. ROOMini.WriteInteger('PusherDown','ID',16);
  355. ROOMini.WriteFloat('PusherDown','Roomfrequenzy',0.04);
  356. ROOMini.WriteBool('PusherDown','PushPlayerDown',true);
  357. ROOMini.WriteBool('PusherDown','TurnRandomDown',true);
  358. // ROOMini.WriteString('BlackExplosion','MaterialNameDown','BlackExplosion');
  359. // ROOMini.WriteInteger('BlackExplosion','ID',17);
  360. // ROOMini.WriteFloat('BlackExplosion','Roomfrequenzy',0.01);
  361. // ROOMini.WriteBool('BlackExplosion','ExplodeOtherPlayerUp',true);
  362. // ROOMini.WriteBool('BlackExplosion','ExplodeOtherPlayerDown',true);
  363. // ROOMini.WriteInteger('BlackExplosion','ChangeAtArrivalToUp',0);
  364. // ROOMini.WriteInteger('BlackExplosion','ChangeAtArrivalToDown',0);
  365. // ROOMini.WriteBool('BlackExplosion','TurnRandomDown',true);
  366. // ROOMini.WriteBool('BlackExplosion','NotNextToSelf',true);
  367. // ROOMini.WriteBool('BlackExplosion','SPInvisible',true);
  368. // ROOMini.WriteString('Lightning','MaterialNameUp','Lightning');
  369. // ROOMini.WriteInteger('Lightning','ID',18);
  370. // ROOMini.WriteFloat('Lightning','Roomfrequenzy',0.025);
  371. // ROOMini.WriteInteger('Lightning','ChangeAtArrivalToUp',0);
  372. // ROOMini.WriteInteger('Lightning','ChangeAtArrivalToDown',0);
  373. // ROOMini.WriteBool('Lightning','ChangeOtherPlayerSpeed',true);
  374. // ROOMini.WriteBool('Lightning','TurnRandomUp',true);
  375. // ROOMini.WriteBool('Lightning','NotNextToSelf',true);
  376. // ROOMini.WriteBool('Lightning','SPInvisible',true);
  377. ROOMini.WriteString('Contamination','MaterialNameDown','ContaminationDown');
  378. ROOMini.WriteString('Contamination','MaterialNameUp','ContaminationUp');
  379. ROOMini.WriteInteger('Contamination','ID',19);
  380. ROOMini.WriteFloat('Contamination','Roomfrequenzy',0.005);
  381. ROOMini.WriteBool('Contamination','Contaminate',true);
  382. ROOMini.WriteBool('Contamination','Passierbar',false);
  383. ROOMini.WriteBool('Contamination','TurnRandomUp',true);
  384. ROOMini.WriteBool('Contamination','TurnRandomDown',true);
  385. ROOMini.WriteString('PusherUp','MaterialNameUp','PusherUp');
  386. ROOMini.WriteInteger('PusherUp','ID',20);
  387. ROOMini.WriteFloat('PusherUp','Roomfrequenzy',0.04);
  388. ROOMini.WriteBool('PusherUp','PushPlayerUp',true);
  389. ROOMini.WriteBool('PusherUp','TurnRandomUp',true);
  390. ROOMini.WriteString('PusherUpDown','MaterialNameDown','PusherDown');
  391. ROOMini.WriteString('PusherUpDown','MaterialNameUp','PusherUp');
  392. ROOMini.WriteInteger('PusherUpDown','ID',21);
  393. ROOMini.WriteFloat('PusherUpDown','Roomfrequenzy',0.01);
  394. ROOMini.WriteBool('PusherUpDown','PushPlayerUp',true);
  395. ROOMini.WriteBool('PusherUpDown','PushPlayerDown',true);
  396. ROOMini.WriteBool('PusherUpDown','TurnRandomUp',true);
  397. ROOMini.WriteBool('PusherUpDown','TurnRandomDown',true);
  398. ROOMini.WriteBool('PusherUpDown','Passierbar',false);
  399. // ROOMini.WriteString('InkDown','MaterialNameDown','InkDown');
  400. // ROOMini.WriteInteger('InkDown','ID',22);
  401. // ROOMini.WriteFloat('InkDown','Roomfrequenzy',0.006);
  402. // ROOMini.WriteBool('InkDown','TurnRandomDown',true);
  403. // ROOMini.WriteBool('InkDown','InkOthersDown',true);
  404. // ROOMini.WriteInteger('InkDown','ChangeAtArrivalToDown',0);
  405. // ROOMini.WriteBool('InkDown','NotNextToSelf',true);
  406. // ROOMini.WriteBool('InkDown','SPInvisible',true);
  407. //
  408. // ROOMini.WriteString('InkUp','MaterialNameUp','InkUp');
  409. // ROOMini.WriteInteger('InkUp','ID',23);
  410. // ROOMini.WriteFloat('InkUp','Roomfrequenzy',0.006);
  411. // ROOMini.WriteBool('InkUp','TurnRandomUp',true);
  412. // ROOMini.WriteBool('InkUp','InkOthersUp',true);
  413. // ROOMini.WriteInteger('InkUp','ChangeAtArrivalToUp',0);
  414. // ROOMini.WriteBool('InkDown','NotNextToSelf',true);
  415. // ROOMini.WriteBool('InkDown','SPInvisible',true);
  416. //
  417. // ROOMini.WriteString('InkUpDown','MaterialNameDown','InkDown');
  418. // ROOMini.WriteString('InkUpDown','MaterialNameUp','InkUp');
  419. // ROOMini.WriteInteger('InkUpDown','ID',24);
  420. // ROOMini.WriteFloat('InkUpDown','Roomfrequenzy',0.002);
  421. // ROOMini.WriteBool('InkUpDown','TurnRandomDown',true);
  422. // ROOMini.WriteBool('InkUpDown','TurnRandomUp',true);
  423. // ROOMini.WriteBool('InkUpDown','InkOthersDown',true);
  424. // ROOMini.WriteBool('InkUpDown','InkOthersUp',true);
  425. // ROOMini.WriteInteger('InkUpDown','ChangeAtArrivalToDown',0);
  426. // ROOMini.WriteInteger('InkUpDown','ChangeAtArrivalToUp',0);
  427. // ROOMini.WriteBool('InkUpDown','NotNextToSelf',true);
  428. // ROOMini.WriteBool('InkUpDown','SPInvisible',true);
  429. ROOMini.WriteInteger('OPTanzGegnerraum','ID',25);
  430. ROOMini.WriteFloat('OPTanzGegnerraum','Roomfrequenzy',0.005);
  431. ROOMini.WriteBool('OPTanzGegnerraum','OPTanzGegner',true);
  432. ROOMini.WriteBool('OPTanzGegnerraum','Passierbar',false);
  433. ROOMini.WriteBool('OPTanzGegnerraum','NotNextToSelf',true);
  434. // ROOMini.WriteInteger('ArrowSpawner','ID',26);
  435. // ROOMini.WriteFloat('ArrowSpawner','Roomfrequenzy',0.005);
  436. // ROOMini.WriteString('ArrowSpawner','MaterialNameUp','ArrowSpawner');
  437. // ROOMini.WriteBool('ArrowSpawner','TurnRandomUp',true);
  438. // ROOMini.WriteInteger('ArrowSpawner','ChangeAtArrivalToDown',1);
  439. // ROOMini.WriteInteger('ArrowSpawner','ChangeAtArrivalToUp',1);
  440. // ROOMini.WriteBool('ArrowSpawner','NotNextToSelf',true);
  441. // ROOMini.WriteString('RandomSpeed','MaterialNameDown','RandomSpeed');
  442. // ROOMini.WriteInteger('RandomSpeed','ID',27);
  443. // ROOMini.WriteFloat('RandomSpeed','Roomfrequenzy',0.007);
  444. // ROOMini.WriteInteger('RandomSpeed','ChangeAtArrivalToUp',0);
  445. // ROOMini.WriteInteger('RandomSpeed','ChangeAtArrivalToDown',0);
  446. // ROOMini.WriteBool('RandomSpeed','ChangeSpeedRandomUp',true);
  447. // ROOMini.WriteBool('RandomSpeed','ChangeSpeedRandomDown',true);
  448. // ROOMini.WriteBool('RandomSpeed','TurnRandomDown',true);
  449. // ROOMini.WriteFloat('RandomSpeed','ChangeSpeedAtArrival',20);
  450. // ROOMini.WriteBool('RandomSpeed','NotNextToSelf',true);
  451. ROOMini.WriteString('OpenDown','MaterialNameDown','Open');
  452. ROOMini.WriteInteger('OpenDown','ID',28);
  453. ROOMini.WriteFloat('OpenDown','Roomfrequenzy',0.01);
  454. ROOMini.WriteString('OpenUp','MaterialNameUp','Open');
  455. ROOMini.WriteInteger('OpenUp','ID',29);
  456. ROOMini.WriteFloat('OpenUp','Roomfrequenzy',0.01);
  457. ROOMini.WriteString('OpenUpDown','MaterialNameDown','Open');
  458. ROOMini.WriteString('OpenUpDown','MaterialNameUp','Open');
  459. ROOMini.WriteInteger('OpenUpDown','ID',30);
  460. ROOMini.WriteFloat('OpenUpDown','Roomfrequenzy',0.005);
  461. ROOMini.WriteBool('OpenUpDown','Passierbar',false);
  462. ROOMini.WriteString('Bonbon','MaterialNameDown','Bonbon');
  463. ROOMini.WriteInteger('Bonbon','ID',31);
  464. ROOMini.WriteFloat('Bonbon','Roomfrequenzy',0.005);
  465. ROOMini.WriteBool('Bonbon','WallCageTrap',true);
  466. ROOMini.WriteBool('Bonbon','Passierbar',false);
  467. ROOMini.WriteBool('Bonbon','TurnRandomDown',true);
  468. ROOMini.WriteBool('Bonbon','NotNextToSelf',true);
  469. end;
  470. procedure ReadPanelConfigs;
  471. var C1:Integer; S2:string;
  472. begin
  473. C1:=0;
  474. repeat
  475. S2:='RT_'+IntToStr(C1);
  476. PanelIni.SectionDefault:='PC_'+ini.ReadString('Roomtypelist',S2,'');
  477. if PanelIni.SectionDefault='PC_' then Break;
  478. SetLength(PanelConfigs,C1+1);
  479. PanelConfigs[C1].ID:=C1;
  480. PanelIni.Read('TopDivH',64/Form1.Height,PanelConfigs[C1].TopDivH);
  481. PanelIni.Read('LeftDivW',136/Form1.Width,PanelConfigs[C1].LeftDivW);
  482. PanelIni.Read('WidthDivW',849/Form1.Width,PanelConfigs[C1].WidthDivW);
  483. PanelIni.Read('HeightDivH',49/Form1.Height,PanelConfigs[C1].HeightDivH);
  484. PanelIni.Read('Text',PanelConfigs[C1].Text);
  485. PanelIni.Read('FontColor',
  486. RGB(255,255,255),Integer(PanelConfigs[C1].FontColor));
  487. PanelIni.Read('BackGroundColor',
  488. RGB(38,38,38),Integer(PanelConfigs[C1].BackGroundColor));
  489. PanelIni.Read('FontSizeDivH',24/Form1.Height,PanelConfigs[C1].FontSizeDivH);
  490. PanelIni.Read('Seconds',3,PanelConfigs[C1].Seconds);
  491. PanelIni.Read('DontShowIfWon',PanelConfigs[C1].DontShowIfWon);
  492. PanelIni.Read('SpeedAtEnd',PanelConfigs[C1].SpeedAtEnd);
  493. inc(C1);
  494. until false;
  495. end;
  496. procedure RewritePanelConfigs;
  497. begin
  498. PanelIni.SectionDefault:='PC_GreenTrap';
  499. PanelIni.Write('ID',5);
  500. PanelIni.Write('Text','hihihihihihihihihihihi');
  501. PanelIni.Write('FontColor',RGB(232,138,20));
  502. PanelIni.Write('BackGroundColor',RGB(10,23,7));
  503. PanelIni.Write('LeftDivW',139/Form1.Width);
  504. PanelIni.Write('TopDivH',253/Form1.Height);
  505. PanelIni.Write('DontShowIfWon',true);
  506. PanelIni.SectionDefault:='PC_WallTrap';
  507. PanelIni.Write('ID',6);
  508. PanelIni.Write('Text','Warping Walls!');
  509. PanelIni.Write('FontColor',RGB(52,52,219));
  510. PanelIni.Write('DontShowIfWon',true);
  511. PanelIni.SectionDefault:='PC_Speed';
  512. PanelIni.Write('ID',7);
  513. PanelIni.Write('Text','Speed increased to');
  514. PanelIni.Write('FontColor',RGB(0,168,255));
  515. PanelIni.Write('SpeedAtEnd',true);
  516. PanelIni.SectionDefault:='PC_RedSpeed';
  517. PanelIni.Write('ID',8);
  518. PanelIni.Write('Text','Speed decreased to');
  519. PanelIni.Write('FontColor',RGB(150,25,25));
  520. PanelIni.Write('DontShowIfWon',true);
  521. PanelIni.Write('SpeedAtEnd',true);
  522. PanelIni.SectionDefault:='PC_GreenSpeed';
  523. PanelIni.Write('ID',9);
  524. PanelIni.Write('Text','Speed increased to');
  525. PanelIni.Write('FontColor',RGB(125,219,45));
  526. PanelIni.Write('SpeedAtEnd',true);
  527. PanelIni.SectionDefault:='PC_Explosion';
  528. PanelIni.Write('ID',14);
  529. PanelIni.Write('Text','BOOM');
  530. PanelIni.Write('FontColor',RGB(23,117,235));
  531. PanelIni.Write('BackGroundColor',RGB(232,138,20));
  532. PanelIni.Write('LeftDivW',0.05);
  533. PanelIni.Write('WidthDivW',0.9);
  534. PanelIni.Write('TopDivH',0.1);
  535. PanelIni.Write('HeightDivH',0.8);
  536. PanelIni.Write('Seconds',1.5);
  537. PanelIni.Write('FontSizeDivH',300/Form1.Height);
  538. PanelIni.Write('DontShowIfWon',true);
  539. PanelIni.SectionDefault:='PC_RandomSpeed';
  540. PanelIni.Write('ID',27);
  541. PanelIni.Write('Text','Speed changed randomly to');
  542. PanelIni.Write('FontColor',RGB(0,0,0));
  543. PanelIni.Write('BackGroundColor',RGB(255,255,255));
  544. PanelIni.Write('DontShowIfWon',true);
  545. PanelIni.SectionDefault:='PC_Bonbon';
  546. PanelIni.Write('ID',31);
  547. PanelIni.Write('Text','Trapped!');
  548. PanelIni.Write('FontColor',RGB(255,182,80));
  549. PanelIni.Write('DontShowIfWon',true);
  550. end;
  551. procedure RewriteOrigSizes;
  552. var C1:Integer;
  553. begin
  554. OrigSizes[0]:=Form1.Left;
  555. OrigSizes[1]:=Form1.Top;
  556. OrigSizes[2]:=Form1.Width;
  557. OrigSizes[3]:=Form1.Height;
  558. OrigSizes[4]:=Integer(Form1.BorderStyle);
  559. OrigSizes[5]:=Form1.Panel8.Left/Form1.Width;
  560. OrigSizes[6]:=Form1.Panel8.Width/Form1.Width;
  561. OrigSizes[7]:=Form1.Panel8.Top/Form1.Height;
  562. OrigSizes[8]:=Form1.Panel8.Height/Form1.Height;
  563. OrigSizes[9]:=Form1.Panel9.Left/Form1.Width;
  564. OrigSizes[10]:=Form1.Panel9.Width/Form1.Width;
  565. OrigSizes[11]:=Form1.Panel9.Top/Form1.Height;
  566. OrigSizes[12]:=Form1.Panel9.Height/Form1.Height;
  567. OrigSizes[13]:=Form1.MenuFont.Font.Size/Form1.Height;
  568. OrigSizes[14]:=Form1.PlayerGoalDistFont.Font.Size/Form1.Height;
  569. OrigSizes[15]:=Form1.MainMenu.Position.X/Form1.Width;
  570. OrigSizes[16]:=Form1.MainMenu.Position.Y/Form1.Height;
  571. OrigSizes[17]:=0;
  572. OrigSizes[18]:=0;
  573. OrigSizes[19]:=0;
  574. OrigSizes[20]:=0;
  575. OrigSizes[21]:=Form1.GLHUDText1.Position.X/Form1.Width;
  576. OrigSizes[22]:=Form1.GLHUDText1.Position.Y/Form1.Height;
  577. OrigSizes[23]:=Form1.GLHUDText2.Position.X/Form1.Width;
  578. OrigSizes[24]:=Form1.GLHUDText2.Position.Y/Form1.Height;
  579. OrigSizes[25]:=Form1.Panel13.Left/Form1.Width;
  580. OrigSizes[26]:=Form1.Panel13.Width/Form1.Width;
  581. OrigSizes[27]:=Form1.Panel13.Top/Form1.Height;
  582. OrigSizes[28]:=Form1.Panel13.Height/Form1.Height;
  583. OrigSizes[29]:=Form1.Panel8.Font.Size/Form1.Width;
  584. OrigSizes[30]:=Form1.Panel9.Font.Size/Form1.Width;
  585. OrigSizes[32]:=Form1.Panel11.Font.Size/Form1.Width;
  586. OrigSizes[33]:=Form1.MenuFont.Font.Size/Form1.Width;
  587. OrigSizes[34]:=Form1.Panel13.Font.Size/Form1.Width;
  588. OrigSizes[35]:=Form1.RichEdit1.Left/Form1.Width;
  589. OrigSizes[36]:=Form1.RichEdit1.Width/Form1.Width;
  590. OrigSizes[37]:=Form1.RichEdit1.Top/Form1.Height;
  591. OrigSizes[38]:=Form1.RichEdit1.Height/Form1.Height;
  592. OrigSizes[39]:=Form1.Richedit1.Font.Size/Form1.Height;
  593. OrigSizes[40]:=Form1.SettingsMenu.Position.X/Form1.Width;
  594. OrigSizes[41]:=Form1.SettingsMenu.Position.Y/Form1.Height;
  595. OrigSizes[42]:=Form1.VideoMenu.Position.X/Form1.Width;
  596. OrigSizes[43]:=Form1.VideoMenu.Position.Y/Form1.Height;
  597. OrigSizes[44]:=0;
  598. OrigSizes[45]:=0;
  599. OrigSizes[46]:=Form1.MPMenu.Position.X/Form1.Width;
  600. OrigSizes[47]:=Form1.MPMenu.Position.Y/Form1.Height;
  601. OrigSizes[48]:=Form1.MPHostMenu.Position.X/Form1.Width;
  602. OrigSizes[49]:=Form1.MPHostMenu.Position.Y/Form1.Height;
  603. OrigSizes[50]:=Form1.MPJoinMenu.Position.X/Form1.Width;
  604. OrigSizes[51]:=Form1.MPJoinMenu.Position.Y/Form1.Height;
  605. OrigSizes[52]:=Form1.ThrustBar.Top/Form1.Height;
  606. OrigSizes[53]:=Form1.ThrustBar.Left/Form1.Width;
  607. OrigSizes[54]:=Form1.ThrustBar.Height/Form1.Height;
  608. OrigSizes[55]:=Form1.ThrustBar.Width/Form1.Width;
  609. for C1:=Low(OrigSizes) to High(OrigSizes) do
  610. ini.WriteFloat('Proportions','OS_'+IntToStr(C1),OrigSizes[C1]);
  611. end;
  612. procedure ReadDifficulty;
  613. begin
  614. MinGoalDist:=
  615. ini.ReadInteger('Difficulty','Minimum Goal Distance',MinGoalDist);
  616. MaxGoalDist:=
  617. ini.ReadInteger('Difficulty','Maximum Goal Distance',MaxGoalDist);
  618. GoalProtectionRadius:=
  619. ini.ReadInteger('Difficulty','GoalProtectionRadius',3);
  620. WallProb:=
  621. ini.ReadFloat('Difficulty','WallProb',WallProb);
  622. UPWallProb:=
  623. ini.ReadFloat('Difficulty','UPWallProb',UPWallProb);
  624. DownWallProb:=
  625. ini.ReadFloat('Difficulty','DownWallProb',0.11);
  626. StartSpeed:=
  627. ini.ReadFloat('Difficulty','StartSpeed',15);
  628. end;
  629. procedure RewriteDifficulty;
  630. begin
  631. ini.WriteInteger('Difficulty','Minimum Goal Distance',MinGoalDist);
  632. ini.WriteInteger('Difficulty','Maximum Goal Distance',MaxGoalDist);
  633. ini.WriteInteger('Difficulty','GoalProtectionRadius',GoalProtectionRadius);
  634. ini.WriteFloat('Difficulty','WallProb',WallProb);
  635. ini.WriteFloat('Difficulty','UPWallProb',UPWallProb);
  636. ini.WriteFloat('Difficulty','DownWallProb',DownWallProb);
  637. ini.WriteFloat('Difficulty','StartSpeed',StartSpeed);
  638. end;
  639. procedure ReadOrigSizes;
  640. var C1:Integer;
  641. begin
  642. for C1:=Low(OrigSizes) to High(OrigSizes) do
  643. OrigSizes[C1]:=ini.ReadFloat('Proportions','OS_'+IntToStr(C1),1);
  644. Form1.BorderStyle:=TFormBorderStyle(Round(OrigSizes[4]));
  645. Form1.SetBounds(
  646. Round(OrigSizes[0]),
  647. Round(OrigSizes[1]),
  648. Round(OrigSizes[2]),
  649. Round(OrigSizes[3]));
  650. Form1.RearrangePanels;
  651. end;
  652. procedure ReadMPSet;
  653. begin
  654. MPServerAddress:=
  655. ini.ReadString('Multiplayer','MPServerAddress','Localhost');
  656. MPPort:=
  657. ini.ReadInteger('Multiplayer','MPPort',10808);
  658. end;
  659. procedure RewriteMPSet;
  660. begin
  661. ini.WriteString('Multiplayer','MPServerAddress',MPServerAddress);
  662. ini.WriteInteger('Multiplayer','MPPort',MPPort);
  663. end;
  664. end.