Skip to content

Commit

Permalink
GUI (colony view): name terrain type for fields when mouse moves over
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel committed Feb 5, 2024
1 parent 8c1754e commit 074a5f2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
4 changes: 3 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ improvements may be omitted.)_
* __[improvement]__
In the colony view, the colony icon is shown in the center square to indicate
more clearly that those squares are the fields around the colony. Furthermore,
rivers (if any) around the colony are now shown in those squares, too.
rivers (if any) around the colony are now shown in those squares, too. When
the mouse hovers over one of those squares, the terrain type is now explicitly
mentioned, too.

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

Expand Down
24 changes: 23 additions & 1 deletion engine/Gui.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@ procedure TGui.DrawColonyView;
glDisable(GL_ALPHA_TEST);
glDisable(GL_TEXTURE_2D);
end;
//show text for field
// production show text for field
GetColonyFieldAtMouse(i,j);
if ((i<>-2) and (cur_colony.GetUnitInField(i,j)<>nil)) then
begin
Expand All @@ -2447,6 +2447,28 @@ procedure TGui.DrawColonyView;
glColor3ubv(@cMenuTextColour[0]);
WriteText(tempStr, x_Fields+2.5-(str_width*PixelWidth*0.5), y_Fields - 0.75);
end;//if
// show name of terrain for field
if (i <> -2) then
begin
// first line: terrain name
tempStr := dat.GetLang.GetTerrainName(local_Map.tiles[i+cur_colony.GetPosX,j+cur_colony.GetPosY].GetType);
str_width:= length(tempStr) * 8;
glColor3ubv(@cMenuTextColour[0]);
WriteText(tempStr, x_Fields + 2.5 - (str_width * PixelWidth * 0.5), y_Fields - 4.5 + 3 * PixelWidth);
// second line: river + road status
tempStr := '';
if local_Map.tiles[i+cur_colony.GetPosX,j+cur_colony.GetPosY].HasRiver then
begin
tempStr := dat.GetLang.GetOthers(osRiver);
end;
if local_Map.tiles[i+cur_colony.GetPosX,j+cur_colony.GetPosY].HasRoad then
begin
if tempStr = '' then tempStr := dat.GetLang.GetOthers(osRoad)
else tempStr := tempStr + ' + ' + dat.GetLang.GetOthers(osRoad);
end;
str_width:= length(tempStr) * 8;
WriteText(tempStr, x_Fields + 2.5 - (str_width * PixelWidth * 0.5), y_Fields - 5.0 + 4 * PixelWidth);
end;

DrawColonyTitleBar;
DrawGoodsBar;
Expand Down
6 changes: 4 additions & 2 deletions engine/Language.pas
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ ***************************************************************************
This file is part of Vespucci.
Copyright (C) 2008, 2009, 2010, 2011 Dirk Stolle
Copyright (C) 2008, 2009, 2010, 2011, 2024 Dirk Stolle
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,7 +37,7 @@ interface
TOtherString = (osLocation, osDestination, osFreight, osShip, osHighSea,
osNewWorld, osMoves, osEmpty, osNothing, osNoChanges, osTax,
osGold, osCost, osSaving, osEarnings, osName, osProgress,
osQuitGame, osYes, osNo, osUndefined);
osQuitGame, osYes, osNo, osRiver, osRoad, osUndefined);
TEuroPortString = (epsManageHeading, epsNotOnShip, epsGoOnShip, epsArm, epsDisarm, epsGiveHorses, epsNoHorses, epsGiveTools, epsNoTools, epsTrainHeading, epsBuyHeading);
TReportType = (rtNone, rtCongress, rtJob, rtEconomy, rtColony, rtFleet, rtForeign, rtIndian, rtScore);
TColonyString = (csRenameQuestion, csRenameLabel, csAbandonYes, csAbandonNo, csAbandonQuestion);
Expand Down Expand Up @@ -641,6 +641,8 @@ procedure TLanguage.InitialValues;
Others[osQuitGame]:= 'Vespucci beenden?';
Others[osYes]:= 'Ja';
Others[osNo]:= 'Nein';
Others[osRiver]:= 'Fluss';
Others[osRoad]:= 'Straße';
Others[osUndefined]:= 'Nicht definiert';
//save/ load messages
SaveLoad[slsLoadChoose]:= 'Wählen Sie den zu ladenden Spielstand.';
Expand Down

0 comments on commit 074a5f2

Please sign in to comment.