Changeset 509 for trunk


Ignore:
Timestamp:
Dec 26, 2023, 10:32:19 AM (11 months ago)
Author:
chronos
Message:
  • Modified: Update message dialog height only once.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/MessgEx.pas

    r506 r509  
    8282var
    8383  I: Integer;
     84  NewHeight: Integer;
    8485begin
    8586  if IconKind = mikEnemyArmy then
     
    151152
    152153  SplitText(True);
    153   Height := 72 + Border + TopSpace + Lines * MessageLineSpacing;
     154  NewHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    154155  if GameMode = cMovie then
    155     Height := Height - 32;
     156    NewHeight := NewHeight - 32;
    156157  if Kind = mkModel then
    157     Height := Height + 36;
     158    NewHeight := NewHeight + 36;
    158159  if IconKind in [mikMyArmy, mikEnemyArmy] then
    159160  begin
    160161    if nLostArmy > LostUnitsPerLine * 6 then
    161       Height := Height + 6 * 48
     162      NewHeight := NewHeight + 6 * 48
    162163    else
    163       Height := Height + ((nLostArmy - 1) div LostUnitsPerLine
    164         + 1) * 48;
    165   end;
     164      NewHeight := NewHeight + ((nLostArmy - 1) div LostUnitsPerLine + 1) * 48;
     165  end;
     166  Height := NewHeight;
     167
    166168  case CenterTo of
    167169    0:
     
    391393          ImpImage(Canvas, Width div 2 - 28, 24, -7)
    392394        else
    393           ImpImage(Canvas, Width div 2 - 28, 24, 24 + IconIndex)
     395          ImpImage(Canvas, Width div 2 - 28, 24, 24 + IconIndex);
    394396      end;
    395397    mikModel:
     
    412414          Tribe[IconIndex].faceHGr.Data.Canvas,
    413415          1 + Tribe[IconIndex].facepix mod 10 * 65,
    414           1 + Tribe[IconIndex].facepix div 10 * 49)
     416          1 + Tribe[IconIndex].facepix div 10 * 49);
    415417      end;
    416418    mikPureIcon:
Note: See TracChangeset for help on using the changeset viewer.