Changeset 473


Ignore:
Timestamp:
Dec 4, 2023, 12:13:15 PM (5 months ago)
Author:
chronos
Message:
  • Added: Custom DPI configuration in Settings dialog.
  • Fixed: Better High DPI support.
Location:
trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Integrated.lpi

    r469 r473  
    7777      </Item2>
    7878      <SharedMatrixOptions Count="2">
    79         <Item1 ID="151739052537" Targets="CevoComponents,Common,DpiControls" Modes="Debug" Value="-g -gl -gh -O1"/>
     79        <Item1 ID="151739052537" Targets="CevoComponents,Common,DpiControls" Modes="Debug" Value="-g -gl -gh -O1 -dDPI"/>
    8080        <Item2 ID="186701832267" Targets="CevoComponents,Common,DpiControls" Modes="Release" Value="-CX -XX -O3"/>
    8181      </SharedMatrixOptions>
     
    415415        <IgnoredMessages idx6058="True" idx5024="True"/>
    416416      </CompilerMessages>
    417       <CustomOptions Value="-dDEBUG"/>
     417      <CustomOptions Value="-dDEBUG
     418-dDPI"/>
    418419      <OtherDefines Count="2">
    419420        <Define0 Value="DEBUG"/>
  • trunk/Integrated.lpr

    r471 r473  
    88  Interfaces, SysUtils, Protocol, GameServer, Direct, Start, Messg, Inp,
    99  Back, Log, LocalPlayer, ClientTools, Tribes, IsoEngine, Term, CityScreen, Nego,
    10   NoTerm, ScreenTools, Directories,
     10  NoTerm, ScreenTools, Directories, Global,
    1111  {$IFDEF DPI}Dpi.Forms{$ELSE}Forms{$ENDIF};
    1212
     
    2929  Application.Title := 'C-evo';
    3030  Application.TaskBarBehavior := TTaskBarBehavior.tbMultiButton;
     31  ScreenTools.LoadConfig(AppRegistryKey);
    3132  Directories.UnitInit;
    3233  ScreenTools.UnitInit;
  • trunk/Language.txt

    r426 r473  
    167167#EXPEL Units have been expelled from #a territory.
    168168#DISPOSE %s\\Shall we rebuild this building?
    169 #SPDESTRUCTQUERY \(Note: We will lose control of our colony ship when we dismantle the space port!) 
     169#SPDESTRUCTQUERY \(Note: We will lose control of our colony ship when we dismantle the space port!)
    170170#SELL %s\\Shall we sell this building?
    171171#LOSEMAT A complete change in project type means to start a new project. %d%%p will be sold for %d%%c.
    172172#LOSEMAT3 Changing the project will result in a loss of 1/3 of the material collected for the project. Continue?
    173 #DOUBLESTATEIMP %s\\This state improvement already exists in the city of %s. Shall we move it to this city and sell the former building when finished? 
     173#DOUBLESTATEIMP %s\\This state improvement already exists in the city of %s. Shall we move it to this city and sell the former building when finished?
    174174#READY The project will be completed next turn.
    175175#NOMONEY We don't have enough money\to complete this project next turn.\(%d%%c needed, %d%%c available)
     
    180180#GLIDERLOST Our glider was lost at sea.
    181181#PLANELOST Our aircraft has run out of fuel.
    182 #DAMAGED_UTILIZE Utilizing a damaged unit has reduced benefit. Continue? 
     182#DAMAGED_UTILIZE Utilizing a damaged unit has reduced benefit. Continue?
    183183#NOBB We lack the technology of building bridges across rivers.
    184184#NOCITY This type of terrain is not suitable for settlement. We should look for terrain that allows irrigation.
     
    257257#SHAREDWIN_CONCAT %s, %s
    258258#NOAI No AI installed!
    259 #FILENOTFOUND File "%s" was not found. 
     259#FILENOTFOUND File "%s" was not found.
    260260#AIEXCEPTION Unhandled exception in AI module %s!
    261261#LOADERR This book is not compatible with this version of C-evo.
     
    291291#MAX2OFFERS You can't combine more than two offers in one proposal.
    292292#NOOFFER This proposal is invalid!
    293 #CANCELTREATYRUSH Cancelling more than one treaty with the same nation within 3 turns is not allowed. 
    294 #NOSPACEPORT We do not have a space port, so we'd lose all colony ship parts that we receive. Continue anyway? 
     293#CANCELTREATYRUSH Cancelling more than one treaty with the same nation within 3 turns is not allowed.
     294#NOSPACEPORT We do not have a space port, so we'd lose all colony ship parts that we receive. Continue anyway?
    295295#SUICIDE Shall we send these\men to death?
    296296#RATES What shall we orient\our economy towards?
     
    806806Fortified
    807807Bomber armed
    808 Moving in mountains 
     808Moving in mountains
    809809Conscripts
    810810Withdrawn
     
    960960Languages
    961961Key bindings
     962Custom DPI
     963DPI
  • trunk/LocalPlayer/MessgEx.pas

    r471 r473  
    103103  else
    104104    Button1.Left := 159;
    105   RemoveBtn.Left := ClientWidth - 38;
     105  RemoveBtn.Left := Width - 38;
    106106  case Kind of
    107107    mkYesNo, mkYesNoCancel:
     
    151151
    152152  SplitText(True);
    153   ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
     153  Height := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    154154  if GameMode = cMovie then
    155     ClientHeight := ClientHeight - 32;
     155    Height := Height - 32;
    156156  if Kind = mkModel then
    157     ClientHeight := ClientHeight + 36;
     157    Height := Height + 36;
    158158  if IconKind in [mikMyArmy, mikEnemyArmy] then
    159159  begin
    160160    if nLostArmy > LostUnitsPerLine * 6 then
    161       ClientHeight := ClientHeight + 6 * 48
     161      Height := Height + 6 * 48
    162162    else
    163       ClientHeight := ClientHeight + ((nLostArmy - 1) div LostUnitsPerLine
     163      Height := Height + ((nLostArmy - 1) div LostUnitsPerLine
    164164        + 1) * 48;
    165165  end;
     
    167167    0:
    168168      begin
    169         Left := (Screen.Width - ClientWidth) div 2;
    170         Top := (Screen.Height - ClientHeight) div 2 - MapCenterUp;
     169        Left := (Screen.Width - Width) div 2;
     170        Top := (Screen.Height - Height) div 2 - MapCenterUp;
    171171      end;
    172172    1:
    173173      begin
    174         Left := (Screen.Width - ClientWidth) div 4;
    175         Top := (Screen.Height - ClientHeight) * 2 div 3 - MapCenterUp;
     174        Left := (Screen.Width - Width) div 4;
     175        Top := (Screen.Height - Height) * 2 div 3 - MapCenterUp;
    176176      end;
    177177    -1:
    178178      begin
    179         Left := (Screen.Width - ClientWidth) div 4;
    180         Top := (Screen.Height - ClientHeight) div 3 - MapCenterUp;
     179        Left := (Screen.Width - Width) div 4;
     180        Top := (Screen.Height - Height) div 3 - MapCenterUp;
    181181      end;
    182182  end;
    183183  for I := 0 to ControlCount - 1 do
    184     Controls[I].Top := ClientHeight - (34 + Border);
     184    Controls[I].Top := Height - (34 + Border);
    185185  if Kind = mkModel then
    186     EInput.Top := ClientHeight - (76 + Border);
     186    EInput.Top := Height - (76 + Border);
    187187end;
    188188
     
    321321    for count := 0 to LostArmy[emix] - 1 do
    322322    begin
    323       X := ClientWidth div 2 + ix * 64 - UnitsInLine * 32;
     323      X := Width div 2 + ix * 64 - UnitsInLine * 32;
    324324      Y := 26 + Border + TopSpace + Lines * MessageLineSpacing + iy * 48;
    325325      with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do
     
    371371        BitBltCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
    372372          ySizeBig + 2 * GlowRange, Canvas,
    373           ClientWidth div 2 - (28 + GlowRange), 24 - GlowRange);
     373          Width div 2 - (28 + GlowRange), 24 - GlowRange);
    374374        BitBltCanvas(Buffer.Canvas, GlowRange, GlowRange, xSizeBig, ySizeBig,
    375375          BigImp.Canvas, IconIndex mod 7 * xSizeBig,
     
    380380          GlowFrame(Buffer, GlowRange, GlowRange, xSizeBig, ySizeBig,
    381381            Tribe[p1].Color);
    382         BitBltCanvas(Canvas, ClientWidth div 2 - (28 + GlowRange),
     382        BitBltCanvas(Canvas, Width div 2 - (28 + GlowRange),
    383383          24 - GlowRange, xSizeBig + 2 * GlowRange, ySizeBig + 2 * GlowRange,
    384384          Buffer.Canvas, 0, 0);
    385385      end
    386386      else
    387         ImpImage(Canvas, ClientWidth div 2 - 28, 24, IconIndex);
     387        ImpImage(Canvas, Width div 2 - 28, 24, IconIndex);
    388388    mikAge:
    389389      begin
    390390        if IconIndex = 0 then
    391           ImpImage(Canvas, ClientWidth div 2 - 28, 24, -7)
     391          ImpImage(Canvas, Width div 2 - 28, 24, -7)
    392392        else
    393           ImpImage(Canvas, ClientWidth div 2 - 28, 24, 24 + IconIndex)
     393          ImpImage(Canvas, Width div 2 - 28, 24, 24 + IconIndex)
    394394      end;
    395395    mikModel:
    396396      with Tribe[Me].ModelPicture[IconIndex] do
    397397      begin
    398         FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig,
     398        FrameImage(Canvas, BigImp, Width div 2 - 28, 24, xSizeBig,
    399399          ySizeBig, 0, 0);
    400         BitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
     400        BitBltCanvas(Canvas, Width div 2 - 32, 20, 64, 44,
    401401          HGr.Mask.Canvas, pix mod 10 * 65 + 1,
    402402          pix div 10 * 49 + 1, SRCAND);
    403         BitBltCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
     403        BitBltCanvas(Canvas, Width div 2 - 32, 20, 64, 44,
    404404          HGr.Data.Canvas, pix mod 10 * 65 + 1,
    405405          pix div 10 * 49 + 1, SRCPAINT);
    406406      end;
    407407    mikBook:
    408       PaintBook(Canvas, ClientWidth div 2, 24, MainTexture.ColorPage,
     408      PaintBook(Canvas, Width div 2, 24, MainTexture.ColorPage,
    409409        MainTexture.ColorCover);
    410410    mikTribe:
    411411      if Assigned(Tribe[IconIndex].faceHGr) then
    412412      begin
    413         Frame(Canvas, ClientWidth div 2 - 32 - 1, 24 - 1,
    414           ClientWidth div 2 + 32, 24 + 48, $000000, $000000);
    415         BitBltCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48,
     413        Frame(Canvas, Width div 2 - 32 - 1, 24 - 1,
     414          Width div 2 + 32, 24 + 48, $000000, $000000);
     415        BitBltCanvas(Canvas, Width div 2 - 32, 24, 64, 48,
    416416          Tribe[IconIndex].faceHGr.Data.Canvas,
    417417          1 + Tribe[IconIndex].facepix mod 10 * 65,
     
    419419      end;
    420420    mikPureIcon:
    421       FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig, ySizeBig,
     421      FrameImage(Canvas, BigImp, Width div 2 - 28, 24, xSizeBig, ySizeBig,
    422422        IconIndex mod 7 * xSizeBig, IconIndex div 7 * ySizeBig);
    423423    mikBigIcon:
    424       FrameImage(Canvas, BigImp, ClientWidth div 2 - 3 * 28, 32, xSizeBig * 3,
     424      FrameImage(Canvas, BigImp, Width div 2 - 3 * 28, 32, xSizeBig * 3,
    425425        ySizeBig * 3, IconIndex mod 2 * 3 * xSizeBig,
    426426        IconIndex div 2 * 3 * ySizeBig);
     
    428428      begin
    429429        BitBltCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
    430           (ClientWidth - 140) div 2, 24);
     430          (Width - 140) div 2, 24);
    431431        ImageOp_BCC(Buffer, Templates.Data, Point(0, 0), StarshipDeparted.BoundsRect, 0, $FFFFFF);
    432         BitBltCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,
     432        BitBltCanvas(Canvas, (Width - 140) div 2, 24, 140, 120,
    433433          Buffer.Canvas, 0, 0);
    434434      end;
     
    438438      PaintEnemyArmy;
    439439    mikFullControl:
    440       Sprite(Canvas, HGrSystem2, ClientWidth div 2 - 31, 24, 63, 63, 1, 281);
     440      Sprite(Canvas, HGrSystem2, Width div 2 - 31, 24, 63, 63, 1, 281);
    441441    mikShip:
    442       PaintColonyShip(Canvas, IconIndex, 17, ClientWidth - 34, 38);
     442      PaintColonyShip(Canvas, IconIndex, 17, Width - 34, 38);
    443443  end;
    444444
  • trunk/LocalPlayer/Select.pas

    r471 r473  
    180180  if S <> '' then
    181181    LoweredTextOut(Canvas, -1, MainTexture,
    182       (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, 31, S);
     182      (Width - BiColorTextWidth(Canvas, S)) div 2, 31, S);
    183183  if not MultiPage and (Kind in [kProject, kAdvance, kFarAdvance]) and not Phrases2FallenBackToEnglish
    184184  then
     
    186186    S := Phrases2.Lookup('SHIFTCLICK');
    187187    LoweredTextOut(Canvas, -2, MainTexture,
    188       (ClientWidth - BiColorTextWidth(Canvas, S)) div 2, ClientHeight - 29, S);
     188      (Width - BiColorTextWidth(Canvas, S)) div 2, Height - 29, S);
    189189  end;
    190190end;
     
    231231      if Y + TextSize.cy >= TitleHeight + InnerHeight then
    232232        TextSize.cy := TitleHeight + InnerHeight - Y;
    233       Fill(ca, X, Y, TextSize.cx, TextSize.cy, (Maintexture.Width - ClientWidth)
    234         div 2, (Maintexture.Height - ClientHeight) div 2);
     233      Fill(ca, X, Y, TextSize.cx, TextSize.cy, (Maintexture.Width - Width)
     234        div 2, (Maintexture.Height - Height) div 2);
    235235    end;
    236236    LoweredTextOut(ca, Color, MainTexture, X, Y, S);
     
    811811    if ScienceNation <> OldScienceNation then
    812812    begin
    813       Fill(Canvas, 9, ClientHeight - 29, ClientWidth - 18, 24,
    814         (Maintexture.Width - ClientWidth) div 2,
    815         (Maintexture.Height - ClientHeight) div 2);
     813      Fill(Canvas, 9, Height - 29, Width - 18, 24,
     814        (Maintexture.Width - Width) div 2,
     815        (Maintexture.Height - Height) div 2);
    816816      if ScienceNation >= 0 then
    817817      begin
     
    823823          S := S + ' (' + TurnToString(MyRO.EnemyReport[ScienceNation]
    824824            .TurnOfCivilReport) + ')'; // old report
    825         xScreen := (ClientWidth - BiColorTextWidth(Canvas, S)) div 2;
     825        xScreen := (Width - BiColorTextWidth(Canvas, S)) div 2;
    826826        LoweredTextOut(Canvas, -1, MainTexture, xScreen + 10,
    827           ClientHeight - 29, S);
     827          Height - 29, S);
    828828        BitBltCanvas(ScienceNationDotBuffer.Canvas, 0, 0, ScienceNationDot.Width,
    829           ScienceNationDot.Height, Canvas, xScreen - 10, ClientHeight - 27);
     829          ScienceNationDot.Height, Canvas, xScreen - 10, Height - 27);
    830830        ImageOp_BCC(ScienceNationDotBuffer, Templates.Data, Point(0, 0),
    831831          ScienceNationDot.BoundsRect, MainTexture.ColorBevelShade, Tribe[ScienceNation].Color);
    832         BitBltCanvas(Canvas, xScreen - 10, ClientHeight - 27, ScienceNationDot.Width,
     832        BitBltCanvas(Canvas, xScreen - 10, Height - 27, ScienceNationDot.Width,
    833833          ScienceNationDot.Height, ScienceNationDotBuffer.Canvas, 0, 0);
    834834      end;
     
    15771577      DispLines := MaxLines;
    15781578    InnerHeight := LineDistance * (DispLines + 1) + 24;
    1579     ClientHeight := InnerHeight + TitleHeight + WideFrame;
     1579    Height := InnerHeight + TitleHeight + WideFrame;
    15801580  end
    15811581  else
     
    15841584      DispLines := MaxLines;
    15851585    InnerHeight := LineDistance * (DispLines + 1) + 24;
    1586     ClientHeight := InnerHeight + TitleHeight + NarrowFrame;
    1587   end;
    1588   Assert(ClientHeight <= Maintexture.Height);
     1586    Height := InnerHeight + TitleHeight + NarrowFrame;
     1587  end;
     1588  Assert(Height <= Maintexture.Height);
    15891589
    15901590  TechNameSpace := 224;
     
    16181618    InnerWidth := 363;
    16191619  end;
    1620   ClientWidth := InnerWidth + 2 * SideFrame;
    1621 
    1622   CloseBtn.Left := ClientWidth - 38;
     1620  Width := InnerWidth + 2 * SideFrame;
     1621
     1622  CloseBtn.Left := Width - 38;
    16231623  CaptionLeft := ToggleBtn.Left + ToggleBtn.Width;
    16241624  CaptionRight := CloseBtn.Left;
     
    16451645  if Kind = kProject then
    16461646  begin
    1647     Layer0Btn.Top := ClientHeight - 31;
    1648     Layer0Btn.Left := ClientWidth div 2 - (12 + 29);
     1647    Layer0Btn.Top := Height - 31;
     1648    Layer0Btn.Left := Width div 2 - (12 + 29);
    16491649    Layer0Btn.Down := True;
    1650     Layer1Btn.Top := ClientHeight - 31;
    1651     Layer1Btn.Left := ClientWidth div 2 - (12 - 29);
     1650    Layer1Btn.Top := Height - 31;
     1651    Layer1Btn.Left := Width div 2 - (12 - 29);
    16521652    Layer1Btn.Down := False;
    1653     Layer2Btn.Top := ClientHeight - 31;
    1654     Layer2Btn.Left := ClientWidth div 2 - 12;
     1653    Layer2Btn.Top := Height - 31;
     1654    Layer2Btn.Left := Width div 2 - 12;
    16551655    Layer2Btn.Down := False;
    16561656  end;
     
    16671667var
    16681668  I: Integer;
    1669   ShowFocus, forceclose: Boolean;
    1670 begin
    1671   forceclose := (ListKind <> Kind) and
     1669  ShowFocus, ForceClose: Boolean;
     1670begin
     1671  ForceClose := (ListKind <> Kind) and
    16721672    not((Kind = kCities) and (ListKind = kCityEvents)) and
    16731673    not((Kind = kCityEvents) and (ListKind = kCities)) and
     
    17461746  CloseBtn.Visible := not(Kind in MustChooseKind);
    17471747
    1748   inherited ShowNewContent(NewMode, forceclose);
     1748  inherited ShowNewContent(NewMode, ForceClose);
    17491749end;
    17501750
  • trunk/Localization/cs/Language.txt

    r436 r473  
    167167#EXPEL Jednotky byly vyhnány z #e území.
    168168#DISPOSE %s\\Máme přestavět tuto budovu?
    169 #SPDESTRUCTQUERY \(Poznámka: Pokud zbouráme vesmírné středisko, ztratíme kontrolu nad naší kolonizační lodí!) 
     169#SPDESTRUCTQUERY \(Poznámka: Pokud zbouráme vesmírné středisko, ztratíme kontrolu nad naší kolonizační lodí!)
    170170#SELL %s\\Máme prodat tuto budovu?
    171171#LOSEMAT Úplná změna projektu znamená zahájení nového projektu. %d%%p bude prodán za %d%%c.
    172172#LOSEMAT3 Změna projektu bude znamenat ztrátu 1/3 spotřebovaného materiálu. Chcete pokračovat?
    173 #DOUBLESTATEIMP %s\\Toto národní vylepšení již postavilo město %s. Máme je sem přesunout a po dokončení stavby prodat národní vylepšení v původním městě? 
     173#DOUBLESTATEIMP %s\\Toto národní vylepšení již postavilo město %s. Máme je sem přesunout a po dokončení stavby prodat národní vylepšení v původním městě?
    174174#READY Projekt bude dokončen v příštím kole.
    175175#NOMONEY Nemáme dost peněz, abychom\projekt dokončili v dalším tahu.\(%d%%c potřeba, %d%%c k dispozici)
     
    180180#GLIDERLOST Náš kluzák se ztratil nad mořem.
    181181#PLANELOST Našemu letadlu došlo palivo.
    182 #DAMAGED_UTILIZE Využití poškozené jednotky nám přinese méně zisku. Chcete pokračovat? 
     182#DAMAGED_UTILIZE Využití poškozené jednotky nám přinese méně zisku. Chcete pokračovat?
    183183#NOBB Schází nám technologie pro budování mostů přes řeky.
    184184#NOCITY Tento typ terénu není vhodný k osídlení. Měli bychom vyhledat místa, na kterých můžeme postavit zavlažování.
     
    257257#SHAREDWIN_CONCAT %s, %s
    258258#NOAI Není nainstalován žádný AI modul!
    259 #FILENOTFOUND Soubor "%s" nebyl nalezen. 
     259#FILENOTFOUND Soubor "%s" nebyl nalezen.
    260260#AIEXCEPTION Došlo k výjimce v AI modulu %s!
    261261#LOADERR Tato kniha není kompatibilní s touto verzí C-evo.
     
    291291#MAX2OFFERS Nelze kombinovat více než dvě nabídky v jednom návrhu.
    292292#NOOFFER Tento návrh není platný!
    293 #CANCELTREATYRUSH Není povoleno během 3 tahů ukončit více než jednu smlouvu se stejným národem. 
     293#CANCELTREATYRUSH Není povoleno během 3 tahů ukončit více než jednu smlouvu se stejným národem.
    294294#NOSPACEPORT Nemáme vesmírné středisko, takže bychom ztratili všechny dojednané části kolonizační lodi. Chcete přesto pokračovat?
    295295#SUICIDE Máme poslat tyto\muže na smrt?
     
    806806Opevněný
    807807Bomby
    808 Pohyb v horách 
     808Pohyb v horách
    809809Branci
    810810Odvolaný
     
    960960Jazyky
    961961Klávesové zkratky
     962Vlastní DPI
     963DPI
  • trunk/Localization/de/Language.txt

    r426 r473  
    164164#EXPEL Unsere Einheiten wurden vom Territorium der #S ausgewiesen.
    165165#DISPOSE %s abreißen und 2/3 der %%p\\der aktuellen Produktion zuführen?
    166 #SPDESTRUCTQUERY \(Anmerkung: Wir verlieren alle Bauteile des Raumschiffs, falls wir den Weltraumbahnhof demontieren!) 
     166#SPDESTRUCTQUERY \(Anmerkung: Wir verlieren alle Bauteile des Raumschiffs, falls wir den Weltraumbahnhof demontieren!)
    167167#SELL %s\\Dieses Bauwerk verkaufen?
    168168#LOSEMAT Ein Wechsel in einen anderen Projekttyp startet ein neues Projekt. Die %d%%p werden in %d%%c umgewandelt. Weiter?
     
    231231#FAMINE_TILES Vorsicht!\Die Stadt %s steht kurz vor einer Hungersnot. Es sind zu zuwenig fruchtbare Landschaften verfügbar.\Einfach weitermachen wie bisher?
    232232#FAMINE_UNREST Vorsicht!\Die Stadt %s steht kurz vor einer Hungersnot. Teile der Bevölkerung verlangen einen verstärkten Polizeieinsatz zur Bekämpfung der Unruhen. Die Schwächung der Wirtschaft hat ein solches Ausmaß erreicht, dass nicht mehr genug Nahrung produziert wird.\\Einfach weitermachen wie bisher?
    233 #LOWSUPPORT Achtung!\Die Stadt %s produziert nicht genug Material um alle ihre Einheiten unterstützen zu können. Trotzdem weitermachen wie bisher? 
     233#LOWSUPPORT Achtung!\Die Stadt %s produziert nicht genug Material um alle ihre Einheiten unterstützen zu können. Trotzdem weitermachen wie bisher?
    234234#LOWSUPPORT_TILES Achtung!\Die Stadt %s produziert nicht genug Material um alle ihre Einheiten unterstützen zu können. Es sind zu zuwenig produktive Landschaften verfügbar.\Einfach weitermachen wie bisher?
    235235#LOWSUPPORT_UNREST Achtung!\Die Stadt %s produziert nicht genug Material um alle ihre Einheiten unterstützen zu können. Teile der Bevölkerung verlangen einen verstärkten Polizeieinsatz zur Bekämpfung der Unruhen. Die Schwächung der Wirtschaft hat ein solches Ausmaß erreicht, dass nicht mehr genug Material produziert wird.\\Einfach weitermachen wie bisher?
     
    254254#SHAREDWIN_CONCAT %s, %s
    255255#NOAI Es ist keine KI installiert!
    256 #FILENOTFOUND Die Datei "%s" wurde nicht gefunden. 
     256#FILENOTFOUND Die Datei "%s" wurde nicht gefunden.
    257257#AIEXCEPTION Unerwarteter Fehler im KI module %s!
    258258#LOADERR Dies ist kein Buch der aktuellen C-evo Version.
     
    289289#NOOFFER Dieser Antrag ist ungültig.
    290290#CANCELTREATYRUSH Die Aufhebung von mehr als einem Abkommen mit der gleichen Nation innerhalb von 3 Runden, ist nicht erlaubt.
    291 #NOSPACEPORT Da wir keinen Weltraumbahnhof besitzen, würden wir alle Teile für das Raumschiff verlieren. Trotzdem fortfahren? 
     291#NOSPACEPORT Da wir keinen Weltraumbahnhof besitzen, würden wir alle Teile für das Raumschiff verlieren. Trotzdem fortfahren?
    292292#SUICIDE Soll diese Einheit\in den sicheren Tod geschickt werden?
    293293#RATES Wie sollen wir\unsere Wirtschaft ausrichten?
     
    978978Languages
    979979Key bindings
     980Custom DPI
     981DPI
  • trunk/Localization/fr/Language.txt

    r453 r473  
    166166#EXPEL Des unités ont été expulsées de #a territoire.
    167167#DISPOSE %s\\Devons-nous reconstruire ce bâtiment?
    168 #SPDESTRUCTQUERY \(Note: Nous allons perdre le contrôle de notre vaisseau colonial lorsque nous démantèlerons le port spatial!) 
     168#SPDESTRUCTQUERY \(Note: Nous allons perdre le contrôle de notre vaisseau colonial lorsque nous démantèlerons le port spatial!)
    169169#SELL %s\\Allons-nous vendre ce bâtiment?
    170170#LOSEMAT Un changement complet de type de projet signifie le lancement d'un nouveau projet. %d%%p sera vendu pour %d%%c.
    171171#LOSEMAT3 La modification du projet entraînera une perte de 1/3 du matériel collecté pour le projet. Continuer?
    172 #DOUBLESTATEIMP %s\\Cette amélioration de l'état existe déjà dans la ville de %s. Devrions-nous le déplacer dans cette ville et vendre l'ancien bâtiment une fois terminé? 
     172#DOUBLESTATEIMP %s\\Cette amélioration de l'état existe déjà dans la ville de %s. Devrions-nous le déplacer dans cette ville et vendre l'ancien bâtiment une fois terminé?
    173173#READY Le projet sera achevé au prochain tour.
    174174#NOMONEY Nous n'avons pas assez d'argent\pour mener à bien ce projet au prochain tour.\(%d%%c nécessaire, %d%%c disponible sur)
     
    179179#GLIDERLOST Notre planeur a été perdu en mer.
    180180#PLANELOST Notre avion est tombé en panne de carburant.
    181 #DAMAGED_UTILIZE L'utilisation d'un appareil endommagé a réduit les bénéfices. Continuer? 
     181#DAMAGED_UTILIZE L'utilisation d'un appareil endommagé a réduit les bénéfices. Continuer?
    182182#NOBB Nous ne disposons pas de la technologie nécessaire pour construire des ponts sur les rivières.
    183183#NOCITY Ce type de terrain n'est pas adapté à la colonisation. Nous devrions chercher un terrain qui permette l'irrigation.
     
    256256#SHAREDWIN_CONCAT %s, %s
    257257#NOAI Pas d'IA installée!
    258 #FILENOTFOUND Dossier "%s" n'a pas été trouvé. 
     258#FILENOTFOUND Dossier "%s" n'a pas été trouvé.
    259259#AIEXCEPTION Exception non gérée dans le module IA %s!
    260260#LOADERR Ce livre n'est pas compatible avec cette version de C-evo.
     
    290290#MAX2OFFERS Vous ne pouvez pas combiner plus de deux offres dans une proposition.
    291291#NOOFFER Cette proposition n'est pas valable!
    292 #CANCELTREATYRUSH L'annulation de plus d'un traité avec la même nation au sein de l 3 n'est pas autorisé. 
    293 #NOSPACEPORT Nous n'avons pas de port spatial, donc nous perdrions toutes les pièces de vaisseaux de la colonie que nous recevrions. Continuez quand même? 
     292#CANCELTREATYRUSH L'annulation de plus d'un traité avec la même nation au sein de l 3 n'est pas autorisé.
     293#NOSPACEPORT Nous n'avons pas de port spatial, donc nous perdrions toutes les pièces de vaisseaux de la colonie que nous recevrions. Continuez quand même?
    294294#SUICIDE Devons-nous envoyer ces\des hommes à la mort?
    295295#RATES Que devons-nous orienter\notre économie vers?
     
    797797Fortifié
    798798Bombardier armé
    799 Se déplacer en montagne 
     799Se déplacer en montagne
    800800Conscrits
    801801Retiré
     
    945945#SETTINGS
    946946Plein écran
     947Gamma
     948Restart is needed to apply changes
     949Primary
     950Secondary
     951Languages
     952Key bindings
     953Custom DPI
     954DPI
  • trunk/Localization/it/Language.txt

    r426 r473  
    6161#FROLDCIVILREP (vecchio rapporto datato %s)
    6262#FRNOCIVILREP (nessun rapporto disponibile)
    63 #FREXTINCT Sconfitti nel 
     63#FREXTINCT Sconfitti nel
    6464#FRTREATY Relazione:
    6565#FRAND ,
     
    115115#TITLE_DIAGRAMS Grafici
    116116#TITLE_SHIPS Astronavi
    117 #TITLE_SHIP Astronave dell'impero #A 
     117#TITLE_SHIP Astronave dell'impero #A
    118118#TITLE_EMODELS Modelli unità straniere
    119119#TITLE_RATES Economia
     
    158158#EXPEL Unità espulse dal territorio #a.
    159159#DISPOSE %s\\Vuoi smantellare questo edificio?
    160 #SPDESTRUCTQUERY \(nota: perderemo la nostra astronave se smantelliamo la base aerospaziale!) 
     160#SPDESTRUCTQUERY \(nota: perderemo la nostra astronave se smantelliamo la base aerospaziale!)
    161161#SELL %s\\Dobbiamo svendere questo edificio?
    162162#LOSEMAT Un cambio totale del tipo di progetto comporta l'inizio di un progetto ex novo. %d%%p verrà smantellato per %d%%c.
    163163#LOSEMAT3 Il cambio di progetto comporterà una perdita di 1/3 delle materie prime investite finora. Continuare?
    164 #DOUBLESTATEIMP %s\\Questa opera nazionale esiste già nella città di %s. Dobbiamo spostarla a questa città e smantellare quella vecchia al termine? 
     164#DOUBLESTATEIMP %s\\Questa opera nazionale esiste già nella città di %s. Dobbiamo spostarla a questa città e smantellare quella vecchia al termine?
    165165#READY Il progetto sarà terminato il prossimo turno.
    166166#NOMONEY Non abbiamo abbastanza soldi\per completare il progetto al prossimo turno.\(%d%%c necessari, %d%%c disponibili)
     
    171171#GLIDERLOST Il nostro aliante è finito a mollo.
    172172#PLANELOST Il nostro velivolo è rimasto a secco di carburante.
    173 #DAMAGED_UTILIZE Riciclare una unità danneggiata ha benefici ridotti. Continuare? 
     173#DAMAGED_UTILIZE Riciclare una unità danneggiata ha benefici ridotti. Continuare?
    174174#NOBB Non abbiamo le conoscenze per costruire ponti sopra i fiumi.
    175175#NOCITY Questo tipo di terreno non è adatto a fondare una città. Dovremmo cercare un terreno che consenta l'irrigazione.
     
    209209#WONDEREXP Una Meraviglia del mondo ha terminato il suo effetto:\%s
    210210#WONDERDEST Una Meraviglia del mondo è stata distrutta:\%s
    211 #COLDWAR Con la minaccia nucleare, le posizioni diplomatiche di tutte le nazioni si sono congelate. Le negoziazioni non sono più possibili: è cominciata la Guerra Fredda. 
     211#COLDWAR Con la minaccia nucleare, le posizioni diplomatiche di tutte le nazioni si sono congelate. Le negoziazioni non sono più possibili: è cominciata la Guerra Fredda.
    212212#COLDWAREND L'etica mondiale è ormai contraria alle armi nucleari. La Guerra Fredda è finita.
    213213#SHIPBUILT #N hanno ultimato una parte della loro astronave interstellare.
     
    216216#SHIPUNITRADE1 #N ricevono
    217217#SHIPUNITRADE2 parti dell'astronave da #s.
    218 #SHIPCAPTURE1 #N prendono il controllo dell'Astronave 
     218#SHIPCAPTURE1 #N prendono il controllo dell'Astronave
    219219#SHIPCAPTURE2 dello stato #a!
    220220#SHIPDESTROYED #N hanno perso il controllo della loro astronave.
     
    225225#FAMINE_TILES %s è a rischio di carestia. La città ha troppe poche caselle fertili disponibili.\Continuare lo stesso?
    226226#FAMINE_UNREST %s è a rischio di carestia. Parte della popolazione è stata impiegata per mantenere il malcontento sotto controllo; questo indebolimento dell'economia ha fatto sì che la produzione di cibo non sia più sufficiente.\\Continuare lo stesso?
    227 #LOWSUPPORT %s non produce abbastanza risorse per supportare tutte le sue unità.\Continuare lo stesso? 
    228 #LOWSUPPORT_TILES %s non produce abbastanza risorse per supportare tutte le sue unità. La città ha troppe poche caselle produttive disponibili.\Continuare lo stesso? 
    229 #LOWSUPPORT_UNREST %s non produce abbastanza risorse per supportare tutte le sue unità. Parte della popolazione è stata impiegata per mantenere il malcontento sotto controllo; questo indebolimento dell'economia ha fatto sì che la produzione di risorse non sia più sufficiente.\\Continuare lo stesso? 
     227#LOWSUPPORT %s non produce abbastanza risorse per supportare tutte le sue unità.\Continuare lo stesso?
     228#LOWSUPPORT_TILES %s non produce abbastanza risorse per supportare tutte le sue unità. La città ha troppe poche caselle produttive disponibili.\Continuare lo stesso?
     229#LOWSUPPORT_UNREST %s non produce abbastanza risorse per supportare tutte le sue unità. Parte della popolazione è stata impiegata per mantenere il malcontento sotto controllo; questo indebolimento dell'economia ha fatto sì che la produzione di risorse non sia più sufficiente.\\Continuare lo stesso?
    230230#RESIGN Stai per chiudere questa partita.\La vuoi salvare?
    231231#ENDTOUR Vuoi salvare la partita in questo turno, così puoi aprirla in modalità Guardone?
     
    235235#ORACLEINCOME Entrate: %d%%c
    236236#NOSELLAGAIN %s\\Una città non può smantellare più di un edificio per turno.
    237 #OUTOFCONTROL %s\\Questa città non è ancora sotto controllo. 
     237#OUTOFCONTROL %s\\Questa città non è ancora sotto controllo.
    238238#NOCHANGEINANARCHY Siamo in anarchia, tutte le funzioni delle città sono bloccate.
    239239#EXTINCT = %s =\Lo stato de#n è caduto. Solo le leggende rimarranno della loro grande cultura.
     
    248248#SHAREDWIN_CONCAT %s, %s
    249249#NOAI Nessuna I.A. installata!
    250 #FILENOTFOUND File "%s" non trovato. 
     250#FILENOTFOUND File "%s" non trovato.
    251251#AIEXCEPTION Errore sconosciuto nel modulo di I.A. %s!
    252252#LOADERR Questa partita non è compatibile con questa versione di C-evo.
     
    281281#MAX2OFFERS Una proposta può contenere al massimo 2 offerte.
    282282#NOOFFER Questa proposta non è valida!
    283 #CANCELTREATYRUSH Non è possibile annullare più di un trattato con la stessa nazione nell'intervallo di 3 turni. 
    284 #NOSPACEPORT Non abbiamo una base aerospaziale, tutte le parti di astronave che ci daranno andranno perse. Continuare? 
     283#CANCELTREATYRUSH Non è possibile annullare più di un trattato con la stessa nazione nell'intervallo di 3 turni.
     284#NOSPACEPORT Non abbiamo una base aerospaziale, tutte le parti di astronave che ci daranno andranno perse. Continuare?
    285285#SUICIDE Dobbiamo mandare a morire\questi uomini?
    286286#RATES Come dobbiamo orientare\la nostra economia?
     
    950950Languages
    951951Key bindings
     952Custom DPI
     953DPI
  • trunk/Localization/ru/Language.txt

    r426 r473  
    153153#AGE0 = %s =\Каменный Век позади. Настало время завершить кочевой образ жизни. Мы решили остановиться на этих плодородных равнинах и основать здесь поселение, которое назовем %s.
    154154#AGE1 = %s =\В течении многих столетий, мы смогли построить сильное общество на основе философии природы, религии. Но природа диктует нам все новые и новые законы. Поэтому в старый уклад жизни было включено эмпирическое, рациональное мышление: Наука.
    155 #AGE2 = %s =\С открытием массового производства, впервые в Истории, богатство 
    156 больше не привелегия избранного меньшинства. Грядут невероятные перемены. 
     155#AGE2 = %s =\С открытием массового производства, впервые в Истории, богатство
     156больше не привелегия избранного меньшинства. Грядут невероятные перемены.
    157157Благодаря развитию мирового рынка, в новые технологии вкладываются биллионные
    158158инвестиции. Ещё вчера это казалось невозможным.
     
    169169#EXPEL Юниты были исключены с #a территории.
    170170#DISPOSE %s\\Произвести реконструкцию здания?
    171 #SPDESTRUCTQUERY \(Примечание: Мы потеряем контроль над космическим кораблем, если демонтируем космопорт!) 
     171#SPDESTRUCTQUERY \(Примечание: Мы потеряем контроль над космическим кораблем, если демонтируем космопорт!)
    172172#SELL %s\\Продать это здание?
    173173#LOSEMAT Закончились средства для нового проекта. %d%%p будет продан за %d%%c.
     
    182182#GLIDERLOST Наш планер потерялся в море.
    183183#PLANELOST У авиации закончилось топливо.
    184 #DAMAGED_UTILIZE Использование поврежденного юнита приносит меньше пользы. Продолжить? 
     184#DAMAGED_UTILIZE Использование поврежденного юнита приносит меньше пользы. Продолжить?
    185185#NOBB Мы пока не умеем строить мосты через реки. Нужно изучить соответствующую технологию.
    186186#NOCITY Этот тип местности непригоден для поселения. Мы должны поискать местность, на которой возможно орошение.
     
    259259#SHAREDWIN_CONCAT %s, %s
    260260#NOAI ИИ не установлен!
    261 #FILENOTFOUND Файл "%s" не найден. 
     261#FILENOTFOUND Файл "%s" не найден.
    262262#AIEXCEPTION Ошибка ИИ в модуле %s!
    263263#LOADERR Эта книга другой версии c-Evo.
     
    295295#MAX2OFFERS Вы не можете объединять более, чем два предложения в одно предложение.
    296296#NOOFFER Это предложение недействительно!
    297 #CANCELTREATYRUSH Отмена одного договора с одной и той же страной в пределах 3 ходов не допущена. 
    298 #NOSPACEPORT У нас нет космического порта, так что мы теряем все имеющиеся части космического корабля. Продолжить? 
     297#CANCELTREATYRUSH Отмена одного договора с одной и той же страной в пределах 3 ходов не допущена.
     298#NOSPACEPORT У нас нет космического порта, так что мы теряем все имеющиеся части космического корабля. Продолжить?
    299299#SUICIDE Послать\людей на верную смерть?
    300300#RATES Что если мы сориентируем\нашу экономику?
     
    985985Languages
    986986Key bindings
     987Custom DPI
     988DPI
  • trunk/Localization/zh-Hans/Language.txt

    r457 r473  
    977977Languages
    978978Key bindings
     979Custom DPI
     980DPI
  • trunk/Localization/zh-Hant/Language.txt

    r457 r473  
    977977Languages
    978978Key bindings
     979Custom DPI
     980DPI
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r468 r473  
    104104procedure UnshareBitmap(Bitmap: TBitmap);
    105105procedure Gtk2Fix;
     106procedure LoadConfig(Key: string);
     107procedure SaveConfig(Key: string);
    106108
    107109const
     
    193195  UniFont: array [TFontType] of TFont;
    194196  Gamma: Integer; // global gamma correction (cent)
     197  CustomDpiEnabled: Boolean;
     198  CustomDpi: Integer;
    195199
    196200procedure LoadAssets;
     
    204208uses
    205209  {$IFDEF DPI}Dpi.PixelPointer,{$ELSE}PixelPointer,{$ENDIF}
    206   Directories, Sound;
     210  Directories, Sound, Registry;
    207211
    208212var
     
    15501554procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer);
    15511555begin
     1556  if not Assigned(LogoBuffer) then Exit;
    15521557  UnshareBitmap(LogoBuffer);
    15531558  BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y);
     
    17321737end;
    17331738
     1739procedure LoadConfig(Key: string);
     1740var
     1741  Reg: TRegistry;
     1742begin
     1743  Reg := TRegistry.Create;
     1744  with Reg do try
     1745    OpenKey(Key, True);
     1746    if ValueExists('Gamma') then Gamma := ReadInteger('Gamma')
     1747      else Gamma := 100;
     1748    if Gamma <> 100 then InitGammaLookupTable;
     1749    if ValueExists('CustomDpiEnabled') then CustomDpiEnabled := Reg.ReadBool('CustomDpiEnabled')
     1750       else CustomDpiEnabled := False;
     1751    if ValueExists('CustomDpi') then CustomDpi := Reg.ReadInteger('CustomDpi')
     1752       else CustomDpi := 96;
     1753    {$IFDEF DPI}
     1754    if CustomDpiEnabled then Screen.Dpi := CustomDpi
     1755      else Screen.Dpi := Screen.GetSystemDpi;
     1756    {$ENDIF}
     1757  finally
     1758    Reg.Free;
     1759  end;
     1760end;
     1761
     1762procedure SaveConfig(Key: string);
     1763var
     1764  Reg: TRegistry;
     1765begin
     1766  Reg := TRegistry.Create;
     1767  with Reg do try
     1768    OpenKey(Key, True);
     1769    WriteInteger('Gamma', Gamma);
     1770    WriteBool('CustomDpiEnabled', CustomDpiEnabled);
     1771    WriteInteger('CustomDpi', CustomDpi);
     1772  finally
     1773    Free;
     1774  end;
     1775end;
     1776
    17341777procedure LoadAssets;
    17351778begin
     
    17521795  end;
    17531796
     1797  LogoBuffer := TBitmap.Create;
     1798  LogoBuffer.PixelFormat := TPixelFormat.pf24bit;
     1799  LogoBuffer.SetSize(BigBook.Width, BigBook.Height);
     1800
    17541801  LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png');
    17551802  LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg');
     
    18011848
    18021849  LoadAssets;
    1803 
    1804   LogoBuffer := TBitmap.Create;
    1805   LogoBuffer.PixelFormat := TPixelFormat.pf24bit;
    1806   LogoBuffer.SetSize(BigBook.Width, BigBook.Height);
    18071850end;
    18081851
     
    18141857  FreeAndNil(Phrases);
    18151858  FreeAndNil(Phrases2);
    1816   FreeAndNil(LogoBuffer);
     1859  if Assigned(LogoBuffer) then FreeAndNil(LogoBuffer);
    18171860  FreeAndNil(BigImp);
    18181861  FreeAndNil(Paper);
  • trunk/Packages/DpiControls/Dpi.Common.pas

    r468 r473  
    77
    88const
    9   FixedDpi = 2*96;
    109  DpiControlsComponentPaletteName = 'DpiControls';
    1110
  • trunk/Packages/DpiControls/Dpi.Forms.pas

    r468 r473  
    228228    constructor Create;
    229229    destructor Destroy; override;
    230     procedure UpdateScreen;
    231230    procedure UpdateActiveFormFromNativeScreen;
    232231    function DisableForms(SkipForm: TForm; DisabledList: Classes.TList = nil): Classes.TList;
    233232    procedure EnableForms(var AFormList: Classes.TList);
     233    function GetSystemDpi: Integer;
    234234    property FormCount: Integer read GetFormCount;
    235235    property Forms[Index: Integer]: TForm read GetForms;
     
    400400begin
    401401  GetNativeApplication.Initialize;
    402   Screen.UpdateScreen;
    403402end;
    404403
     
    442441      FCreatingForm := TForm(Instance);
    443442    Instance.Create(Self);
    444     Ok := true;
     443    Ok := True;
    445444  finally
    446445    if not Ok then begin
     
    978977end;
    979978
     979function TScreen.GetSystemDpi: Integer;
     980begin
     981  Result := LCLScreen.PixelsPerInch;
     982end;
     983
    980984constructor TScreen.Create;
    981985begin
     
    993997  FreeAndNil(FPrevActiveForms);
    994998  inherited;
    995 end;
    996 
    997 procedure TScreen.UpdateScreen;
    998 begin
    999   if FixedDpi = -1 then Dpi := LCLScreen.PixelsPerInch
    1000     else Dpi := FixedDpi;
    1001999end;
    10021000
  • trunk/Settings.lfm

    r433 r473  
    1717  OnShow = FormShow
    1818  Position = poScreenCenter
    19   LCLVersion = '2.2.0.4'
     19  LCLVersion = '2.2.6.0'
    2020  Scaled = False
    2121  object ListLanguages: TListBox
    2222    Tag = 15360
    2323    Left = 16
    24     Height = 320
     24    Height = 291
    2525    Top = 32
    2626    Width = 144
     
    6868    ButtonIndex = 0
    6969  end
    70   object Up2Btn: TButtonC
     70  object ButtonGammaUp: TButtonC
    7171    Tag = 6912
    7272    Left = 452
     
    7676    Down = False
    7777    Permanent = False
    78     OnClick = Up2BtnClick
     78    OnClick = ButtonGammaUpClick
    7979    ButtonIndex = 1
    8080  end
    81   object Down2Btn: TButtonC
     81  object ButtonGammaDown: TButtonC
    8282    Tag = 6912
    8383    Left = 452
     
    8787    Down = False
    8888    Permanent = False
    89     OnClick = Down2BtnClick
     89    OnClick = ButtonGammaDownClick
    9090    ButtonIndex = 0
    9191  end
     
    9393    Tag = 15360
    9494    Left = 176
    95     Height = 264
     95    Height = 232
    9696    Top = 32
    9797    Width = 288
     
    115115    Left = 176
    116116    Height = 27
    117     Top = 325
     117    Top = 296
    118118    Width = 136
    119119    BorderStyle = bsNone
     
    131131    Left = 328
    132132    Height = 27
    133     Top = 325
     133    Top = 296
    134134    Width = 136
    135135    BorderStyle = bsNone
     
    153153    OnClick = ButtonResetClick
    154154  end
     155  object ButtonCustomDpi: TButtonC
     156    Left = 24
     157    Height = 18
     158    Top = 336
     159    Width = 18
     160    Down = False
     161    Permanent = False
     162    OnClick = ButtonCustomDpiClick
     163    ButtonIndex = 0
     164  end
     165  object ButtonDpiUp: TButtonC
     166    Tag = 6912
     167    Left = 452
     168    Height = 12
     169    Top = 328
     170    Width = 12
     171    Down = False
     172    Permanent = False
     173    OnClick = ButtonDpiUpClick
     174    ButtonIndex = 1
     175  end
     176  object ButtonDpiDown: TButtonC
     177    Tag = 6912
     178    Left = 452
     179    Height = 12
     180    Top = 340
     181    Width = 12
     182    Down = False
     183    Permanent = False
     184    OnClick = ButtonDpiDownClick
     185    ButtonIndex = 0
     186  end
    155187end
  • trunk/Settings.pas

    r471 r473  
    1414  TSettingsDlg = class(TDrawDlg)
    1515    ButtonFullscreen: TButtonC;
    16     Down2Btn: TButtonC;
     16    ButtonCustomDpi: TButtonC;
     17    ButtonGammaDown: TButtonC;
     18    ButtonDpiDown: TButtonC;
    1719    EditShortCutPrimary: TEdit;
    1820    EditShortCutSecondary: TEdit;
     
    2224    ButtonCancel: TButtonA;
    2325    ButtonReset: TButtonA;
    24     Up2Btn: TButtonC;
     26    ButtonGammaUp: TButtonC;
     27    ButtonDpiUp: TButtonC;
     28    procedure ButtonCustomDpiClick(Sender: TObject);
     29    procedure ButtonDpiDownClick(Sender: TObject);
     30    procedure ButtonDpiUpClick(Sender: TObject);
    2531    procedure ButtonFullscreenClick(Sender: TObject);
    2632    procedure ButtonCancelClick(Sender: TObject);
    2733    procedure ButtonResetClick(Sender: TObject);
    28     procedure Down2BtnClick(Sender: TObject);
     34    procedure ButtonGammaDownClick(Sender: TObject);
    2935    procedure EditShortCutPrimaryKeyUp(Sender: TObject; var Key: Word;
    3036      Shift: TShiftState);
     
    3844    procedure ListKeyBindingsSelectionChange(Sender: TObject; User: Boolean);
    3945    procedure ButtonOkClick(Sender: TObject);
    40     procedure Up2BtnClick(Sender: TObject);
     46    procedure ButtonGammaUpClick(Sender: TObject);
    4147  private
    4248    LocalGamma: Integer;
    4349    LocalKeyBindings: TKeyBindings;
    4450    CurrentKeyBinding: TKeyBinding;
     51    LocalDpi: Integer;
    4552    procedure UpdateShortCutItem;
     53    function GetLocalCustomDpiEnabled: Boolean;
    4654  public
    4755    procedure LoadData;
     
    6270var
    6371  SFullScreen, SGamma, SRestartMsg, SShortCutPrimary, SShortCutSecondary,
    64   SLanguages, SKeyBindings: string;
     72  SLanguages, SKeyBindings, SCustomDpi, SDpi: string;
    6573
    6674procedure ReloadLanguages;
     
    7381  SLanguages := Phrases.Lookup('SETTINGS', 5);
    7482  SKeyBindings := Phrases.Lookup('SETTINGS', 6);
     83  SCustomDpi := Phrases.Lookup('SETTINGS', 7);
     84  SDpi := Phrases.Lookup('SETTINGS', 8);
    7585end;
    7686
     
    108118end;
    109119
    110 procedure TSettingsDlg.Down2BtnClick(Sender: TObject);
     120procedure TSettingsDlg.ButtonGammaDownClick(Sender: TObject);
    111121begin
    112122  if LocalGamma > 50 then
     
    156166end;
    157167
     168procedure TSettingsDlg.ButtonDpiDownClick(Sender: TObject);
     169begin
     170  if LocalDpi >= 105 then
     171  begin
     172    Dec(LocalDpi, 5);
     173    Invalidate;
     174  end;
     175end;
     176
     177procedure TSettingsDlg.ButtonCustomDpiClick(Sender: TObject);
     178begin
     179  ButtonCustomDpi.ButtonIndex := ButtonCustomDpi.ButtonIndex xor 1;
     180end;
     181
     182procedure TSettingsDlg.ButtonDpiUpClick(Sender: TObject);
     183begin
     184  if LocalDpi <= 495 then begin
     185    Inc(LocalDpi, 5);
     186    Invalidate;
     187  end;
     188end;
     189
    158190procedure TSettingsDlg.FormDestroy(Sender: TObject);
    159191begin
     
    163195procedure TSettingsDlg.FormPaint(Sender: TObject);
    164196begin
    165   PaintBackground(self, 3, 3, ClientWidth - 6, ClientHeight - 6);
     197  PaintBackground(Self, 3, 3, ClientWidth - 6, ClientHeight - 6);
    166198  Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    167199  Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
     
    178210    ButtonFullscreen.Left + 12, ButtonFullscreen.Top + 12, MainTexture.ColorBevelShade,
    179211    MainTexture.ColorBevelLight);
     212  {$IFDEF DPI}
     213  RFrame(Canvas, ButtonCustomDpi.Left - 1, ButtonCustomDpi.Top - 1,
     214    ButtonCustomDpi.Left + 12, ButtonCustomDpi.Top + 12, MainTexture.ColorBevelShade,
     215    MainTexture.ColorBevelLight);
     216  LoweredTextOut(Canvas, -2, MainTexture, ButtonCustomDpi.Left + 32,
     217    ButtonCustomDpi.Top - 4, SCustomDpi);
     218  UnderlinedTitleValue(Canvas, SDpi, IntToStr(LocalDpi) + '%',
     219    ButtonDpiUp.Left - 150 - 4, ButtonDpiUp.Top + 2, 150);
     220  {$ENDIF}
    180221
    181222  LoweredTextOut(Canvas, -2, MainTexture, ListLanguages.Left,
     
    186227    ButtonFullscreen.Top - 4, SFullScreen);
    187228  UnderlinedTitleValue(Canvas, SGamma, IntToStr(LocalGamma) + '%',
    188     Up2Btn.Left - 150 - 4, Up2Btn.Top + 2, 150);
     229    ButtonGammaUp.Left - 150 - 4, ButtonGammaUp.Top + 2, 150);
    189230  LoweredTextOut(Canvas, -2, MainTexture, EditShortCutPrimary.Left,
    190231    EditShortCutPrimary.Top - 26, SShortCutPrimary);
     
    204245  EditShortCutPrimary.Font.Color := MainTexture.ColorMark;
    205246  EditShortCutSecondary.Font.Color := MainTexture.ColorMark;
     247  {$IFDEF DPI}
     248  ButtonCustomDpi.Visible := True;
     249  ButtonDpiDown.Visible := True;
     250  ButtonDpiUp.Visible := True;
     251  {$ELSE}
     252  ButtonCustomDpi.Visible := False;
     253  ButtonDpiDown.Visible := False;
     254  ButtonDpiUp.Visible := False;
     255  {$ENDIF}
    206256end;
    207257
     
    241291end;
    242292
    243 procedure TSettingsDlg.Up2BtnClick(Sender: TObject);
     293procedure TSettingsDlg.ButtonGammaUpClick(Sender: TObject);
    244294begin
    245295  if LocalGamma < 150 then begin
     
    262312end;
    263313
     314function TSettingsDlg.GetLocalCustomDpiEnabled: Boolean;
     315begin
     316  Result := (ButtonCustomDpi.ButtonIndex and 1) = 1;
     317end;
     318
    264319procedure TSettingsDlg.LoadData;
    265320begin
     
    272327  LocalGamma := Gamma;
    273328  LocalKeyBindings.Assign(KeyBindings.KeyBindings);
     329  {$IFDEF DPI}
     330  if CustomDpiEnabled then ButtonCustomDpi.ButtonIndex := 3
     331    else ButtonCustomDpi.ButtonIndex := 2;
     332  LocalDpi := Round(CustomDpi * 100 / 96);
     333  {$ENDIF}
    274334end;
    275335
     
    278338  NeedRestart: Boolean;
    279339begin
    280   NeedRestart := Gamma <> LocalGamma;
     340  NeedRestart := (Gamma <> LocalGamma) or (CustomDpiEnabled <> GetLocalCustomDpiEnabled) or
     341    ((GetLocalCustomDpiEnabled and (LocalDpi <> CustomDpi)));
    281342  if ListLanguages.ItemIndex <> -1 then begin
    282343    StartDlg.Translator.Language := TLanguage(ListLanguages.Items.Objects[ListLanguages.ItemIndex]);
     
    288349  FullScreen := (ButtonFullscreen.ButtonIndex and 1) = 1;
    289350  Gamma := LocalGamma;
     351  ScreenTools.CustomDpiEnabled := CustomDpiEnabled;
    290352  if NeedRestart then SimpleMessage(SRestartMsg);
    291353  KeyBindings.KeyBindings.Assign(LocalKeyBindings);
     354  {$IFDEF DPI}
     355  CustomDpiEnabled := GetLocalCustomDpiEnabled;
     356  CustomDpi := Round(LocalDpi * 96 / 100);
     357  {$ENDIF}
    292358end;
    293359
  • trunk/Start.pas

    r472 r473  
    389389
    390390    OpenKey(AppRegistryKey, True);
    391     if ValueExists('Gamma') then Gamma := ReadInteger('Gamma')
    392       else Gamma := 100;
    393     if Gamma <> 100 then InitGammaLookupTable;
    394391    if ValueExists('Locale') then LocaleCode := ReadString('Locale')
    395392      else LocaleCode := '';
     
    444441  Reg: TRegistry;
    445442begin
     443  ScreenTools.SaveConfig(AppRegistryKey);
     444
    446445  Reg := TRegistry.Create;
    447446  with Reg do try
     
    450449    WriteInteger('LandMass', StartLandMass);
    451450    WriteString('Locale', LocaleCode);
    452     WriteInteger('Gamma', Gamma);
    453451    if FullScreen then WriteInteger('ScreenMode', 1)
    454452      else WriteInteger('ScreenMode', 0);
Note: See TracChangeset for help on using the changeset viewer.