Changeset 464 for trunk


Ignore:
Timestamp:
Nov 29, 2023, 6:25:22 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Direct.pas

    r456 r464  
    3939var
    4040  DirectDlg: TDirectDlg;
     41
    4142
    4243implementation
     
    153154        State := -1;
    154155        Show;
    155         {$IFDEF UNIX}
    156         // Force shown window repaint on Gtk2 widgetset
    157         Sleep(1);
    158         Application.ProcessMessages;
    159         {$ENDIF}
     156        Gtk2Fix;
    160157        Invalidate;
    161158        Update;
  • trunk/LocalPlayer/CityScreen.pas

    r460 r464  
    403403    D, I, Total, xGr, yGr: Integer;
    404404    TileInfo: TTileInfo;
    405     rare: Boolean;
     405    Rare: Boolean;
    406406  begin
    407407    with AreaMap do begin
     
    412412    end;
    413413    Total := TileInfo.Food + TileInfo.Prod + TileInfo.Trade;
    414     rare := MyMap[Loc] and $06000000 > 0;
    415     if rare then
     414    Rare := MyMap[Loc] and $06000000 > 0;
     415    if Rare then
    416416      Inc(Total);
    417417    if Add4Happy then
     
    431431        yGr := 126
    432432      end
    433       else if rare and (I = Total - 1) then
     433      else if Rare and (I = Total - 1) then
    434434        xGr := 66 + 110
    435435      else if I >= TileInfo.Food + TileInfo.Prod then
  • trunk/LocalPlayer/Tribes.pas

    r457 r464  
    509509        HGr := LoadGraphicSet(GrName);
    510510        pix := Info.pix;
    511         Inc(HGr.pixUsed[pix]);
     511        Inc(HGr.PixUsed[pix]);
    512512      end;
    513513      ModelName[mix] := '';
     
    584584      else
    585585      begin
    586         Used := 4 * HGr.pixUsed[TestPic.pix];
     586        Used := 4 * HGr.PixUsed[TestPic.pix];
    587587        if HGr = HGrStdUnits then
    588588          Inc(Used, 2); // prefer units not from StdUnits
  • trunk/Packages/CevoComponents/BaseWin.pas

    r460 r464  
    3535    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    3636    procedure FormDeactivate(Sender: TObject);
    37     procedure SmartUpdateContent(ImmUpdate: Boolean = False);
    38     procedure StayOnTop_Workaround;
     37    procedure SmartUpdateContent(ImmediateUpdate: Boolean = False);
    3938    property WindowMode: TWindowMode read FWindowMode;
    4039  end;
     
    214213end;
    215214
    216 procedure TBufferedDrawDlg.SmartUpdateContent(ImmUpdate: Boolean);
     215procedure TBufferedDrawDlg.SmartUpdateContent(ImmediateUpdate: Boolean);
    217216begin
    218217  if Visible then begin
    219218    OffscreenPaint;
    220219    SmartInvalidate;
    221     if ImmUpdate then
     220    if ImmediateUpdate then
    222221      Update;
    223222  end;
     
    230229  if yMax > UsedOffscreenHeight then
    231230    UsedOffscreenHeight := yMax;
    232 end;
    233 
    234 procedure TBufferedDrawDlg.StayOnTop_Workaround;
    235 // stayontop doesn't work when window is shown for the first time
    236 // after application lost focus, so show all stayontop-windows in first turn
    237 var
    238   SaveOnShow, SaveOnPaint: TNotifyEvent;
    239 begin
    240   Top := Screen.Height;
    241   SaveOnShow := OnShow;
    242   OnShow := nil;
    243   SaveOnPaint := OnPaint;
    244   OnPaint := nil;
    245   FWindowMode := wmNone;
    246   Show;
    247   Hide;
    248   OnShow := SaveOnShow;
    249   OnPaint := SaveOnPaint;
    250231end;
    251232
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r447 r464  
    77
    88type
     9
     10  { TButtonBase }
     11
    912  TButtonBase = class(TGraphicControl)
    1013  protected
     
    2528  private
    2629    Active: Boolean;
     30    procedure SetGraphic(AValue: TBitmap);
    2731  public
    2832    constructor Create(aOwner: TComponent); override;
    29     property Graphic: TBitmap read FGraphic write FGraphic;
     33    property Graphic: TBitmap read FGraphic write SetGraphic;
    3034    // property DownSound: string read FDownSound write FDownSound;
    3135    // property UpSound: string read FUpSound write FUpSound;
     
    120124end;
    121125
     126procedure TButtonBase.SetGraphic(AValue: TBitmap);
     127begin
     128  if FGraphic = AValue then Exit;
     129  FGraphic := AValue;
     130end;
     131
    122132procedure TButtonBase.SetDown(X: Boolean);
    123133begin
  • trunk/Packages/CevoComponents/GraphicSet.pas

    r456 r464  
    4545    Data: TBitmap;
    4646    Mask: TBitmap;
    47     pixUsed: array of Byte;
     47    PixUsed: array of Byte;
    4848    Items: TGraphicSetItems;
    4949    procedure ResetPixUsed;
     
    169169procedure TGraphicSet.ResetPixUsed;
    170170begin
    171   SetLength(pixUsed, Data.Height div 49 * 10);
    172   if Length(pixUsed) > 0 then
    173     FillChar(pixUsed[0], Length(pixUsed), 0);
     171  SetLength(PixUsed, Data.Height div 49 * 10);
     172  if Length(PixUsed) > 0 then
     173    FillChar(PixUsed[0], Length(PixUsed), 0);
    174174end;
    175175
Note: See TracChangeset for help on using the changeset viewer.