Ignore:
Timestamp:
Nov 27, 2023, 12:10:57 AM (12 months ago)
Author:
chronos
Message:
  • Modified: Use enumeration type in Help unit for better readability.
  • Fixed: Corruption external help image referenced with incorrect file name case.
  • Fixed: Chinese translation converted to UTF-8.
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Enhance.pas

    r456 r457  
    128128  I, stage, TerrType, TileImp, X, EndStage, Cost, LastJob: Integer;
    129129  S: string;
    130   Done: Set of jNone .. jTrans;
     130  Done: set of jNone .. jTrans;
    131131  TypeChanged: Boolean;
    132132begin
     
    321321procedure TEnhanceDlg.JobClick(Sender: TObject);
    322322var
    323   stage, NewJob: Integer;
     323  Stage, NewJob: Integer;
    324324  Done: Set of jNone .. jTrans;
    325325
    326326  procedure RemoveJob(J: Integer);
    327327  begin // remove job
    328     stage := 0;
    329     while (stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do
    330     begin
    331       if (MyData.EnhancementJobs[Page, stage] = J) or (J = jRoad) and
    332         (MyData.EnhancementJobs[Page, stage] = jRR) or (J = jIrr) and
    333         (MyData.EnhancementJobs[Page, stage] = jFarm) then
     328    Stage := 0;
     329    while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do
     330    begin
     331      if (MyData.EnhancementJobs[Page, Stage] = J) or (J = jRoad) and
     332        (MyData.EnhancementJobs[Page, Stage] = jRR) or (J = jIrr) and
     333        (MyData.EnhancementJobs[Page, Stage] = jFarm) then
    334334      begin
    335         if stage < 4 then
    336           Move(MyData.EnhancementJobs[Page, stage + 1],
    337             MyData.EnhancementJobs[Page, stage], 4 - stage);
     335        if Stage < 4 then
     336          Move(MyData.EnhancementJobs[Page, Stage + 1],
     337            MyData.EnhancementJobs[Page, Stage], 4 - Stage);
    338338        MyData.EnhancementJobs[Page, 4] := jNone;
    339339      end
    340340      else
    341         Inc(stage);
     341        Inc(Stage);
    342342    end;
    343343  end;
     
    346346  NewJob := TButtonC(Sender).Tag;
    347347  Done := [];
    348   stage := 0;
    349   while (stage < 5) and (MyData.EnhancementJobs[Page, stage] <> jNone) do
     348  Stage := 0;
     349  while (Stage < 5) and (MyData.EnhancementJobs[Page, Stage] <> jNone) do
    350350  begin
    351     Include(Done, MyData.EnhancementJobs[Page, stage]);
    352     Inc(stage);
     351    Include(Done, MyData.EnhancementJobs[Page, Stage]);
     352    Inc(Stage);
    353353  end;
    354354  if NewJob in Done then
     
    362362    if (NewJob = jRR) and not(jRoad in Done) then
    363363    begin
    364       MyData.EnhancementJobs[Page, stage] := jRoad;
    365       Inc(stage);
     364      MyData.EnhancementJobs[Page, Stage] := jRoad;
     365      Inc(Stage);
    366366    end;
    367367    if (NewJob = jFarm) and not(jIrr in Done) then
    368368    begin
    369       MyData.EnhancementJobs[Page, stage] := jIrr;
    370       Inc(stage);
    371     end;
    372     MyData.EnhancementJobs[Page, stage] := NewJob;
     369      MyData.EnhancementJobs[Page, Stage] := jIrr;
     370      Inc(Stage);
     371    end;
     372    MyData.EnhancementJobs[Page, Stage] := NewJob;
    373373  end;
    374374  SmartUpdateContent;
Note: See TracChangeset for help on using the changeset viewer.