mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Auto-unsheath weapons on combat engage
This commit is contained in:
parent
5d63bb0988
commit
ef6be2f186
2 changed files with 12 additions and 0 deletions
|
|
@ -192,6 +192,7 @@ private:
|
||||||
uint32_t mountModelId_ = 0;
|
uint32_t mountModelId_ = 0;
|
||||||
uint32_t pendingMountDisplayId_ = 0; // Deferred mount load (0 = none pending)
|
uint32_t pendingMountDisplayId_ = 0; // Deferred mount load (0 = none pending)
|
||||||
bool weaponsSheathed_ = false;
|
bool weaponsSheathed_ = false;
|
||||||
|
bool wasAutoAttacking_ = false;
|
||||||
void processPendingMount();
|
void processPendingMount();
|
||||||
bool creatureLookupsBuilt_ = false;
|
bool creatureLookupsBuilt_ = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -352,6 +352,7 @@ void Application::logoutToLogin() {
|
||||||
npcsSpawned = false;
|
npcsSpawned = false;
|
||||||
playerCharacterSpawned = false;
|
playerCharacterSpawned = false;
|
||||||
weaponsSheathed_ = false;
|
weaponsSheathed_ = false;
|
||||||
|
wasAutoAttacking_ = false;
|
||||||
world.reset();
|
world.reset();
|
||||||
if (renderer) {
|
if (renderer) {
|
||||||
// Remove old player model so it doesn't persist into next session
|
// Remove old player model so it doesn't persist into next session
|
||||||
|
|
@ -409,6 +410,16 @@ void Application::update(float deltaTime) {
|
||||||
auto gh2 = std::chrono::high_resolution_clock::now();
|
auto gh2 = std::chrono::high_resolution_clock::now();
|
||||||
ghTime += std::chrono::duration<float, std::milli>(gh2 - gh1).count();
|
ghTime += std::chrono::duration<float, std::milli>(gh2 - gh1).count();
|
||||||
|
|
||||||
|
// Always unsheath on combat engage.
|
||||||
|
if (gameHandler) {
|
||||||
|
const bool autoAttacking = gameHandler->isAutoAttacking();
|
||||||
|
if (autoAttacking && !wasAutoAttacking_ && weaponsSheathed_) {
|
||||||
|
weaponsSheathed_ = false;
|
||||||
|
loadEquippedWeapons();
|
||||||
|
}
|
||||||
|
wasAutoAttacking_ = autoAttacking;
|
||||||
|
}
|
||||||
|
|
||||||
// Toggle weapon sheathe state with Z (ignored while UI captures keyboard).
|
// Toggle weapon sheathe state with Z (ignored while UI captures keyboard).
|
||||||
{
|
{
|
||||||
const bool uiWantsKeyboard = ImGui::GetIO().WantCaptureKeyboard;
|
const bool uiWantsKeyboard = ImGui::GetIO().WantCaptureKeyboard;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue