Ignore:
Timestamp:
Apr 9, 2021, 5:56:50 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Merged changes from trunk r360 into highdpi branch.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/MessgEx.pas

    r349 r361  
    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
     
    357345  if (IconKind = mikImp) and (IconIndex = 27) then
    358346  begin // "YOU WIN" message
    359     clSaveTextLight := MainTexture.clTextLight;
    360     clSaveTextShade := MainTexture.clTextShade;
    361     MainTexture.clTextLight := $000000; // gold
    362     MainTexture.clTextShade := $0FDBFF;
     347    clSaveTextLight := MainTexture.ColorTextLight;
     348    clSaveTextShade := MainTexture.ColorTextShade;
     349    MainTexture.ColorTextLight := $000000; // gold
     350    MainTexture.ColorTextShade := $0FDBFF;
    363351    inherited;
    364     MainTexture.clTextLight := clSaveTextLight;
    365     MainTexture.clTextShade := clSaveTextShade;
     352    MainTexture.ColorTextLight := clSaveTextLight;
     353    MainTexture.ColorTextShade := clSaveTextShade;
    366354  end
    367355  else
     
    411399      end;
    412400    mikBook:
    413       PaintBook(Canvas, ClientWidth div 2, 24, MainTexture.clPage,
    414         MainTexture.clCover);
     401      PaintBook(Canvas, ClientWidth div 2, 24, MainTexture.ColorPage,
     402        MainTexture.ColorCover);
    415403    mikTribe:
    416404      if Assigned(Tribe[IconIndex].faceHGr) then
     
    516504end;
    517505
    518 function SimpleQuery(QueryKind: integer; SimpleText, SoundItem: string)
     506function SimpleQuery(QueryKind: TMessageKind; SimpleText, SoundItem: string)
    519507  : integer;
    520508begin
     
    524512    OpenSound := SoundItem;
    525513    Kind := QueryKind;
    526     DpiApplication.ProcessMessages; // TODO: Needed for Gtk2, Lazarus gtk2 bug?
    527514    ShowModal;
    528515    result := ModalResult;
Note: See TracChangeset for help on using the changeset viewer.