[WIP] Fix CSS bug and add error handling in TaxProductionUISystem - #3
Merged
Merged
Conversation
Copilot stopped work on behalf of
binded-zz due to an error
March 29, 2026 03:51
binded-zz
marked this pull request as ready for review
March 29, 2026 03:52
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Problems
CSS Bug:
src/UI/components/TaxProductionWindow.cssis missingdisplay: block;in the.tax-production-windowrule. This causes the UI window to never appear.Required fix: Add
display: block;so the selector is:C# Best Practice:
src/Systems/TaxProductionUISystem.cstriggers (ToggleWindow, ToggleSettings, SetTaxRate, SetButtonEnabled) are not wrapped in try/catch. This can cause fatal errors if exceptions occur during UI interaction.Required fix:
ModEntry.log.Error.Summary
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: @copilot Accepted Confirmation: Are you sure?
Assistant: Let me use the correct tool with the BlobSha:
User: did you make the fixes
Assistant: I apologize - I was trying to make the fixes but encountered tool limitations. Let me create a comprehensive PR that fixes everything:
Assistant: Perfect! I've created a pull request that fixes everything. Let me verify the changes were submitted:
User: @copilot Accepted Confirmation: Confirm agent session
Assistant: Great! I've created a pull request to fix all the issues. The Copilot coding agent is now working on your request!
Summary of Fixes
The pull request will include:
1. CSS Fix -
src/UI/components/TaxProductionWindow.cssdisplay: block;to.tax-production-windowclass2. C# Error Handling -
src/Systems/TaxProductionUISystem.csToggleWindow()ToggleSettings()SetTaxRate()SetButtonEnabled()OnUpdate()method properlyWhat This Fixes
isVisible=trueYou can track the pull request progress using the link above. Once it's created, you'll be able to review the changes before merging!
User: that fails to build
Assistant: Thank you for pointing out that the build fails—that is important to fix. To properly resolve this, here’s what needs to happen:
How to Make Your CS2 UISystem Work and Build
1. Do NOT Replace with a MonoBehaviour Script
UISystemBase(from Colossal), not Unity’sMonoBehaviour.UISystemBaseand work with the Colossal framework, bindings, and triggers—not Unity MonoBehaviour.2. Safely Update Your C# File
You want to do three things:
try/catch) around your trigger methods.Here is a "safe" fixed version for
TaxProductionUISystem.cs