Power charge no longer kept in the battle menu
To reproduce:
- Start a fight
- Open the Battle menu
- Fully charge lightning outside of the battle menu, keep LMB held
- Move cursor over to the enemy units to cast it -> notice you cannot cast the charged spell.
somthing with playerstates.toml
Do we support using overcharge inside the battle menu? I mean the following steps. Do we support this kind of operation?
- Start a combat, and open the battle menu.
- Go to Keeper's spell menu, and click Lightning spell.
- Move the mouse cursor into the battle menu. Move it onto the enemy's icon.
- Hold the left mouse key. Try to overcharge. Release the key to cast the spell.
When you have your cursor over the battle menu, you should neither lose charge, or be able to charge up more.
EDIT: Seems that actually you should be able to charge up in the menu, you could in the original game at least. But in KeeperFX this has been impossible for many years.
From what I heard and what I observed in my tests, the current behaviors are:
- Lightning: Charge outside, and move the cursor onto an enemy icon in the battle menu. We will lose the charged level. (Bug 1)
- Speed: Charge outside, and move the cursor onto an enemy icon in the battle menu, The charged level remains without needing to hold the left button. Click the left button on our creature icon can cast the charged spell. When moving the cursor outside the battle menu, we will lose the charged level.
- Both Lightning and Speed CAN NOT be charged inside the battle menu (Bug 2).
Bug 1 can be easily fixed by adding "ENEMY_CRTRS" to the Castability of POWER_LIGHTNING. However, it will cause another bug: When moving the cursor out of the battle menu, a non-charged Lightning will be cast on the ground, right on the edge between the battle menu and the normal map. This might be caused by an unwanted Left button release event.
Bug 2 is related to the handling of holding the left button. I can let the charging happen inside the battle menu by hacking get_packet_control_mouse_clicks(), but it causes a bad side effect - one additional Lightning will be cast on the normal map behind the battle menu. It seems related to the left button handling, too.