DEADSOFTWARE

tools.cfg -> Tools.pas
[cavecraft.git] / src / console.pas
index 309fc28ad37eced65ea48ae0f7e353669f33f07a..99c78d037d2ec3a05c2889f7469befe5d4d439f2 100644 (file)
@@ -8,7 +8,6 @@ interface
   osadki:boolean;\r
   bl_upd:integer;\r
   s_get_drp:boolean;\r
-  particle_upd:boolean;\r
   drw_back:boolean;\r
   drw_sm:boolean;\r
   s_max_fps:integer;\r
@@ -17,13 +16,11 @@ interface
   light_type:integer;\r
 \r
   ifosad:boolean;\r
-  //s_particles:boolean; - module\r
 \r
   load_sm:integer;\r
   load_sky_siz:integer;\r
   load_back_tex:boolean;\r
   load_weather_tex:boolean;\r
-  load_particles_tex:boolean;\r
   load_light_tex:boolean;\r
   load_gui_tex:boolean;\r
 \r
@@ -40,7 +37,6 @@ interface
   sd:string;\r
 \r
   EOFstr, ENDstr:boolean;\r
-  //max_particles:integer; - module\r
 \r
  procedure save_settings;\r
  procedure load_settings;\r
@@ -49,11 +45,30 @@ interface
  procedure addToLog(str:string);\r
 \r
 implementation\r
-uses keyboard,particles_store,vars,maps,items,canvas,mobs,worldgen,jsr75i,particles,func, player,sensor, drop, inv, furnace, items_store, video;\r
+\r
+  uses\r
+    keyboard,\r
+    vars,\r
+    maps,\r
+    canvas,\r
+    mobs,\r
+    worldgen,\r
+    jsr75i,\r
+    particles,\r
+    func,\r
+    player,\r
+    sensor,\r
+    drop,\r
+    inv,\r
+    furnace,\r
+    items_store,\r
+    video;\r
+\r
 const\r
  CON_LOG_SIZE=9;\r
  PARSER_MAX_STR=15;\r
  MAX_IMGREG=2;\r
+\r
 var\r
  logSTR: array [0..CON_LOG_SIZE] of string;\r
  lastCommand:string;\r
@@ -151,7 +166,7 @@ procedure save_settings;
   t:=addRecordStoreEntry(rs,version);\r
   t:=addRecordStoreEntry(rs,''+light_type);\r
   t:=addRecordStoreEntry(rs,''+ifosad);\r
-  t:=addRecordStoreEntry(rs,''+s_particles);\r
+  t:=addRecordStoreEntry(rs, '' + Particles.enabled);\r
   t:=addRecordStoreEntry(rs,''+drawgui);\r
   t:=addRecordStoreEntry(rs,''+s_jpeg_quality);\r
   t:=addRecordStoreEntry(rs,''+load_key_tex);\r
@@ -176,7 +191,7 @@ procedure load_settings;
    end;\r
   light_type:=stringtointeger(readRecordStoreEntry(rs,2));\r
   ifosad:=sett_ld_bool(readRecordStoreEntry(rs,3));\r
-  s_particles:=sett_ld_bool(readRecordStoreEntry(rs,4));\r
+  Particles.enabled := sett_ld_bool(readRecordStoreEntry(rs, 4));\r
   drawgui:=sett_ld_bool(readRecordStoreEntry(rs,5));\r
   s_jpeg_quality:=stringtointeger(readRecordStoreEntry(rs,6));\r
   load_key_tex:=stringtointeger(readRecordStoreEntry(rs,7));\r
@@ -529,12 +544,6 @@ procedure exeCommand(str:string);
   if com='GET_DRP' then\r
    s_get_drp:=strToBool(nextWord);\r
   else\r
-  {if com='AI_UPD' then\r
-   ai_upd:=strToBool(nextWord);\r
-  else}\r
-  if com='PRT_UPD' then\r
-   particle_upd:=strToBool(nextWord);\r
-  else\r
   if com='MAX_FPS' then\r
    s_max_fps:=decodeInt(nextWord); else\r
   if com='DRW_BACK' then\r
@@ -571,7 +580,7 @@ procedure exeCommand(str:string);
    light_type:=decodeInt(nextWord);\r
   else\r
   if com='S_PARTICLES' then\r
-   s_particles:=strToBool(nextWord);\r
+   Particles.enabled := strToBool(nextWord);\r
   else\r
   if com='LOAD_SKY' then\r
    load_sky_siz:=decodeInt(nextWord);\r
@@ -585,9 +594,6 @@ procedure exeCommand(str:string);
   if com='LOAD_WEATHER_TEX' then\r
    load_weather_tex:=strToBool(nextWord);\r
   else\r
-  if com='LOAD_PARTICLES_TEX' then\r
-   load_particles_tex:=strToBool(nextWord);\r
-  else\r
   if com='LOAD_LIGHT_TEX' then\r
    load_light_tex:=strToBool(nextWord);\r
   else\r
@@ -612,68 +618,12 @@ procedure exeCommand(str:string);
   if com='LOAD_MINIMAP_TEX' then\r
    load_minimap_tex:=strToBool(nextWord);\r
   else\r
-  if com='MAX_PARTICLES' then\r
-   begin\r
-    max_particles:=decodeInt(nextWord);\r
-    reset_particles(max_particles+1);\r
-   end;\r
-  else\r
   if com='EXEC' then\r
    begin\r
     tmp:=nextWord;\r
     exec(nextWord, tmp);\r
    end;\r
   else\r
-  if com='RESET_ITEMS' then\r
-   begin\r
-    resetItems(decodeInt(nextWord)+1);\r
-    //addToLog('Max items: '+decodeInt(parsed_str[1]));\r
-   end;\r
-  else\r
-  if com='SET_ITEM' then\r
-   begin\r
-    setItemData(decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord));\r
-   end;\r
-  else\r
-  if com='RESET_BLOCKS' then\r
-   begin\r
-    resetBlocks(decodeInt(nextWord)+1);\r
-    //addToLog('Max blocks: '+decodeInt(parsed_str[1]));\r
-   end;\r
-  else\r
-  if com='SET_BLOCK' then\r
-   begin\r
-    setBlockData(decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord),\r
-                 decodeInt(nextWord));\r
-   end;\r
-  else\r
-  if com='RESET_TOOLS' then\r
-   begin\r
-    resetTools(decodeInt(nextWord)+1);\r
-    //addToLog('Max tools: '+decodeInt(parsed_str[1]));\r
-   end;\r
-  else\r
-  if com='SET_TOOL' then\r
-   begin\r
-    setToolData(decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord),\r
-                decodeInt(nextWord));\r
-   end;\r
-  else\r
   if com='RESET_FUELS' then\r
    begin\r
     furnace.setMaxFuel(decodeInt(nextWord));\r
@@ -758,13 +708,6 @@ procedure exeCommand(str:string);
                decodeInt(tmp2));\r
    end;\r
   else\r
-  if com='SET_MAX_ITEM_LIST' then\r
-   setMaxItemList(decodeInt(nextWord));\r
-  else\r
-  if com='SET_ITEM_LIST' then\r
-   setItemList(decodeInt(nextWord),\r
-               decodeInt(nextWord));\r
-  else\r
   if com='BIND_KEY' then\r
    begin\r
     tmp:=nextWord;\r