hedgewars/uCommandHandlers.pas
branchhedgeroid
changeset 6328 d14adf1c7721
parent 6224 42b256eca362
parent 6313 12567f6f6f02
child 6415 af2047bb4f70
equal deleted inserted replaced
6236:1998ff75321a 6328:d14adf1c7721
   128 
   128 
   129 procedure chScript(var s: shortstring);
   129 procedure chScript(var s: shortstring);
   130 begin
   130 begin
   131 if s[1]='"' then Delete(s, 1, 1);
   131 if s[1]='"' then Delete(s, 1, 1);
   132 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
   132 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
   133 cScriptName:= s;
   133 ScriptLoad(s)
   134 ScriptLoad(s)
   134 end;
   135 end;
   135 
   136 
   136 procedure chSetHat(var s: shortstring);
   137 procedure chSetHat(var s: shortstring);
   137 begin
   138 begin
   455     UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s;
   456     UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s;
   456     Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
   457     Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
   457     InitStepsFlags:= InitStepsFlags or cifMap
   458     InitStepsFlags:= InitStepsFlags or cifMap
   458     end;
   459     end;
   459 
   460 
   460 ScriptLoad(s)
   461 ScriptLoad('Maps/' + s + '/map.lua')
   461 end;
   462 end;
   462 
   463 
   463 procedure chSetTheme(var s: shortstring);
   464 procedure chSetTheme(var s: shortstring);
   464 begin
   465 begin
   465 if isDeveloperMode then
   466 if isDeveloperMode then
   524     autoCameraOn:= false
   525     autoCameraOn:= false
   525     end
   526     end
   526     else begin
   527     else begin
   527     AddCaption('Auto Camera On', $CCCCCC, capgrpVolume);
   528     AddCaption('Auto Camera On', $CCCCCC, capgrpVolume);
   528     bShowFinger:= true;
   529     bShowFinger:= true;
   529     FollowGear:= CurrentHedgehog^.Gear;
   530     if not CurrentHedgehog^.Unplaced then FollowGear:= CurrentHedgehog^.Gear;
   530     autoCameraOn:= true
   531     autoCameraOn:= true
   531     end
   532     end
   532 end;
   533 end;
   533 
   534 
   534 procedure chPause(var s: shortstring);
   535 procedure chPause(var s: shortstring);
   612     RegisterVariable('map'     , vtCommand, @chSetMap       , false);
   613     RegisterVariable('map'     , vtCommand, @chSetMap       , false);
   613     RegisterVariable('theme'   , vtCommand, @chSetTheme     , false);
   614     RegisterVariable('theme'   , vtCommand, @chSetTheme     , false);
   614     RegisterVariable('seed'    , vtCommand, @chSetSeed      , false);
   615     RegisterVariable('seed'    , vtCommand, @chSetSeed      , false);
   615     RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false);
   616     RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false);
   616     RegisterVariable('mapgen'  , vtLongInt, @cMapGen        , false);
   617     RegisterVariable('mapgen'  , vtLongInt, @cMapGen        , false);
   617     RegisterVariable('maze_size',vtLongInt, @cMazeSize      , false);
   618     RegisterVariable('maze_size',vtLongInt, @cTemplateFilter, false);
   618     RegisterVariable('delay'   , vtLongInt, @cInactDelay    , false);
   619     RegisterVariable('delay'   , vtLongInt, @cInactDelay    , false);
   619     RegisterVariable('ready'   , vtLongInt, @cReadyDelay    , false);
   620     RegisterVariable('ready'   , vtLongInt, @cReadyDelay    , false);
   620     RegisterVariable('casefreq', vtLongInt, @cCaseFactor    , false);
   621     RegisterVariable('casefreq', vtLongInt, @cCaseFactor    , false);
   621     RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false);
   622     RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false);
   622     RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false);
   623     RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false);