Incremental fix on my Navigator work - switched out global to JGE vars actualWidth/Height to be real accessible members of the JRenderer instance, so that we can actually access what the real display width is from within the MTG project. This makes the fix for enchantment zone targetting work when the window is resized on Win32.
This commit is contained in:
@@ -56,11 +56,12 @@ class GuiHandOpponent : public GuiHand
|
||||
class GuiHandSelf : public GuiHand
|
||||
{
|
||||
protected:
|
||||
enum
|
||||
typedef enum
|
||||
{
|
||||
Open,
|
||||
Closed
|
||||
} state;
|
||||
} HandState;
|
||||
HandState state;
|
||||
Pos backpos;
|
||||
|
||||
public:
|
||||
@@ -75,6 +76,11 @@ class GuiHandSelf : public GuiHand
|
||||
void Update(float dt);
|
||||
float LeftBoundary();
|
||||
|
||||
HandState GetState()
|
||||
{
|
||||
return state;
|
||||
};
|
||||
|
||||
HandLimitor* limitor;
|
||||
};
|
||||
|
||||
|
||||
@@ -718,7 +718,7 @@ int Navigator::CardToCardZone(PlayGuiObject* inCard)
|
||||
// isAI = card->getCard()->target->owner->isAI();
|
||||
// nasty hack: the lines above don't always work, as when an enchantment comes into play, its ability hasn't been activated yet,
|
||||
// so it doesn't yet have a target. Instead, we now look at the card's position, if it's in the top half of the screen, it goes into an AI zone
|
||||
isAI = card->y < SCREEN_HEIGHT / 2;
|
||||
isAI = card->y < JRenderer::GetInstance()->GetActualHeight() / 2;
|
||||
|
||||
// enchantments that target creatures are treated as part of the creature zone
|
||||
if (card->getCard()->spellTargetType.find("creature") != string::npos)
|
||||
|
||||
@@ -741,6 +741,10 @@
|
||||
RelativePath=".\src\MTGRules.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\Navigator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\src\OptionItem.cpp"
|
||||
>
|
||||
@@ -1198,6 +1202,10 @@
|
||||
RelativePath=".\include\MTGRules.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\Navigator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\OptionItem.h"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user