← Devblog

Tax Collector Window: Script-Driven UI

Tax Collector info window

The Tax Collector's info window is now fully script-driven, continuing our migration of UI code from C++ to JavaScript. This change allows modders to customize the window's behavior and appearance without recompiling the engine.

What Changed

Previously, the Tax Collector window was hardcoded in C++ (window_tax_collector.cpp). Now it's defined entirely in JavaScript (ui_tax_collector_window.js), making it easy to modify:

Technical Details

The window is registered from JavaScript with the following configuration:

Code Reduction

This refactoring removed 86 lines of C++ code and duplicate layout definitions from ui_widgets.js, replacing them with 55 lines of clean, modular JavaScript. The result is more maintainable and easier to extend.

Why This Matters

Moving UI to JavaScript is part of our broader goal to make Akhenaten fully moddable. With script-driven windows, modders can:

More buildings will follow this pattern in upcoming updates. Stay tuned!