Skip to content

Commit

Permalink
Corrected grid position of units in reports menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
klei1984 committed Jun 7, 2024
1 parent 6e16e23 commit 9afadf0
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/reportmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ class ReportMenu : public Window {
void SelectUnit(Point point);

static int32_t GetWorkingEcoSphereCount(uint16_t team);
static void UpdateSelectedUnitStatus(UnitInfo *unit, WindowInfo *window, int32_t ulx, int32_t uly, int32_t width, int32_t height);
static void UpdateSelectedUnitStatus(UnitInfo *unit, WindowInfo *window, int32_t ulx, int32_t uly, int32_t width,
int32_t height);

void AddUnits(SmartList<UnitInfo> *unit_list);
int32_t GetSelectedUnitIndex();
Expand Down Expand Up @@ -708,8 +709,8 @@ void ReportMenu::DrawUnits() {
Text_SetFont(GNW_TEXT_FONT_5);

Text_TextBox(window.buffer, window.width,
SmartString().Sprintf(10, "%i,%i", units[i].grid_x, units[i].grid_y).GetCStr(), window_ulx + 265,
window_uly, 40, 50, 0xA2, true);
SmartString().Sprintf(10, "%i,%i", units[i].grid_x + 1, units[i].grid_y + 1).GetCStr(),
window_ulx + 265, window_uly, 40, 50, 0xA2, true);

UpdateSelectedUnitStatus(&units[i], &window, window_ulx + 310, window_uly,
report_screen_image->GetWidth() - 310, 50);
Expand Down Expand Up @@ -904,10 +905,10 @@ void ReportMenu::DrawScores() {

for (int32_t team = PLAYER_TEAM_RED; team < PLAYER_TEAM_MAX - 1; ++team) {
if (UnitsManager_TeamInfo[team].team_type != TEAM_TYPE_NONE) {
window_uly = std::max(
static_cast<int32_t>(ecosphere_counts[team] * (ini_setting_victory_limit - GameManager_TurnCounter) +
UnitsManager_TeamInfo[team].team_points),
window_uly);
window_uly = std::max(static_cast<int32_t>(ecosphere_counts[team] *
(ini_setting_victory_limit - GameManager_TurnCounter) +
UnitsManager_TeamInfo[team].team_points),
window_uly);
}
}
}
Expand Down Expand Up @@ -1098,7 +1099,8 @@ int32_t ReportMenu::GetWorkingEcoSphereCount(uint16_t team) {
return result;
}

void ReportMenu::UpdateSelectedUnitStatus(UnitInfo *unit, WindowInfo *window, int32_t ulx, int32_t uly, int32_t width, int32_t height) {
void ReportMenu::UpdateSelectedUnitStatus(UnitInfo *unit, WindowInfo *window, int32_t ulx, int32_t uly, int32_t width,
int32_t height) {
SmartString string;

Text_SetFont(GNW_TEXT_FONT_5);
Expand Down

0 comments on commit 9afadf0

Please sign in to comment.