-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support a barebones "city screen" view
This is triggered when building a city and when clicking "zoom to city" For now I've just added the "exit" button, but hope to add tile yields soon. I also fixed an issue with the advisor and input handling - previously if you exited the advisor via escape the game would ask if you wanted to exit. Now it works properly.
- Loading branch information
Showing
8 changed files
with
105 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using Godot; | ||
using System; | ||
using Serilog; | ||
using System.Collections.Generic; | ||
using C7GameData; | ||
|
||
|
||
// Handles the city screen, where citizens can be assigned and other details of | ||
// the city can bee seen. | ||
public partial class CityScreen : CenterContainer { | ||
private ILogger log = LogManager.ForContext<CityScreen>(); | ||
|
||
// Called when the node enters the scene tree for the first time. | ||
public override void _Ready() { | ||
TextureRect background = new() { | ||
Texture = Util.LoadTextureFromPCX("Art/city screen/background.pcx") | ||
}; | ||
AddChild(background); | ||
|
||
TextureButton close = new() { | ||
TextureNormal = Util.LoadTextureFromPCX("Art/city screen/cityMgmtButtons.pcx", 155, 1, 32, 48), | ||
TextureHover = Util.LoadTextureFromPCX("Art/city screen/cityMgmtButtons.pcx", 155, 50, 32, 48), | ||
TexturePressed = Util.LoadTextureFromPCX("Art/city screen/cityMgmtButtons.pcx", 155, 99, 32, 48) | ||
}; | ||
close.SetPosition(new Vector2(950, 20)); | ||
close.Pressed += () => { this.Hide(); }; | ||
background.AddChild(close); | ||
|
||
this.Hide(); | ||
} | ||
|
||
private void OnShowCityScreen(ParameterWrapper<City> city) { | ||
this.Show(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters