Changeset 358


Ignore:
Timestamp:
Apr 9, 2021, 9:51:17 AM (8 months ago)
Author:
chronos
Message:
  • Modified: Message kinds and message icons kinds changed to enumeration type.
  • Modified: Code cleanup.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Help.pas

    r350 r358  
    12481248          MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    12491249            [MainText[Count - 1]]);
    1250         end
     1250        end;
    12511251      end;
    1252     end
     1252    end;
    12531253  end;
    12541254
     
    14221422                    LineFeed;
    14231423                    LineFeed;
    1424                   end
    1425                 end
     1424                  end;
     1425                end;
    14261426              end;
    14271427            miscSearchResult:
     
    16421642                NextSection('REPLACE');
    16431643                AddItem('REPLACETEXT');
    1644                 j := 1
     1644                j := 1;
    16451645              end;
    16461646              AddImprovement(ImpReplacement[i].OldImp);
     
    16761676            AddLine(HelpText.Lookup('HELPTITLE_JOBLIST'), pkNormal, 0,
    16771677              hkMisc + hkCrossLink, miscJobList);
    1678           CheckSeeAlso := true
     1678          CheckSeeAlso := true;
    16791679        end;
    16801680
     
    16961696          begin
    16971697            TerrType := fDesert;
    1698             TerrSubType := 0
     1698            TerrSubType := 0;
    16991699          end;
    17001700          with Terrain[TerrType] do
     
    17661766                  [Phrases.Lookup('TERRAIN', fGrass + 12)]), pkTer, fGrass + 12,
    17671767                  hkTer + hkCrossLink, fGrass + 12);
    1768               end
     1768              end;
    17691769            end;
    17701770            NextSection('SPECIAL');
     
    17781778                AddLine(Phrases.Lookup('TERRAIN', 3 * 12 + Special), pkTer,
    17791779                  3 * 12 + Special);
    1780               end
     1780              end;
    17811781            end
    17821782            else if (no < 12) and (no <> fGrass) and (no <> fOcean) then
     
    18141814              AddImprovement(woGardens);
    18151815              CheckSeeAlso := true
    1816             end
    1817           end
     1816            end;
     1817          end;
    18181818        end;
    18191819
     
    18821882                AddLine(Format(HelpText.Lookup('WEIGHT'), ['+2']),
    18831883                  pkDomain, dGround);
    1884             end
     1884            end;
    18851885          end;
    18861886          if Feature[no].Preq <> preNone then
     
    19691969      Line(Canvas, Sel0, False);
    19701970    if Sel <> -1 then
    1971       Line(Canvas, Sel, True)
    1972   end
     1971      Line(Canvas, Sel, True);
     1972  end;
    19731973end;
    19741974
     
    19921992        else
    19931993          ShowNewContent(FWindowMode, Link shr 8 and $3F, Link and $FF);
    1994       end
     1994      end;
    19951995end;
    19961996
     
    20362036function THelpDlg.TextIndex(Item: string): Integer;
    20372037begin
    2038   Result := HelpText.Gethandle(Item)
     2038  Result := HelpText.Gethandle(Item);
    20392039end;
    20402040
  • trunk/LocalPlayer/LocalPlayer.pas

    r155 r358  
    55
    66procedure Client(Command, Player: integer; var Data); stdcall;
    7 
    87procedure SetAIName(p: integer; Name: string);
    98
     
    1211uses
    1312  Term, CityScreen, Draft, MessgEx, Select, CityType, Help, UnitStat, Diagram,
    14   NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree,
    15 
    16   Forms;
     13  NatStat, Wonders, Nego, Enhance, BaseWin, Battle, Rates, TechTree, Forms;
    1714
    1815var
  • trunk/LocalPlayer/MessgEx.pas

    r352 r358  
    1010
    1111type
     12  TMessageIconKind = (mikNone, mikImp, mikModel, mikTribe, mikBook, mikAge,
     13    mikPureIcon, mikMyArmy, mikEnemyArmy, mikFullControl, mikShip, mikBigIcon,
     14    mikEnemyShipComplete);
     15
    1216  TMessgExDlg = class(TBaseMessgDlg)
    1317    Button1: TButtonA;
     
    2630    procedure RemoveBtnClick(Sender: TObject);
    2731  public
    28     Kind, IconKind, IconIndex, HelpKind, HelpNo, CenterTo: integer;
     32    Kind: TMessageKind;
     33    IconIndex: Integer;
     34    HelpKind: Integer;
     35    HelpNo: Integer;
     36    CenterTo: Integer;
     37    IconKind: TMessageIconKind;
    2938    OpenSound: string;
    3039    function ShowModal: integer; override;
     
    3847  end;
    3948
    40 const
    41   // extra message kinds
    42   mkYesNoCancel = 4;
    43   mkOkCancelRemove = 5;
    44   mkOkHelp = 6;
    45   mkModel = 7;
    46 
    47   // message icon kinds
    48   mikNone = -1;
    49   mikImp = 0;
    50   mikModel = 1;
    51   mikTribe = 2;
    52   mikBook = 3;
    53   mikAge = 4;
    54   mikPureIcon = 5;
    55   mikMyArmy = 6;
    56   mikEnemyArmy = 7;
    57   mikFullControl = 8;
    58   mikShip = 9;
    59   mikBigIcon = 10;
    60   mikEnemyShipComplete = 11;
    61 
    6249var
    6350  MessgExDlg: TMessgExDlg;
     
    6552procedure SoundMessageEx(SimpleText, SoundItem: string);
    6653procedure TribeMessage(p: integer; SimpleText, SoundItem: string);
    67 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)
     54function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    6855  : integer;
    6956procedure ContextMessage(SimpleText, SoundItem: string;
     
    199186function TMessgExDlg.ShowModal: integer;
    200187var
    201   Ticks0, Ticks: TDateTime;
     188  Ticks0: TDateTime;
     189  Ticks: TDateTime;
    202190begin
    203191  if GameMode = cMovie then
     
    516504end;
    517505
    518 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)
     506function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    519507  : integer;
    520508begin
  • trunk/Messg.pas

    r189 r358  
    1212
    1313type
     14  TMessageKind = (mkOK, mkOKCancel, mkYesNo, mkYesNoCancel, mkOkCancelRemove,
     15    mkOkHelp, mkModel);
     16
    1417  TMessgDlg = class(TBaseMessgDlg)
    1518    Button1: TButtonA;
     
    2225    procedure FormKeyPress(Sender: TObject; var Key: char);
    2326  public
    24     Kind: integer;
     27    Kind: TMessageKind;
    2528    OpenSound: string;
    2629  private
    2730    procedure OnPlaySound(var Msg: TMessage); message WM_PLAYSOUND;
    2831  end;
    29 
    30 const
    31   // message kinds
    32   mkOK = 1;
    33   mkOKCancel = 2;
    34   mkYesNo = 3;
    3532
    3633var
Note: See TracChangeset for help on using the changeset viewer.