Skip to content

Commit

Permalink
hacky debugging statements
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWerner committed Jan 3, 2025
1 parent 18d9116 commit ce1f1e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions C7/C7.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Godot.NET.Sdk/4.2.2">
<Project Sdk="Godot.NET.Sdk/4.2.1">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -19,4 +19,4 @@
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Expressions" Version="3.4.1" />
</ItemGroup>
</Project>
</Project>
4 changes: 4 additions & 0 deletions C7/UIElements/UnitButtons/UnitButtons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using C7GameData;
using Serilog;
using System;

/*
UnitButtons contains the buttons at the bottom of the game UI when viewing the
Expand Down Expand Up @@ -86,8 +87,10 @@ private void OnNoMoreAutoselectableUnits() {
}

private void OnNewUnitSelected(ParameterWrapper<MapUnit> wrappedMapUnit) {
Console.WriteLine("Here!: OnNewUnitSelected " + buttonMap.Count);
MapUnit unit = wrappedMapUnit.Value;
foreach (UnitControlButton button in buttonMap.Values) {
Console.WriteLine("Here!: OnNewUnitSelected " + button.action);
button.Visible = false;
}

Expand All @@ -96,6 +99,7 @@ private void OnNewUnitSelected(ParameterWrapper<MapUnit> wrappedMapUnit) {
// so that we don't display buttons that do nothing - we don't want to
// show the "road" button if we can't build a road, etc.
foreach (string action in unit.availableActions) {
Console.WriteLine("Available action: " + action);
if (buttonMap.ContainsKey(action)) {
buttonMap[action].Visible = true;
} else {
Expand Down

0 comments on commit ce1f1e5

Please sign in to comment.