mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
refactor: add renderCoinsFromCopper() to eliminate copper decomposition boilerplate
Add renderCoinsFromCopper(uint64_t) overload in ui_colors.hpp that decomposes copper into gold/silver/copper and renders. Replace 14 manual 3-line decomposition blocks across game_screen and inventory_screen with single-line calls.
This commit is contained in:
parent
f39271453b
commit
25d1a7742d
3 changed files with 24 additions and 52 deletions
|
|
@ -53,4 +53,11 @@ inline void renderCoinsText(uint32_t g, uint32_t s, uint32_t c) {
|
|||
ImGui::TextColored(colors::kCopper, "%uc", c);
|
||||
}
|
||||
|
||||
// Convenience overload: decompose copper amount and render as gold/silver/copper
|
||||
inline void renderCoinsFromCopper(uint64_t copper) {
|
||||
renderCoinsText(static_cast<uint32_t>(copper / 10000),
|
||||
static_cast<uint32_t>((copper / 100) % 100),
|
||||
static_cast<uint32_t>(copper % 100));
|
||||
}
|
||||
|
||||
} // namespace wowee::ui
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue