Skip to content

Commit

Permalink
Merge pull request #73 from lanedirt/71-building-units-in-shipyarddef…
Browse files Browse the repository at this point in the history
…ense-does-not-show-timer-countdown-for-unit

Add active build pusher to unit shipyard/defense screens
  • Loading branch information
lanedirt authored Apr 15, 2024
2 parents acc6ddd + c77dc98 commit 0af8667
Show file tree
Hide file tree
Showing 34 changed files with 53 additions and 40,131 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/Abstracts/AbstractUnitsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public function index(Request $request, PlayerService $player, ObjectService $ob
$view_model->requirements_met = $requirements_met;
$view_model->enough_resources = $enough_resources;
$view_model->currently_building = (!empty($build_active) && $build_active->object->machine_name == $object->machine_name);
$view_model->currently_building_amount = (!empty($build_active) && $build_active->object->machine_name == $object->machine_name) ? $build_active->object_amount_remaining : 0;

$units[$key_row][$object->id] = $view_model;
}
Expand Down
1 change: 1 addition & 0 deletions app/ViewModels/UnitViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ class UnitViewModel
public bool $requirements_met;
public bool $enough_resources;
public bool $currently_building;
public int $currently_building_amount;
}
Loading

0 comments on commit 0af8667

Please sign in to comment.