Skip to content

Commit

Permalink
Merge pull request #21 from FoxAhead/dev-theta
Browse files Browse the repository at this point in the history
Dev theta
  • Loading branch information
FoxAhead authored Jul 28, 2022
2 parents 6c82151 + c58cb45 commit 12a3c62
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Civ2Types.pas
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ interface
ListItemMaxHeight: Integer;
end;

TDrawPort = packed record // Part of TGraphicsInfo; TODO: Move to TGraphicsInfo
TDrawPort = packed record // Part of TGraphicsInfo;
_Proc: Pointer;
Width: Integer;
Height: Integer;
Expand Down
6 changes: 3 additions & 3 deletions src/Civ2UIA.dof
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ IncludeVerInfo=1
AutoIncBuild=1
MajorVer=1
MinorVer=20
Release=0
Build=708
Release=1
Build=724
Debug=0
PreRelease=0
Special=0
Expand All @@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.20.0.708
FileVersion=1.20.1.724
InternalName=
LegalCopyright=
LegalTrademarks=
Expand Down
22 changes: 16 additions & 6 deletions src/Civ2UIA.dpr
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,13 @@ begin
Canvas.TextOutWithShadows(TextOut, 0, 0, DT_CENTER or DT_VCENTER);
Canvas.Free;
end;

// Debug: unit index
{Canvas := TCanvasEx.Create(DrawPort);
TextOut := IntToStr(UnitIndex);
Canvas.MoveTo(Left + ScaleByZoom(32, Zoom), Top + ScaleByZoom(16, Zoom));
Canvas.TextOutWithShadows(TextOut, 0, 0, DT_CENTER or DT_VCENTER);
Canvas.Free;}
end;

procedure PatchDrawSideBarEx; stdcall;
Expand Down Expand Up @@ -1581,12 +1588,15 @@ asm
ret
end;

procedure PatchBreakUnitMoving; register;
procedure PatchBreakUnitMoving(UnitIndex: Integer); cdecl;
var
Unit1: PUnit;
begin
if not Ex.SettingsFlagSet(2) then
asm
mov eax, $0042738C
jmp eax
Unit1 := @Civ2.Units[UnitIndex];
if (Civ2.GameParameters.HumanPlayers and (1 shl Unit1.CivIndex) = 0) or (not Ex.SettingsFlagSet(2)) then
if ((Unit1.Orders and $F) = $B) and (Civ2.UnitTypes[Unit1.UnitType].Role <> 7) then
begin
Unit1.Orders := -1;
end;
end;

Expand Down Expand Up @@ -2902,7 +2912,7 @@ begin
begin
Building := -City.Building;
Text := string(Civ2.GetStringInList(Civ2.Improvements[Building].StringIndex)) + ' ';
if Building > 39 then
if Building >= 39 then
begin
Civ2.SetFontColorWithShadow($5E, $A, -1, -1);
end;
Expand Down
Binary file modified src/Civ2UIA.res
Binary file not shown.

0 comments on commit 12a3c62

Please sign in to comment.