SimCity-style toolbar: colored pictogram icons + grouped UX
- All 16 icons redrawn as rich multi-color SVGs (houses, towers, factory, plants with smoke, services with badges/crosses, park, fountain, stadium) — unique gradient ids, no collisions - Toolbar grouped under labeled sections: Tools / Zones / Power / Safety / Health / Leisure - Every button shows price (FREE for zones); unaffordable buildings dim and turn red as funds change - Keyboard-shortcut badges on buttons; bigger 30px icons; hover lift - Floating status chip above the bar shows active tool, price, upkeep and coverage radius (SimCity status-bar feel) - FIX: Game.ui was a method while input.js read it as a property, so tool-change UI updates silently never ran; now a proper getter
This commit is contained in:
+8
-8
@@ -101,16 +101,16 @@ class Game {
|
||||
this.speedIdx = 1;
|
||||
this.paused = false;
|
||||
this.start(c);
|
||||
this.ui().toast(`Welcome to ${name}, Mayor!`, 'success');
|
||||
this.ui().resetQuests();
|
||||
this.ui?.toast(`Welcome to ${name}, Mayor!`, 'success');
|
||||
this.ui?.resetQuests();
|
||||
}
|
||||
|
||||
loadFrom(cityInstance) {
|
||||
this.start(cityInstance);
|
||||
this.ui().toast('City loaded.', 'success');
|
||||
this.ui?.toast('City loaded.', 'success');
|
||||
}
|
||||
|
||||
ui() { return this._parts?.ui; }
|
||||
get ui() { return this._parts?.ui; }
|
||||
get input() { return this._parts?.input; }
|
||||
get renderer() { return this._parts?.renderer; }
|
||||
|
||||
@@ -120,7 +120,7 @@ class Game {
|
||||
this.speedIdx = idx;
|
||||
this.paused = idx === 0;
|
||||
if (idx > 0) this.lastNonzeroSpeed = idx;
|
||||
this.ui()?.setSpeedActive(idx);
|
||||
this.ui?.setSpeedActive(idx);
|
||||
}
|
||||
|
||||
togglePause() {
|
||||
@@ -137,16 +137,16 @@ class Game {
|
||||
|
||||
queryTile(tile, x, y) {
|
||||
const info = this.city.getTileInfo(tile.x, tile.z);
|
||||
if (info) this.ui()?.showInfoPopup(info, x, y);
|
||||
if (info) this.ui?.showInfoPopup(info, x, y);
|
||||
}
|
||||
|
||||
checkQuests() { this.ui()?.checkQuests(); }
|
||||
checkQuests() { this.ui?.checkQuests(); }
|
||||
|
||||
_syncSoon() {
|
||||
if (this.city.tilesDirty && this._parts) {
|
||||
this._parts.renderer.sync();
|
||||
this.city.tilesDirty = false;
|
||||
this.ui()?.scheduleMinimap();
|
||||
this.ui?.scheduleMinimap();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user