Combos: cooldown labels on the skill bar, steps follow the arts' current levels

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-18 00:43:03 +02:00
1 parent 5a0db24b83
commit 075f9e2c8a
6 files changed
+199 -4

No files matched your search

+7 -4
View File
@@ -20,6 +20,7 @@
//
// Recharging arts show their remaining cooldown (seconds, one decimal) on the
// slot, drawn with the game's font after RenderArtSlots.
// Combos too, from their charge (game::GetComboCooldown).
//
// Also: 7 entries in the slot-count-by-level table (6 at level 45, 7 at 65),
// and cCreature::AssignArtToSlot accepts slots up to 6.
@@ -184,7 +185,8 @@ void UpdateLabelRects(uint8_t* const* skills) {
// The remaining cooldown in seconds (at the hero's current regeneration
// rate, game::GetArtCooldown), to one decimal, centred on each art slot that
// is recharging (combat moves and spells: slot types 2 / 3).
// is recharging (combat moves and spells: slot types 2 / 3; combos: 4,
// game::GetComboCooldown).
void RenderCooldowns(void* taskbar, void* renderer) {
auto* p = static_cast<uint8_t*>(taskbar);
uint8_t* inventory = skillslots::Inventory(*reinterpret_cast<const uint16_t*>(p + kInventoryIndex));
@@ -203,11 +205,12 @@ void RenderCooldowns(void* taskbar, void* renderer) {
for (unsigned slot = 0; slot < kSlots && slot < shown; ++slot) {
const uint32_t type = getType(inventory, nullptr, slot);
const uint32_t ref = getRef(inventory, nullptr, slot);
if (!skills[slot] || (type != 2 && type != 3) || !ref) {
if (!skills[slot] || (type != 2 && type != 3 && type != game::kArtSlotTypeCombo) || !ref) {
continue;
}
const uint16_t art = game::ResolveArtId(hero, ref);
const game::ArtCooldown cooldown = game::GetArtCooldown(hero, art);
const game::ArtCooldown cooldown = type == game::kArtSlotTypeCombo
? game::GetComboCooldown(hero, ref)
: game::GetArtCooldown(hero, game::ResolveArtId(hero, ref));
if (cooldown.remaining <= game::kArtReadyCooldown) {
continue; // ready: no label, the game's icon shows it
}