Changeset 352 for trunk/Start.pas


Ignore:
Timestamp:
Apr 6, 2021, 10:16:55 PM (10 months ago)
Author:
chronos
Message:
  • Modified: TTexture changed from record to class.
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Start.pas

    r344 r352  
    537537  begin
    538538    Frame(Canvas, 328, yMain + 112 - 15, ClientWidth, Up2Btn.top + 38,
    539       MainTexture.clBevelShade, MainTexture.clBevelLight);
     539      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    540540    if AutoDiff > 0 then
    541541    begin
     
    543543        yMain + 112 - 15 { Up1Btn.Top-12 }{ y0Brain-dyBrain } ,
    544544        x0Brain + dxBrain + 64, Up2Btn.top + 38 { y0Brain+dyBrain+64 } ,
    545         MainTexture.clBevelShade, MainTexture.clBevelLight);
     545        MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    546546    end;
    547547  end
    548548  else if Page <> pgMain then
    549549    Frame(Canvas, 328, Up1Btn.top - 15, ClientWidth, Up2Btn.top + 38,
    550       MainTexture.clBevelShade, MainTexture.clBevelLight);
     550      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    551551  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    552552
    553553  // draw tabs
    554554  Frame(Canvas, 2, 2 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize - 1,
    555     TabHeight, MainTexture.clBevelLight, MainTexture.clBevelShade);
     555    TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    556556  Frame(Canvas, 1, 1 + 2 * integer(Tab <> tbMain), TabOffset + (0 + 1) * TabSize,
    557     TabHeight, MainTexture.clBevelLight, MainTexture.clBevelShade);
    558   Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.clBevelShade;
     557    TabHeight, MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
     558  Canvas.Pixels[1, 1 + 2 * integer(Tab <> tbMain)] := MainTexture.ColorBevelShade;
    559559  for Tab2 := tbMap to tbPrevious do
    560560  begin
    561561    Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 2, 2 + 2 * integer(Tab <> Tab2),
    562       TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.clBevelLight,
    563       MainTexture.clBevelShade);
     562      TabOffset + (Integer(Tab2) + 1) * TabSize - 1, TabHeight, MainTexture.ColorBevelLight,
     563      MainTexture.ColorBevelShade);
    564564    Frame(Canvas, TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2),
    565       TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.clBevelLight,
    566       MainTexture.clBevelShade);
     565      TabOffset + (Integer(Tab2) + 1) * TabSize, TabHeight, MainTexture.ColorBevelLight,
     566      MainTexture.ColorBevelShade);
    567567    Canvas.Pixels[TabOffset + Integer(Tab2) * TabSize + 1, 1 + 2 * integer(Tab <> Tab2)] :=
    568       MainTexture.clBevelShade;
     568      MainTexture.ColorBevelShade;
    569569  end;
    570570  Canvas.Font.Assign(UniFont[ftNormal]);
     
    579579    $000000, $000000);
    580580  Frame(Canvas, 1, TabHeight + 1, ClientWidth - 2, ClientHeight - 2,
    581     MainTexture.clBevelLight, MainTexture.clBevelShade);
     581    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    582582  Frame(Canvas, 2, TabHeight + 2, ClientWidth - 3, ClientHeight - 3,
    583     MainTexture.clBevelLight, MainTexture.clBevelShade);
     583    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    584584  if Tab = tbMain then
    585585  begin
    586586    PaintBackground(self, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4);
    587     Canvas.Pixels[2, TabHeight] := MainTexture.clBevelLight;
     587    Canvas.Pixels[2, TabHeight] := MainTexture.ColorBevelLight;
    588588  end
    589589  else
     
    592592      TabSize - 4, 4);
    593593    Canvas.Pixels[TabOffset + Integer(Tab) * TabSize + 2, TabHeight] :=
    594       MainTexture.clBevelLight;
     594      MainTexture.ColorBevelLight;
    595595  end;
    596596  Canvas.Pixels[TabOffset + (Integer(Tab) + 1) * TabSize - 1, TabHeight + 1] :=
    597     MainTexture.clBevelShade;
     597    MainTexture.ColorBevelShade;
    598598  if Tab < tbPrevious then
    599599    Frame(Canvas, TabOffset + (Integer(Tab) + 1) * TabSize + 1, 3,
    600       TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture.clBevelShade,
    601       MainTexture.clBevelShade); // Tab shadow
     600      TabOffset + (Integer(Tab) + 1) * TabSize + 2, TabHeight, MainTexture.ColorBevelShade,
     601      MainTexture.ColorBevelShade); // Tab shadow
    602602
    603603  // Paint menu logo
     
    685685            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    686686        end;
    687       PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.clBevelLight,
    688         MainTexture.clBevelShade);
     687      PaintLogo(Canvas, 69 + 11 * 27, yLogo, MainTexture.ColorBevelLight,
     688        MainTexture.ColorBevelShade);
    689689
    690690      for i := 0 to nPlOffered - 1 do
     
    706706            RFrame(Canvas, PlayerSlots[i].DiffUpBtn.left - 1, PlayerSlots[i].DiffUpBtn.top - 1,
    707707              PlayerSlots[i].DiffUpBtn.left + 12, PlayerSlots[i].DiffUpBtn.top + 24,
    708               MainTexture.clBevelShade, MainTexture.clBevelLight);
     708              MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    709709            with Canvas do
    710710            begin
     
    718718              RFrame(Canvas, PlayerSlots[I].MultiBtn.left - 1, PlayerSlots[I].MultiBtn.top - 1,
    719719                PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12,
    720                 MainTexture.clBevelShade, MainTexture.clBevelLight);
     720                MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    721721              BitBltCanvas(Canvas, xBrain[i] - 31, yBrain[i], 13, 12,
    722722                HGrSystem.Data.Canvas, 88, 47);
     
    733733    else
    734734    begin
    735       DLine(Canvas, 24, 198, yMain + 140 + 19, MainTexture.clBevelLight,
    736         MainTexture.clBevelShade);
     735      DLine(Canvas, 24, 198, yMain + 140 + 19, MainTexture.ColorBevelLight,
     736        MainTexture.ColorBevelShade);
    737737      RisedTextOut(Canvas, 24 { x0Brain+32-BiColorTextWidth(Canvas,s) div 2 } ,
    738738        yMain + 140 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 15));
     
    746746
    747747      DLine(Canvas, 24, xDefault - 6, yMain + 164 + 19,
    748         MainTexture.clBevelLight, MainTexture.clBevelShade);
     748        MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    749749      RisedTextOut(Canvas, 24 { x0Brain+32-BiColorTextWidth(Canvas,s) div 2 } ,
    750750        yMain + 164 { y0Mini-77 } , Phrases.Lookup('STARTCONTROLS', 16));
     
    755755        FrameImage(Canvas, BrainDefault.Picture, xDefault, yDefault, 64, 64,
    756756          0, 0, true);
    757       DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.clBevelLight,
    758         MainTexture.clBevelShade);
     757      DLine(Canvas, 56, 272, y0Mini + 61 + 19, MainTexture.ColorBevelLight,
     758        MainTexture.ColorBevelShade);
    759759
    760760      RisedTextOut(Canvas, 56, y0Mini + 61,
     
    771771            HGrSystem2.Data.Canvas, Ornament.Left, Ornament.Top, SRCPAINT);
    772772        end;
    773       PaintLogo(Canvas, 69, yLogo, MainTexture.clBevelLight,
    774         MainTexture.clBevelShade);
     773      PaintLogo(Canvas, 69, yLogo, MainTexture.ColorBevelLight,
     774        MainTexture.ColorBevelShade);
    775775    end;
    776776  end
     
    788788    end
    789789    else
    790       DLine(Canvas, 344, 514, y0Mini + 61 + 19, MainTexture.clBevelLight,
    791         MainTexture.clBevelShade);
     790      DLine(Canvas, 344, 514, y0Mini + 61 + 19, MainTexture.ColorBevelLight,
     791        MainTexture.ColorBevelShade);
    792792    RisedTextOut(Canvas, 344, y0Mini + 61, Phrases.Lookup('STARTCONTROLS', 8));
    793793    s := TurnToString(LoadTurn);
     
    805805  else if Page = pgEditMap then
    806806  begin
    807     // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.clBevelLight,MainTexture.clBevelShade);
     807    // DLine(Canvas,344,514,y0Mini+61+19,MainTexture.ColorBevelLight,MainTexture.ColorBevelShade);
    808808    s := Format(Phrases2.Lookup('MAPPROP'),
    809809      [(nMapLandTiles * 100 + 556) div 1112,
     
    818818  if Up2Btn.Visible then
    819819    RFrame(Canvas, Up2Btn.left - 1, Up2Btn.top - 1, Up2Btn.left + 12,
    820       Up2Btn.top + 24, MainTexture.clBevelShade, MainTexture.clBevelLight);
     820      Up2Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    821821  if Up1Btn.Visible then
    822822    RFrame(Canvas, Up1Btn.left - 1, Up1Btn.top - 1, Up1Btn.left + 12,
    823       Up1Btn.top + 24, MainTexture.clBevelShade, MainTexture.clBevelLight);
     823      Up1Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    824824  if AutoDiffUpBtn.Visible then
    825825    RFrame(Canvas, AutoDiffUpBtn.left - 1, AutoDiffUpBtn.top - 1,
    826       AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture.clBevelShade,
    827       MainTexture.clBevelLight);
     826      AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture.ColorBevelShade,
     827      MainTexture.ColorBevelLight);
    828828  if AutoEnemyUpBtn.Visible then
    829829    RFrame(Canvas, AutoEnemyUpBtn.left - 1, AutoEnemyUpBtn.top - 1,
    830830      AutoEnemyUpBtn.left + 12, AutoEnemyUpBtn.top + 24,
    831       MainTexture.clBevelShade, MainTexture.clBevelLight);
     831      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    832832  if CustomizeBtn.Visible then
    833833    RFrame(Canvas, CustomizeBtn.left - 1, CustomizeBtn.top - 1,
    834       CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture.clBevelShade,
    835       MainTexture.clBevelLight);
     834      CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture.ColorBevelShade,
     835      MainTexture.ColorBevelLight);
    836836  if List.Visible then
    837837    EditFrame(Canvas, List.BoundsRect, MainTexture);
     
    848848    yMini := y0Mini - MiniMap.Size.Y div 2;
    849849    Frame(Canvas, xMini, yMini, xMini + 3 + MiniMap.Size.X * 2,
    850       yMini + 3 + MiniMap.Size.Y, MainTexture.clBevelLight,
    851       MainTexture.clBevelShade);
     850      yMini + 3 + MiniMap.Size.Y, MainTexture.ColorBevelLight,
     851      MainTexture.ColorBevelShade);
    852852    Frame(Canvas, xMini + 1, yMini + 1, xMini + 2 + MiniMap.Size.X * 2,
    853       yMini + 2 + MiniMap.Size.Y, MainTexture.clBevelShade,
    854       MainTexture.clBevelLight);
     853      yMini + 2 + MiniMap.Size.Y, MainTexture.ColorBevelShade,
     854      MainTexture.ColorBevelLight);
    855855
    856856    s := '';
     
    878878procedure TStartDlg.FormShow(Sender: TObject);
    879879begin
    880   SetMainTextureByAge(-1);
    881   List.Font.Color := MainTexture.clMark;
     880  MainTexture.Age := -1;
     881  List.Font.Color := MainTexture.ColorMark;
    882882
    883883  Fill(EmptyPicture.Canvas, Bounds(0, 0, 64, 64),
    884     Point((wMaintexture - 64) div 2, (hMaintexture - 64) div 2));
     884    Point((Maintexture.Width - 64) div 2, (Maintexture.Height - 64) div 2));
    885885
    886886  DarkenImage(EmptyPicture, 28);
Note: See TracChangeset for help on using the changeset viewer.