# Don't slowdown game when clicking card and always show CAST button

**URL:** <https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166>\
**Category:** Feature Requests and Game feedback\
**Created:** [June 22, 2017, 10:11pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166 "2017-06-22T22:11:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mad\_Butch](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/mad_butch/32/22903_2.png) [@Mad\_Butch](https://community.gemsofwar.com/u/Mad_Butch)\
**Post date:** [June 22, 2017, 10:11pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/1 "2017-06-22T22:11:05Z")

</div>

Hi guys,

I love that you can click your and the enemy cards at any time now.  
But when you click one of your own cards, to cast, and click it to early, there is no cast button.  
This is because you can’t cast yet, but the button also doesn’t appear when you are able to use it.  
Solution: Always show the cast button with your own cards, and just have it disabled while you can’t use it and then enable it as soon as you can use it.

Also, don’t slowdown the game in the background while a card is being shown.

If the above two are to much work, I’d like an option to disable showing cards while the game is not “idle” (aka, it’s not your turn). That way I won’t be able to click the card to early, and slowdown my whole game in the process.  
But I prefer the actual fix above this 🙂

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![Rasper](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/rasper/32/2363_2.png) [@Rasper](https://community.gemsofwar.com/u/Rasper)\
**Post date:** [June 22, 2017, 10:53pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/2 "2017-06-22T22:53:50Z")

</div>

While the cast button sounds like an easy fix, from a code perspective that isn’t always the case. Let me 'splain…

Imagine 3 things: The Engine (which handles what happens), the UI (which handles normal game display), and the Card (which draws the troop card on screen and with/without cast button). When you click a troop during opponent turn the UI asks Engine “Can this troop cast?”. The Engine responds “No!”, so the UI tells the Card to display of screen with no cast button. A short time later the Engine wraps up the AI turn, however Card has no clue anything has changed, it just knows what it was told when UI commanded it to show on screen. But if you close the Card and click again, when UI asks Engine if it can cast it says “Yes”, so it tells Card to display with cast button and life goes on.

The Engine can’t talk to Card, just answers UI questions. And UI can’t talk to Card, just tell it when to display and how. Card can talk to UI, but only does so when you close it or click cast. Adding an extra communication channel isn’t trivial; you’d either need the Engine able to tell the Card of the change (which adds another way for things to screw up later), the UI to talk to the Card after it is displayed (ditto), or for Card to ping the UI every second to ask “cast yet??” (which adds complexity and potentially slows it down)

TLDR: It is likely more trouble than it is worth from a good coding standard perspective 🙂

---

<div class="post-metadata">

**Author:** ![Mad\_Butch](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/mad_butch/32/22903_2.png) [@Mad\_Butch](https://community.gemsofwar.com/u/Mad_Butch)\
**Post date:** [June 22, 2017, 10:57pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/3 "2017-06-22T22:57:57Z")

</div>

Pretty sure Unity is event based though, so all the code would have to do is send out a “player’s turn” event, which the card screen can catch to enable the button.

But I know where you’re coming from, hence, option 2 🙂

---

<div class="post-metadata">

**Author:** ![Mad\_Butch](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/mad_butch/32/22903_2.png) [@Mad\_Butch](https://community.gemsofwar.com/u/Mad_Butch)\
**Post date:** [June 22, 2017, 11:05pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/4 "2017-06-22T23:05:08Z")

</div>

Oh, and even if it didn’t use events, then all the engine had to do is check if a player card is visible when it enters idle (player’s turn) mode, and when it does, tell it to enable the button.

---

<div class="post-metadata">

**Author:** ![Mad\_Butch](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/mad_butch/32/22903_2.png) [@Mad\_Butch](https://community.gemsofwar.com/u/Mad_Butch)\
**Post date:** [June 22, 2017, 11:05pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/5 "2017-06-22T23:05:51Z")

</div>

See, now you got me thinking code again… I’m supposed to be having weekend now 🙂

---

<div class="post-metadata">

**Author:** ![Rasper](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/rasper/32/2363_2.png) [@Rasper](https://community.gemsofwar.com/u/Rasper)\
**Post date:** [June 22, 2017, 11:08pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/6 "2017-06-22T23:08:19Z")

</div>

My work here is done!

_insert evil laugh here_

---

<div class="post-metadata">

**Author:** ![mitamata](https://sea1.discourse-cdn.com/flex019/user_avatar/community.gemsofwar.com/mitamata/32/10313_2.png) [@mitamata](https://community.gemsofwar.com/u/mitamata)\
**Post date:** [June 23, 2017, 5:11pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/7 "2017-06-23T17:11:00Z")

</div>

This would save me so many clicks, lol. Can we have this please? Thank you! 😊

---

<div class="post-metadata">

**Author:** ![Vasilisk](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@Vasilisk](https://community.gemsofwar.com/u/Vasilisk)\
**Post date:** [June 28, 2017, 4:55pm UTC](https://community.gemsofwar.com/t/dont-slowdown-game-when-clicking-card-and-always-show-cast-button/26166/8 "2017-06-28T16:55:34Z")

</div>

what if adding a button for casting? i.e. when spell is ready right clicking fire the spell.  
when playing on pc it’s really annoying that back and forth…
