It is currently 31 Oct 2025, 22:54
   
Text Size

Implementing variants

Post MTG Forge Related Programming Questions Here

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

Re: Implementing variants

Postby Max mtg » 23 Feb 2013, 20:04

Chris, it's by design that top label is 80% wide and pushed to the right, meanwhile the remaining part of view takes all avaliable space and is enlarged or shrinked with the window.

Your solution is about center-aligning the 80%-wide contents while it should take 100% of the space avaliable with some gaps from edges of the panel. That's not how constructed/draft/sealed or quest home screens are shown.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Implementing variants

Postby Max mtg » 26 Feb 2013, 18:59

I made something similiar to constructed menus - the central panel takes all available space with 20px gaps from each side.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Implementing variants

Postby myk » 26 Feb 2013, 20:13

I'm starting to go through the submenus to look for focus issues, and I'm seeing some serious code duplication (especially in the variant and gauntlet submenus). Would it be a good idea to just make some base classes and inherit functionality instead of rewriting it? This would require that we change the submenu views from enums to classes, but I don't think that would take any architecture changes since they'd still be available as singletons via EDocID.getDoc() (not that I'm promoting the singleton access pattern, I'm just trying to keep changes to a minimum).
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: Implementing variants

Postby Chris H. » 27 Feb 2013, 19:55

I made a few minor adjustments to the variant UI and a major one to the Archenemy UI.

The Archenemy view now will resize to 800 x 600 pixels but the random button is drawn offscreen and can not be seen or used. This view used to draw the bottom portion of the view off screen when size was minimized.

If anyone can figure out why the Random button is being drawn off screen I would appreciate it as I suspect that I may not be able to figure it out. #-o
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Implementing variants

Postby myk » 27 Feb 2013, 21:43

I think we can fix a lot of the variant submenus by using the proper widgets -- most of the screen is just a copied version of DeckChooser. If we use that widget (properly generalized to meet variant submenu needs), we can probably solve a lot of the problems.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: Implementing variants

Postby Max mtg » 27 Feb 2013, 21:56

Are you about to force scheme/avatar selection and generation into FDeckChooser?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: Implementing variants

Postby Chris H. » 27 Feb 2013, 22:11

myk wrote:I think we can fix a lot of the variant submenus by using the proper widgets -- most of the screen is just a copied version of DeckChooser. If we use that widget (properly generalized to meet variant submenu needs), we can probably solve a lot of the problems.
 
I have noticed a number of issues while testing the three views at the smallest 800 x 600 pixel size, Vanguard appears to have the most problems.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Implementing variants

Postby myk » 28 Feb 2013, 07:32

Max mtg wrote:Are you about to force scheme/avatar selection and generation into FDeckChooser?
I wasn't planning to. Rather, FDeckChooser can expose APIs for adding the variant-specific widgets.
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: Implementing variants

Postby Chris H. » 05 Mar 2013, 15:41

Chris H. wrote:
myk wrote:I think we can fix a lot of the variant submenus by using the proper widgets -- most of the screen is just a copied version of DeckChooser. If we use that widget (properly generalized to meet variant submenu needs), we can probably solve a lot of the problems.
 
I have noticed a number of issues while testing the three views at the smallest 800 x 600 pixel size, Vanguard appears to have the most problems.
 
I have made a few more observations over the last week or so.

My monitor is normally set to 1920 x 1200. When I launch Forge it will fill this display and the objects in the Archenemy and Planechase views will draw correctly. While at this resolution, if I resize the Forge window down to a smaller size (at or near the minimum 800 x 600 size) the random button is drawn off screen. If I click on the various player tabs the view will sometimes be drawn too big and other times will draw at a smaller size where more of the components will become visable.

On several occasions I changed my monitor's resolution down to 800 x 600. When I then launch Forge it will fill this display and the objects in the Archenemy and Planechase views will draw correctly.

The problems apparently is connected to resizing the window down to less than it's original/maximum size. I do not notice this in other views and it may be limited to the variant game modes.


Note:

I moved the constraints that I created for the Archenemy mode over to the Planechase mode and they now appear in a similar fashion.

The vanguard mode is tricky as it includes a card detail panel and as such probably requires a display that is at least 1280 wide.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Implementing variants

Postby friarsol » 18 Mar 2013, 02:04

I think it'd be useful for Planes to Statically grant the change planes trigger instead of scripting it on every card, similarly to how Basic Land types Statically have Mana abilities.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Implementing variants

Postby swordshine » 08 May 2013, 11:04

Is there a convenient way to test planes?
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Implementing variants

Postby Hellfish » 08 May 2013, 11:50

You can rig the planar dice, but that's about it.Anything specific you were after?
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Implementing variants

Postby swordshine » 08 May 2013, 12:42

Hellfish wrote:You can rig the planar dice, but that's about it.Anything specific you were after?
It doesn't work for me currently.
IllegalStateException | Open
Code: Select all
Forge Version:    SVN
Operating System: Windows XP 5.1 x86
Java Version:     1.7.0_17 Oracle Corporation

java.lang.IllegalStateException: forge.game.player.HumanPlayer.playSpellAbility may not be accessed from the event dispatch thread.
   at forge.FThreads.assertExecutedByEdt(FThreads.java:51)
   at forge.game.player.HumanPlayer.playSpellAbility(HumanPlayer.java:105)
   at forge.game.zone.MagicStack.chooseOrderOfSimultaneousStackEntry(MagicStack.java:1065)
   at forge.game.zone.MagicStack.chooseOrderOfSimultaneousStackEntryAll(MagicStack.java:1007)
   at forge.gui.GuiDisplayUtil.devModeRiggedPlanarRoll(GuiDisplayUtil.java:689)
   at forge.gui.match.controllers.CDev$13.mousePressed(CDev.java:87)
   at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:280)
   at java.awt.Component.processMouseEvent(Component.java:6502)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
   at java.awt.Component.processEvent(Component.java:6270)
   at java.awt.Container.processEvent(Container.java:2229)
   at java.awt.Component.dispatchEventImpl(Component.java:4861)
   at java.awt.Container.dispatchEventImpl(Container.java:2287)
   at java.awt.Component.dispatchEvent(Component.java:4687)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4489)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
   at java.awt.Container.dispatchEventImpl(Container.java:2273)
   at java.awt.Window.dispatchEventImpl(Window.java:2719)
   at java.awt.Component.dispatchEvent(Component.java:4687)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
   at java.awt.EventQueue.access$200(EventQueue.java:103)
   at java.awt.EventQueue$3.run(EventQueue.java:688)
   at java.awt.EventQueue$3.run(EventQueue.java:686)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
   at java.awt.EventQueue$4.run(EventQueue.java:702)
   at java.awt.EventQueue$4.run(EventQueue.java:700)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Implementing variants

Postby Hellfish » 12 May 2013, 09:34

Alright,took me long enough, but it's fixed now :)
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: Implementing variants

Postby Hellfish » 12 May 2013, 16:08

Btw, Marc,I forgot to mention this in the svn log, but I added your Orzhova script when I converted the variant decks to zones. Works a treat, thanks! :)
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 31 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 31 users online :: 0 registered, 0 hidden and 31 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 31 guests

Login Form