It is currently 11 Sep 2025, 17:15
   
Text Size

Added support for sacrifice to UnlessCost

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Added support for sacrifice to UnlessCost

Postby ArsenalNut » 15 Jul 2012, 07:53

I added the ability to use sacrifice costs for an UnlessCost. I only converted Rathi Dragon to the new capability because I wanted to make sure everyone was ok with implementation. I changed how the input works for choosing the cards to sacrifice. Clicking a card once adds it to the sacrifice list. Clicking a card again removes it from the list. The selected cards are displayed in the prompt panel. Once the required number of cards are chosen, the OK button gets enabled. The cards are only sacrificed after the OK button is pressed so the user can change or cancel their choices without removing the cards permanently.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Added support for sacrifice to UnlessCost

Postby friarsol » 15 Jul 2012, 12:37

ArsenalNut wrote:I added the ability to use sacrifice costs for an UnlessCost. I only converted Rathi Dragon to the new capability because I wanted to make sure everyone was ok with implementation. I changed how the input works for choosing the cards to sacrifice. Clicking a card once adds it to the sacrifice list. Clicking a card again removes it from the list. The selected cards are displayed in the prompt panel. Once the required number of cards are chosen, the OK button gets enabled. The cards are only sacrificed after the OK button is pressed so the user can change or cancel their choices without removing the cards permanently.
This sounds good to me. Is it more intuitive to do left click to add to the list, right click to remove from the list? We already use this for Attacking and Blocking logics.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Added support for sacrifice to UnlessCost

Postby ArsenalNut » 15 Jul 2012, 14:26

friarsol wrote:
ArsenalNut wrote:I added the ability to use sacrifice costs for an UnlessCost. I only converted Rathi Dragon to the new capability because I wanted to make sure everyone was ok with implementation. I changed how the input works for choosing the cards to sacrifice. Clicking a card once adds it to the sacrifice list. Clicking a card again removes it from the list. The selected cards are displayed in the prompt panel. Once the required number of cards are chosen, the OK button gets enabled. The cards are only sacrificed after the OK button is pressed so the user can change or cancel their choices without removing the cards permanently.
This sounds good to me. Is it more intuitive to do left click to add to the list, right click to remove from the list? We already use this for Attacking and Blocking logics.
To do the left click add, right click remove, I needed to add a new class that extends Input. I wanted to get feedback on the new input sequence to activate sacrifice before I added a new class. I can definitely implement it that way if that is the community's preference.

I also think it would make things more intuitive to a add visual clue indicating which cards are selected like a different colored highlight similar to the mouse over. I could not figure out where to begin to add such an effect. Any pointers?
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Added support for sacrifice to UnlessCost

Postby friarsol » 15 Jul 2012, 14:35

ArsenalNut wrote:I also think it would make things more intuitive to a add visual clue indicating which cards are selected like a different colored highlight similar to the mouse over. I could not figure out where to begin to add such an effect. Any pointers?
CardPanel.paintChildren() has the function that paints icons on top of images. We use this for Attacking/Blocking/Phasing etc. I had planned on using this (somehow) for "being currently used in cost payment" when I thought I might have time to handle it. I'm not sure what the best way would be, but we should be able to manage something?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Added support for sacrifice to UnlessCost

Postby Sloth » 15 Jul 2012, 14:45

friarsol wrote:CardPanel.paintChildren() has the function that paints icons on top of images. We use this for Attacking/Blocking/Phasing etc. I had planned on using this (somehow) for "being currently used in cost payment" when I thought I might have time to handle it. I'm not sure what the best way would be, but we should be able to manage something?
We already had an icon for this. Was it made by you marc?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Added support for sacrifice to UnlessCost

Postby moomarc » 15 Jul 2012, 18:01

Sloth wrote:
friarsol wrote:CardPanel.paintChildren() has the function that paints icons on top of images. We use this for Attacking/Blocking/Phasing etc. I had planned on using this (somehow) for "being currently used in cost payment" when I thought I might have time to handle it. I'm not sure what the best way would be, but we should be able to manage something?
We already had an icon for this. Was it made by you marc?
Yip. Originally made when Sol was working on something similar over here (link might be wrong if you have a different sort order, but its near the start of the thread). I'd probably redesign now to match our other card state icons, but its something for now.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Added support for sacrifice to UnlessCost

Postby ArsenalNut » 16 Jul 2012, 04:39

Updated the Unless sacrifice functionality. It is now using a right click to unselect a card. The selections are also highlighted with a magenta boundary and an icon is put on each selection. I am using the graveyard icon right now because I didn't have anything nicer (hint hint Moomarc :)) I added the selection highlight to the border also, because the icons are hard to see for stacked cards.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Added support for sacrifice to UnlessCost

Postby moomarc » 16 Jul 2012, 05:30

ArsenalNut wrote:Updated the Unless sacrifice functionality. It is now using a right click to unselect a card. The selections are also highlighted with a magenta boundary and an icon is put on each selection. I am using the graveyard icon right now because I didn't have anything nicer (hint hint Moomarc :)) I added the selection highlight to the border also, because the icons are hard to see for stacked cards.
Ooh, so you're trying to tell me that the old icon I linked to was too ugly! :cry: Just kidding. I'll throw something together later today.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Added support for sacrifice to UnlessCost

Postby moomarc » 16 Jul 2012, 08:26

Okay, the new icon is in the sprite and I've linked up the coords etc. I kept it generic so that it can be used for other cost types if they get expanded to use the same system.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 36 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 36 users online :: 0 registered, 0 hidden and 36 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 36 guests

Login Form