Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battle action start on client after intro sound #562

Merged
merged 2 commits into from Mar 24, 2019

Conversation

Projects
None yet
3 participants
@dydzio0614
Copy link
Member

commented Mar 22, 2019

This PR adds missing delay for combat action to start when entering battle. Delay can be stopped by pressing ESC key. Still some details missing to make it work 100% as in H3, but there is big improvement already.

@@ -44,6 +44,8 @@
#include "../../lib/NetPacks.h"
#include "../../lib/UnlockGuard.h"

int battleIntroSoundChannel; //required as variable for disabling it via ESC key

This comment has been minimized.

Copy link
@FeniksFire

FeniksFire Mar 23, 2019

Member

making such globals is bad idea

@@ -104,7 +106,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet *army1, const CCreatureSet
currentlyHoveredHex(-1), attackingHex(-1), stackCanCastSpell(false), creatureCasting(false), spellDestSelectMode(false), spellToCast(nullptr), sp(nullptr),
creatureSpellToCast(-1),
siegeH(nullptr), attackerInt(att), defenderInt(defen), curInt(att), animIDhelper(0),
myTurn(false), moveStarted(false), moveSoundHander(-1), bresult(nullptr)
myTurn(false), moveStarted(false), moveSoundHander(-1), bresult(nullptr), battleActionsStarted(false)

This comment has been minimized.

Copy link
@FeniksFire

FeniksFire Mar 23, 2019

Member

I think in class initialization will be better one

This comment has been minimized.

Copy link
@dydzio0614

dydzio0614 Mar 23, 2019

Author Member

It probably would, but what about consistency with other variables atm? Some initialized here, some in-class would result in a mess.

This comment has been minimized.

Copy link
@FeniksFire

FeniksFire Mar 23, 2019

Member

I thought that constructor is a mess anyway, keeping consistency makes no sense when itself it's broken, but you can do as you wish

@@ -1630,6 +1638,9 @@ void CBattleInterface::setHoveredStack(const CStack *stack)

void CBattleInterface::activateStack()
{
if(!battleActionsStarted)

This comment has been minimized.

Copy link
@FeniksFire

FeniksFire Mar 23, 2019

Member

making some getter method for such things will be nice

This comment has been minimized.

Copy link
@dydzio0614

dydzio0614 Mar 23, 2019

Author Member

But... this variable is private

This comment has been minimized.

Copy link
@FeniksFire

FeniksFire Mar 23, 2019

Member

yep that makes a thing a bit strange, like before just thought that in the future refactoring this can be helpfull

@alexvins alexvins merged commit 9ad71b2 into vcmi:develop Mar 24, 2019

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@dydzio0614 dydzio0614 deleted the dydzio0614:BattleIntroFix branch Mar 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.