Commit Graph

77 Commits

Author SHA1 Message Date
Anthony Calosa
ab75c1d5e2 adjust simple menu
adjust simple menu and fix some cards
2016-07-13 11:43:00 +08:00
Anthony Calosa
d2d8b06d97 lowered value 2016-07-12 17:44:57 +08:00
Anthony Calosa
416a49d87f Update some items 2016-07-12 15:49:43 +08:00
Anthony Calosa
6d4a068453 SImple Menu 2016-07-11 13:54:08 +08:00
Anthony Calosa
cd1b629191 Fix Segmentation Fault & Formatting 2015-11-10 11:58:36 +08:00
Tobias Loose
69c6745f53 Make getMenuText() return string. 2013-11-29 13:33:33 +01:00
Tobias Loose
e0428ac7b0 Avoid more conflicts. We could now do unit builds...
and make the linker put every data element and function into its own section.
On linktime, we can output every discarded section and get a list of dead
code (for that build).
2013-11-23 17:04:24 +01:00
Unknown
224c94e890 Included some testsuite into qtmain and updated travis file to try to use it. 2013-10-27 23:06:29 +01:00
omegablast2002@yahoo.com
2aed88a44f fixed the simplemenu scrolling bug, the scrolling will no longer jump to the final selection you made when scrolling down and up. 2013-01-07 21:33:59 +00:00
techdragon.nguyen@gmail.com
08b6975300 refactoring change for http://code.google.com/p/wagic/source/detail?r=4364 to ensure bounds for n is always met. 2012-03-25 23:43:59 +00:00
omegablast2002@yahoo.com
bf88bee58a fixed a crash that would occur when hugging the bottem edge of a menu with one option example: auto=choice sacrifice 2012-03-25 19:39:10 +00:00
techdragon.nguyen@gmail.com
773e852b83 this should resolve the issues with scrolling lists. I modified the height of the menu a little bit (-10px) because on larger menus, the bottom of the menu blended into the dark shadows of the screen. This small height change makes the bottom of the menu more visible. 2012-03-25 05:01:43 +00:00
techdragon.nguyen@gmail.com
c8007e7179 recalculated height of menu items previous calculation did not take into scaling of the text 2012-03-24 06:48:02 +00:00
techdragon.nguyen@gmail.com
218db9d844 improved scrolling of simple menus. Now you can scroll up as well as down by activating the area above/below the menu items
removed the buttons when displaying the filter menus.
2012-03-23 13:17:13 +00:00
omegablast2002@yahoo.com
26239cdc91 moved the scale reset outside of the if statement, this is to fix a bug where hovering over the last item cause other text items as well as "cancel" to enlarge. 2012-03-22 13:26:09 +00:00
Xawotihs@gmail.com
2a3f998034 Fixed compilation problem with gcc 2012-03-21 21:59:18 +00:00
wagic.the.homebrew
bdec6c6b7d Additional scaling issues fixes + bug fix by Zeth in SimpleMenu 2012-03-21 14:58:53 +00:00
wagic.the.homebrew
a581d1bba3 - Fixed some scaling issues with SimpleMenu
- Fixed the animation for the menu fonts when selecting an item in the menu. mTargetScale and mScale in SimpleButton are here for a reason, people! 
-- Note: I'm not sure I actually like the "zoom on currently selected item" thing, not sure it brings much.
-- we should definitely consider a hi resolution font because now it really doesn't look good, when it is scaled that much

Why is the subtypes menu using a different font from all other simpleMenus ?
2012-03-21 14:44:23 +00:00
omegablast2002@yahoo.com
f33fe0298e unsigned int from float warning treated as error fix. 2012-03-21 11:28:43 +00:00
techdragon.nguyen@gmail.com
865bc7e494 resolved scrolling issue (Issue 801) in filters list. it's a little verbose, but it seems to work. need to see if we can't refactor CheckUserInput to reduce the amount of code duplication. The logic for SimpleMenu is slightly different from the base method. perhaps we should override CheckUserInput to take in two parameters instead of one. 2012-03-20 23:07:21 +00:00
omegablast2002@yahoo.com
18c0868d88 readjusted some of the values for simplemenu, deckmenu still requires "princess fingertips", but the others have their spacing back and font size back. 2012-03-20 16:27:14 +00:00
techdragon.nguyen@gmail.com
57627849a0 modified font size of text in menus.
Adjusted the spacing between menu items on all menus. They were a little too far apart once I modified the font size.
fixed Hollowhenge Spirit
2012-03-20 08:35:38 +00:00
omegablast2002@yahoo.com
eb8c0c54f1 in this commit suspend now states the amount of turns in the menutext....
made changes to some of the simple menu items, made the simple menu not draw massive horizontal and vertical poles, that look was extremely dated.
2012-03-13 16:12:00 +00:00
techdragon.nguyen@gmail.com
519cd3bd69 refactored DeckMenuItem to be a derived class of SimpleMenuItem. Not sure why I had made them distinct.
TODO: review DeckMenu and SimpleMenu to see if it would be better to have them derive from a base class rather than be distinct.
2012-01-23 08:39:18 +00:00
Xawotihs
f68c106e7e - Modified gameObserver and related classes to be able to work with a precise JGE instance given at construction and not the static global one. That allows to run gameObserver without JGE instance (for example in a worker thread).
- Added an "ACTION_LOGGING_TESTING" mode in the gameObserver. When this is defined, the game reloads itself in every update. I want to use that to track undo problems. Be aware that it kills performances and crashes with the testsuite if you want to activate it.
- Various cleanup/refactor of the game observer.
- Added a gameObserver == operator to compare two games
- Added player mode to the player serialization
- Added a multi-threaded mode to AI_CHANGE_TESTING. For the moment it's only useable with Qt. If you want to use it without, just defined a thread_count higher than 1.
- Refactored random generator class to use list intead of queue
- Defined a specific type for interrupt decision instead of int
2011-11-13 22:36:34 +00:00
Xawotihs
e50fdba648 - Replaced static parts by per-instance parts of of several classes when they were not threadsafe (AIMomirPlayer, SimpleMenu, Trash, AIAction, MTGCardInstance, ATutorialMessage, MTGRules). The direct consequence is that we could consumme more memory. So, tell me if you have problems with low memory devices (PSP), there are some threadsafe optimizations that could be implemented if needed.
- Reworked the testsuite to be able to work multithreaded. This is deactivated by default everywhere except in QT_CONFIG as one testcase still refuses to pass in multithreaded mode. On my 4 cores linux desktop, the 650 tests passes now in 4 seconds (1 fails).
- Replaced usage of CardSelectorSingleton by a card selector per game observer.
- Modified the resource manager to be optionnal and per game observer instance instead of being a singleton. Two reasons here : threading AND Open Gl access. I only updated the crashing parts called from the game observer, so most of the code is still using the single instance. Beware of copy-paste concerning resources ...
- Cleaned up the game observer constructors
- Fixed several problems in action logging code while testing proliferate decks
- Cleaned up Threading implementation based on QThread
2011-11-06 17:31:44 +00:00
omegablast2002@yahoo.com
6399917d25 changes:
added abilities:
proliferate
ProliferateChooser:new targetchooser for cards with counter and poison counters "proliferation".

MenuAbility:new internal ability to create custom menus of abilities which can be activated in sequence one after another.

multikicker, syntax kicker=multi{b}
works with variable word "kicked", the amount of times it was kicked.

target=<number>tc,target=<upto:>tc,target=<anyamount>tc,target(<number>tc),target(<upto:>tc),target(<anynumber>tc);
multitarget is now supported with the exception of "devided any way you choose" which can not be supported becuase we allow detoggling of targeted cards with a "second" click....so you can not click the same card 2 times to add it to the targets list twice for example.
this is minor, as the bulk of multitarget is not "devided"
removed 's' parsing for multitarget, added a limit of 1000 to "unlimited" for easier handling; we currently can't handle activation of an ability on a 1000 cards very well on any platform(infact i don't suggest it)

Countershroud(counterstring), this MTGAbility allows you to denote that a card can not have counters of the type "counterstring" put on it.
"any" is for no counters allowed at all. this is a replacement effect. cards state that they can still be the targets of counter effects, however on resolve nothing is placed on them instead.

@counteradded(counterstring) from(target):,@counterremoved(counterstring) from(target):: these are triggers for cards which state "whenever you add a counter of "counterstring" to "target"; added counterEvents struct; 

other changes:
added support for ai handling of multitargeted spells.

changed a few of delete( into SAFE_DELETE(, safed up a couple areas where they did not seem safe to me;

added better handling of menus presented to ai, it will try to select the best based on eff returns.

added varible lastactioncontroller for ai use, it keeps it truely from ever tripping over itself and brings ai more inline with MTG rules.

converted TC into a protected member.
added "abilitybelongsto" string to tc, and set "owner" of the tc. a tc should never belong to "no one" it should always have a owner.
abilitybelongs to string is solely for easier debugging, i found it was a pain to never know what ability created a tc while i coded multitarget. the owner of the tc is the only one that should be using it, if an ability needs to declare the opponent as the owner (choose discard which is currently unsupported for example) this will allow us to better handle that situation by setting the tc owner in the ability which called it.

rewrote the logic of "checkonly" in ai choose targets, the only time it is "checkonly" is when it is trying to see if it had a target for a spell before it cast it, i now set this in the actual function call instead, the old method was far to error prone.

wrote logic for ai checking of menu objects presented to it,
ai will now make better choices when a menu is presented to it based on what it already knows. this changes it from it's old method of "just click the first option".

taught ai how to use multi-mana producers such as birds and duel lands by adding a method for it to find it's mana for a payment. it can effectively use cards like birds of paradise and sol ring(without locking up). It's primary method of pMana searching was maintain for performance(no need to deep search if we have it in pMana).

added a vector to actionlayer to store mana abilities for pMana. this provides us with a dramatic improvement when mana lords are present by reducing the amount of objects that need checking when ai checks pMana.
with 80 mana objects and a ton of lords one instance i checked went from 8000ish checks down to 80<===big difference.

added "tapped" green coloring(sorry i missed that!)...added red coloring to current actionLayers current action card (usually the source).

changed "type(" restrictions second amount from atoi into wparsedint for more flexiable coding.

add "&" parsing to CD targetchooser, removed "iscolorandcolor" variables and functions becuase they were a hack the real fix was this.
cretaure[dragon&black&blue] a creature that is a dragon, and black and also blue.

changed some of the ai computeactions and
removed unneeded gaurds in ai chooseblockers, they did more harm then good.
2011-09-01 20:03:26 +00:00
wagic.the.homebrew
4a6529ea55 - Reverting r3744. This fixes issue 707
-- I will open a new issue for the problem that r3744 was fixing
2011-07-10 04:36:55 +00:00
wrenczes@gmail.com
a1fd7bd508 Added a simple hack so that '1 Player' will show up as the default selection for the Play menu instead of the last item in the list - in my case, the Test Suite. 2011-06-22 05:06:54 +00:00
wrenczes@gmail.com
a4964f944c Fixed my centering code - I forgot that we always draw in terms of psp sizes, so when I'd toggle to doublesize / full screen, the centering code was way off for the menu as it was using screen resolution instead. 2011-06-03 02:29:06 +00:00
wrenczes@gmail.com
945c2601d0 Fixed the SimpleMenu to recenter itself as its default behaviour during construction. (You can still override it to position it explicitly if needed.) This fixes the bad alignment of the menu when you'd select single player & the hermit mode was unlocked. 2011-06-02 18:27:00 +00:00
omegablast2002@yahoo.com
ad56dfa8d0 3 things here
first as requested, kicker will now act like the other cost, offering a menu choice, heres the catch tho, 
it was also thought up that we should maintain the "pay automatically" method of it as it feels more natural to some(even tho as per MTG rules its supposed to be a choice).
so here is what i did that i hope satisfies everyone, i added a new menu option under advanced tab..."kicker payment" with 2 setting, by defualt "always pay" but also an option to "always offer choice"...

2nd, minor tweaks to player avatar, every tme i saw it i was like "i need to do something about that", the avatar getting completely sucked into the corner just looked bad imo, so i about doubled the "inactive" size, so it looks a little more uniform with the opponents avatar. also move the library and grave icons just a thin hair to the left so they don't grossly overlap the players avatar as much when active, and increased the dark box theyre contained in my just a few pixels.

3rd, something else thats really bothered me to no end was that the title text of simple menus which display the cards name which owns the box was using small face font, which on pc was *barely* ok...but on psp(smaller devices) looks like white smears and dots. i changed it to share the font and size used inside the menubox itself, the end result is a lot nicer look...and alot easier to read on psp. now if only we can convince wololo that "spades" is alot like a lava lamp, cool at first, but *extremely* dated. the menu box should have a much slicker look, maybe rounded corners instead and lose the street light poles?

minor fix for phaseaction, becuase of the nature of this ability finding a happy safe medium without losing function is tough. hopefully this corrects it for good.

dropped cast methods menutext returns to lower case, for uniformity.
2011-04-22 11:17:20 +00:00
wrenczes@gmail.com
76cba56a1c Resuming on my threading support work with the card caching mechanism. This change unfortunately touches quite a few files, but I needed to get it out of the way before things got out of hand: one significant hurdle is the assumed lifetime of a JQuad pointer. In a single threaded model, the life time of the pointer is clear: you fetch it into the cache, the cache makes room, you use the pointer immediately. In a multithreaded context however, it's unsafe, as the drawing thread can request a few JQuads, and the cache operating on a separate thread can potentially bounce a JQuad out of the cache before the draw routine is done using it, which ends up in an access violation when you attempt to draw using an invalidated quad pointer. To prevent this, the bulk of this change swaps out the use of naked JQuad* pointers in the code with a JQuadPtr, which is basically a typedef to a boost shared_ptr<JQuad>.
This btw points out another circular dependancy between the texture and the JQuad - a texture owns a bunch of JQuads, yet the renderer uses JQuads and always assumes that the texture is valid.  We're going to need to add more defensiveness to JGE to protect against this.

Other changes in this check-in:  WResourceManager doesn't derive from JResourceManager anymore.  It actually didn't require anything from the base, so I killed the dependency.  Also cleaned up the notion of a WTrackedQuad in the WCachedResource - it didn't need a separate class, just a better container.

I've build this & tested against PSP, win, linux, QT (linux).  I haven't tried against iOS and QT Win, or Maemo.  If these other platforms are broken, I apologize in advance! - I'm hoping it should be fairly simple to put them back into play.
2011-02-01 10:37:21 +00:00
Xawotihs
e0823b82c4 Fix for issue 568. It was a hard one, it probably happened more
frequently with the touch/mouse interface, but this bug potentially
affected all the platforms.
2011-01-08 18:26:22 +00:00
wagic.the.homebrew@gmail.com
6ea7eb2b87 Erwan
- fix for issue 292 . This fixes the classical theme, which had been broken by the initial fix for the final Saga glitch
2010-12-11 16:00:59 +00:00
wrenczes@gmail.com
92bbb78ed1 Fix for [PSP|PC]ability menus and card view switch causes a crash. This broke as a side effect to the addition of the 'details' option that Mike added - the ActionStack had very rigid interpretations of what a valid control ID would be (either -1, or a valid id in its container). As kInfoMenuID is assigned a value of -200, this would crash when attempting to look up that index value in the vector.
I've patched the problem so that ActionLayer checks for a valid ID before doing anything, and does a no-op for IDs it doesn't know how to handle. However, this only fixes the problem during gameplay.  It's quite possible that hitting the triangle button in other places in the app might equally cause a crash.


Issue: 544
2010-12-04 04:25:43 +00:00
wrenczes@gmail.com
65e38b0694 Another change that looks bigger than it is: changed out the global extern WResourceManager to a real singleton. This means that it's no longer being init'ed at static initialization time, and we can debug construction/destruction properly; it's also safer in a multithreaded context. 2010-12-01 08:22:17 +00:00
techdragon.nguyen@gmail.com
3205ebdc8b minor formatting issue 2010-11-28 22:14:20 +00:00
techdragon.nguyen@gmail.com
f684795810 refactored menu classes
fixed some layout issues with detailed info popup
changed requirements for detailed info popup button to be determined by the number of wins aginst AI deck instead of just the number of games.
2010-11-19 04:19:03 +00:00
techdragon.nguyen@gmail.com
acd7bb1aa4 reformatting code according to guidelines defined at
http://wololo.net/forum/viewtopic.php?f=35&t=2235&start=10
2010-11-16 00:55:16 +00:00
techdragon.nguyen@gmail.com
286d18847b code cleanup: removed dead code/ unused variables. 2010-11-09 12:19:17 +00:00
wrenczes@gmail.com
471cbd6ba4 More type conversion warning cleanup. 2010-11-07 12:09:04 +00:00
techdragon.nguyen@gmail.com
8908e86857 removed some compiler warnings
changed variables to float where appropriate
2010-11-05 08:07:50 +00:00
techdragon.nguyen@gmail.com
2d9c2b3341 removed extra "." from TextScroller text as reported in forums
following up on wrenczes cleanup,
   changing ints to floats
   fixing calculations such as ( 16.0 / <some float>) to ( 16.0f / <some float>) to remove compiler warnings.
2010-11-04 09:18:12 +00:00
wrenczes
d5f3e4cfea Enabled precompiled headers for the build. This cuts the win compile time in debug by at least half on my laptop; on the psp compile, it shaves it down by ~ 45 seconds. I only did a cursory inspection of what to add to PrecompiledHeader.h, there's probably more that we can throw in there for more incremental speed improvements.
Also fixed the project includes so that we don't need to always use the indirect include path, ie:
#include "../include/foo.h" -> #include "foo.h"

I'm don't know much about make files - if I busted the linux build, mea culpa, but I think we're okay on that front too.  For future reference, here's the most straightforward link on the topic of adding pch support to make files:

http://www.mercs-eng.com/~hulud/index.php?2008/06/13/6-writing-a-good-makefile-for-a-c-project
2010-10-24 05:55:24 +00:00
wrenczes@gmail.com
5aa3dc6fd3 Refactoring of some of the font management in WResourceManager. This change looks bigger than it actually is - most of the touched files are simply renaming of some font enums that I moved out of MTGDefinitions into the resource manager header files. The main points of this change: collapsing the font containers into a single map, eliminating duplicated functions, and migrating the font building logic into the resource manager class. GameApp doesn't need to know anything about the fonts it uses, and likewise, font users don't need to know what the name of their chosen font is, just the FONT_TYPE enum.
(I did a cursory check to make sure chinese still displays correctly - at a glance, I'm seeing what looks correct to someone who doesn't read the language :) )
2010-10-19 07:51:32 +00:00
wrenczes@gmail.com
a7ffe4990b Cleaned up the SimpleMenu drawing routines. I was seeing intermittently weird edge lines on the spades of the menu system, as well as gaps. The code was doing a lot of hacky +/- of arbitrary pixel values for the positioning, so I fixed it up to do everything relative to the widths of the pole & the actual spade graphic's size. Also cleaned up the pngs themselves, as they had no need for a transparent pixel rim.
Also moved some static value definitions used in the drawing code from the class header to a private namespace in the cpp file, as they don't need to be seen by any clients of the class.
2010-10-17 00:20:25 +00:00
wagic.the.homebrew@gmail.com
f40af0b1cb Erwan
- Chinese patch by linshier
2010-07-31 14:41:04 +00:00
jean.chalard
e7a1c96d4a J :
* Remove annoying debug printf's.
2010-03-07 13:49:11 +00:00
jean.chalard
76e373f64e J :
* Fix issue 378, where the particles would not appear upon the second
  opening of an existing menu.
* Fix for one of the issues of issue 380, where the selectionY
  attribute would be used uninitialized - reported by valgrind as
  an access to an uninitialized value in sinf and cosf.
2010-03-07 09:28:53 +00:00