Skip to content

Commit

Permalink
fix display glitch in colony + add minimal changelog file
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Feb 1, 2024
1 parent 175ef8c commit 92833dc
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
cp -R engine/data artifacts/data
cp LICENSE artifacts/
cp readme.md artifacts/
cp changelog.md artifacts/
cp known_bugs.md artifacts/
cp glut32.dll artifacts/
cp glut.dll artifacts/
Expand Down
16 changes: 16 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Version history of Vespucci

_(Note: This changelog focuses on the major changes between the different
versions. Therefore, it may not contain all changes. Especially smaller fixes or
improvements may be omitted.)_

## Next Version 0.?.? (2024-02-??)

* __[fix]__
The hover text that is shown when the mouse cursor hovers over the goods bar
in the colony view is no longer obstructed by the box that displays the name
of the building which is currently under construction.

## Version 0.01.r217 (2015-01-26)

Currently, no changelog for this version or any previous versions is available.
31 changes: 25 additions & 6 deletions engine/Gui.pas
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ TGui = class
{ draws the good bar (in both colonies and European view) }
procedure DrawGoodsBar;

{ draws the hover text on the good bar (in both colonies and European view) }
procedure DrawGoodsBarHoverText;

{ draws the title bar for colonies }
procedure DrawColonyTitleBar;

Expand Down Expand Up @@ -2657,6 +2660,7 @@ procedure TGui.DrawColonyView;

end;//else, i.e. not ColonyBuildingPage

DrawGoodsBarHoverText;

{$IFDEF DEBUG_CODE}
WriteDebugLn('Leaving TGui.DrawColonyView');
Expand Down Expand Up @@ -2816,6 +2820,7 @@ procedure TGui.DrawEuropeanView;
glVertex2f(x_Fields+ BarWidth*PixelWidth, y_Fields);
glEnd;
DrawGoodsBar;
DrawGoodsBarHoverText;
DrawEuropeTitleBar;

if europe<>nil then
Expand Down Expand Up @@ -4214,10 +4219,24 @@ procedure TGui.DrawGoodsBar;
WriteHelvetica12(price_str, (2+ ((36-str_width) div 2) +i*38)*PixelWidth, 4*PixelWidth -0.5);
end;//for
end;//else if
if GetGoodAtMouse<>gtCross then
{$IFDEF DEBUG_CODE}
WriteDebugLn('Leaving TGui.DrawGoodsBar');
{$ENDIF}
end;//proc

procedure TGui.DrawGoodsBarHoverText;
var current_good: TGoodType;
hover_text: String;
i, str_width: Integer;
begin
{$IFDEF DEBUG_CODE}
WriteDebugLn('Entered TGui.DrawGoodsBarHoverText');
{$ENDIF}
current_good := GetGoodAtMouse;
if current_good<>gtCross then
begin
price_str:= dat.GetLang.GetGoodName(GetGoodAtMouse);
str_width:= 8*length(price_str);
hover_text:= dat.GetLang.GetGoodName(current_good);
str_width:= 8*length(hover_text);
//use "i" as temporary var to store the pixel count where the text begins
if (str_width+mouse.x<cWindowWidth) then i:= mouse.x
else i:= cWindowWidth-str_width;
Expand All @@ -4229,12 +4248,12 @@ procedure TGui.DrawGoodsBar;
glVertex2f((i-2)*PixelWidth, 66*PixelWidth -0.5);
glEnd;
glColor3ub(255, 255, 255);
WriteText(price_str, i*PixelWidth, (cGoodBarHeight+1)*PixelWidth -0.5)
WriteText(hover_text, i*PixelWidth, (cGoodBarHeight+1)*PixelWidth -0.5)
end;//func
{$IFDEF DEBUG_CODE}
WriteDebugLn('Leaving TGui.DrawGoodsBar');
WriteDebugLn('Leaving TGui.DrawGoodsBarHoverText');
{$ENDIF}
end;//proc
end;

procedure TGui.DrawColonyTitleBar;
var s: string;
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ To start the compiled program, type `./vespucci` into the terminal.
Note that the game currently only has a German GUI, so you might want to wait
for the English translation, or - even better - help with that.

## History of changes

A changelog is provided as [separate file](./changelog.md).

## Copyright and Licensing

Copyright 2008-2020 Dirk Stolle
Expand Down

0 comments on commit 92833dc

Please sign in to comment.