BIN
projects/mtg/bin/Res/graphics/bgdeckeditor.jpg
Normal file
|
After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 17 KiB |
BIN
projects/mtg/bin/Res/graphics/fakebar.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
projects/mtg/bin/Res/graphics/menubgdeckeditor.jpg
Normal file
|
After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 60 KiB |
@@ -2633,6 +2633,11 @@ public:
|
||||
{
|
||||
if(!nonstatic)
|
||||
return;
|
||||
if(source->isToken && !source->isInPlay(game) && cda)
|
||||
{
|
||||
this->forceDestroy = 1;
|
||||
return;
|
||||
}
|
||||
if(!cda || (cda && (((MTGCardInstance *) target)->isSettingBase < 1)))
|
||||
{
|
||||
if(((MTGCardInstance *) target)->isSwitchedPT)
|
||||
|
||||
@@ -71,7 +71,7 @@ private:
|
||||
DeckViewerStages mStage;
|
||||
JMusic * bgMusic;
|
||||
|
||||
InteractiveButton *toggleDeckButton, *sellCardButton, *statsPrevButton, *filterButton, *toggleViewButton;
|
||||
InteractiveButton *toggleDeckButton, *sellCardButton, *statsPrevButton, *filterButton, *toggleViewButton, *toggleUpButton, *toggleDownButton, *toggleLeftButton, *toggleRightButton;
|
||||
|
||||
WGuiFilters * filterMenu;
|
||||
WSrcDeckViewer * source;
|
||||
|
||||
@@ -29,6 +29,10 @@ const int kPrevStatsButtonId = 10006;
|
||||
const int kCycleCardsButtonId = 10007;
|
||||
const int kShowCardListButtonId = 10008;
|
||||
const int kSwitchViewButton = 10009;
|
||||
const int kToggleUpButton = 10010;
|
||||
const int kToggleDownButton = 10011;
|
||||
const int kToggleLeftButton = 10012;
|
||||
const int kToggleRightButton = 10013;
|
||||
|
||||
class InteractiveButton: public SimpleButton
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "JLogger.h"
|
||||
#include <sstream>
|
||||
|
||||
#ifdef PSP
|
||||
#if defined (PSP)
|
||||
#define HUGE_CACHE_LIMIT 28000000 // Size of the cache for PSP (in bytes) - old value is 20mb increased to 28mb
|
||||
#else
|
||||
#define HUGE_CACHE_LIMIT 60000000 // Size of the cache for Windows and Linux (in bytes) - old value is 20mb increased to 60mb
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "CarouselDeckView.h"
|
||||
|
||||
const float CarouselDeckView::max_scale = 0.96f;
|
||||
const float CarouselDeckView::max_scale = 0.82f;
|
||||
const float CarouselDeckView::x_center = 180;
|
||||
const float CarouselDeckView::right_border = SCREEN_WIDTH + 180;
|
||||
const float CarouselDeckView::slide_animation_duration = 0.6f;
|
||||
@@ -70,7 +70,7 @@ void CarouselDeckView::UpdateCardPosition(int index)
|
||||
rep.x = x_center + cos((rotation) * M_PI / 12) * (right_border - x_center);
|
||||
rep.scale = max_scale / 1.12f * cos((rep.x - x_center) * 1.5f / (right_border - x_center)) + 0.2f * max_scale * cos(
|
||||
cos((rep.x - x_center) * 0.15f / (right_border - x_center)));
|
||||
rep.y = (SCREEN_HEIGHT_F) / 2.0f + SCREEN_HEIGHT_F * mSlideOffset * (rep.scale + 0.2f);
|
||||
rep.y = (SCREEN_HEIGHT_F) / 2.1f + SCREEN_HEIGHT_F * mSlideOffset * (rep.scale + 0.2f);
|
||||
}
|
||||
|
||||
void CarouselDeckView::Reset()
|
||||
|
||||
@@ -505,6 +505,12 @@ void Credits::Render()
|
||||
if (!p1)
|
||||
return;
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}
|
||||
WFont * f = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
WFont * f2 = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
|
||||
WFont * f3 = WResourceManager::Instance()->GetWFont(Fonts::MAGIC_FONT);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
DeckEditorMenu::DeckEditorMenu(int id, JGuiListener* listener, int fontId, const string& _title, DeckDataWrapper *_selectedDeck, StatsWrapper *stats) :
|
||||
DeckMenu(id, listener, fontId, _title), selectedDeck(_selectedDeck), stw(stats)
|
||||
{
|
||||
backgroundName = "DeckEditorMenuBackdrop";
|
||||
backgroundName = "menubgdeckeditor";
|
||||
mShowDetailsScreen = false;
|
||||
deckTitle = selectedDeck ? selectedDeck->parent->meta_name : "";
|
||||
|
||||
@@ -18,8 +18,17 @@ DeckEditorMenu::DeckEditorMenu(int id, JGuiListener* listener, int fontId, const
|
||||
mY = 70;
|
||||
starsOffsetX = 50;
|
||||
|
||||
titleX = 110; // center point in title box
|
||||
titleY = 25;
|
||||
//titleX = 110; // center point in title box
|
||||
if(selectedDeck)
|
||||
{
|
||||
titleX = (SCREEN_WIDTH_F/2.f);
|
||||
titleY = 13;
|
||||
}
|
||||
else
|
||||
{
|
||||
titleX = SCREEN_WIDTH_F/6.5f; // center point in title box
|
||||
titleY = 25;
|
||||
}
|
||||
titleWidth = 180; // width of inner box of title
|
||||
|
||||
descX = 275;
|
||||
@@ -44,7 +53,7 @@ DeckEditorMenu::DeckEditorMenu(int id, JGuiListener* listener, int fontId, const
|
||||
void DeckEditorMenu::Render()
|
||||
{
|
||||
JRenderer *r = JRenderer::GetInstance();
|
||||
r->FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, ARGB(200,0,0,0));
|
||||
r->FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, ARGB(200,0,0,0));//bg??
|
||||
|
||||
DeckMenu::Render();
|
||||
if (deckTitle.size() > 0)
|
||||
@@ -52,7 +61,7 @@ void DeckEditorMenu::Render()
|
||||
WFont *mainFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||
DWORD currentColor = mainFont->GetColor();
|
||||
mainFont->SetColor(ARGB(255,255,255,255));
|
||||
mainFont->DrawString(deckTitle.c_str(), statsX + (statsWidth / 2), statsHeight / 2, JGETEXT_CENTER);
|
||||
mainFont->DrawString(deckTitle.c_str(), (SCREEN_WIDTH_F / 2)-15, (statsHeight / 2)+4, JGETEXT_CENTER);
|
||||
mainFont->SetColor(currentColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,10 @@ void DeckMenu::RenderDeckManaColors()
|
||||
void DeckMenu::RenderBackground()
|
||||
{
|
||||
ostringstream bgFilename;
|
||||
bgFilename << backgroundName << ".png";
|
||||
if(backgroundName == "menubgdeckeditor")
|
||||
bgFilename << backgroundName << ".jpg";
|
||||
else
|
||||
bgFilename << backgroundName << ".png";
|
||||
|
||||
static bool loadBackground = true;
|
||||
if (loadBackground)
|
||||
@@ -248,7 +251,11 @@ void DeckMenu::Render()
|
||||
modAvatarX =26.f;
|
||||
modAvatarY =1.f;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
modAvatarX =-76.f;
|
||||
modAvatarY =-1.5f;
|
||||
}
|
||||
if (!menuInitialized)
|
||||
{
|
||||
initMenuItems();
|
||||
@@ -259,6 +266,7 @@ void DeckMenu::Render()
|
||||
if (avatarholder.get() && menupanel.get() && inDeckMenu)//bg panel
|
||||
renderer->RenderQuad(menupanel.get(), 225.f, 0, 0 ,SCREEN_WIDTH_F / avatarholder.get()->mWidth, SCREEN_HEIGHT_F / avatarholder.get()->mHeight);
|
||||
RenderBackground();//background deck menu
|
||||
mScroller->Render();
|
||||
if (menuholder.get() && inDeckMenu)//menuholder
|
||||
renderer->RenderQuad(menuholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / menuholder.get()->mWidth, SCREEN_HEIGHT_F / menuholder.get()->mHeight);
|
||||
|
||||
@@ -333,7 +341,10 @@ void DeckMenu::Render()
|
||||
oss << _("Deck: ") << currentMenuItem->getDeckName() << endl;
|
||||
oss << currentMenuItem->getDeckStatsSummary();
|
||||
descriptionFont->SetColor(ARGB(255,255,255,255));
|
||||
descriptionFont->DrawString(oss.str(), statsX+2, statsY-2);
|
||||
if(inDeckMenu)
|
||||
descriptionFont->DrawString(oss.str(), statsX+2, statsY-2);
|
||||
else
|
||||
descriptionFont->DrawString(oss.str(), statsX-86, statsY-4);
|
||||
}
|
||||
|
||||
// change the font color of the current menu item
|
||||
@@ -345,7 +356,6 @@ void DeckMenu::Render()
|
||||
}
|
||||
}
|
||||
|
||||
mScroller->Render();
|
||||
RenderDeckManaColors();
|
||||
|
||||
if (!title.empty())
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include "GameOptions.h"
|
||||
#include "CardGui.h"
|
||||
#include "CardDescriptor.h"
|
||||
|
||||
const float DeckView::no_user_activity_show_card_delay = 0.1f;
|
||||
|
||||
@@ -143,14 +144,23 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{//NORMAL VIEW WITH IMAGES
|
||||
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
|
||||
|
||||
//border for editor && others???
|
||||
string cardsetname = setlist[cardPosition.card->setId].c_str();
|
||||
if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM")
|
||||
{
|
||||
JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,248,248,255));
|
||||
JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(150,20,20,20));
|
||||
}
|
||||
else
|
||||
{
|
||||
JRenderer::GetInstance()->FillRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(255,10,10,10));
|
||||
JRenderer::GetInstance()->DrawRoundRect((cardPosition.x - cardPosition.scale * 100.0f)-5.f,(cardPosition.y - cardPosition.scale * 142.5f)-5.f,cardPosition.scale * 200.0f,cardPosition.scale * 285.0f,5.f,ARGB(50,240,240,240));
|
||||
}
|
||||
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
|
||||
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true);
|
||||
}
|
||||
//the three DrawCard function above, I intentionally disabled the rendered border when in Deck Editor since the border must be dynamically resized
|
||||
//we can pass variables so the DrawCard method knows what to do to the border but... there must be a better way to do it...
|
||||
int quadAlpha = alpha;
|
||||
if (!deck()->count(cardPosition.card)) quadAlpha /= 2;
|
||||
quadAlpha = 255 - quadAlpha;
|
||||
@@ -167,12 +177,15 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail)
|
||||
char buffer[4096];
|
||||
sprintf(buffer, "x%i", deck()->count(cardPosition.card));
|
||||
WFont * font = mFont;
|
||||
font->SetScale(1.4f);
|
||||
font->SetColor(ARGB(fontAlpha/2,0,0,0));
|
||||
JRenderer::GetInstance()->FillRect(qtX, qtY, font->GetStringWidth(buffer) + 6, 16, ARGB(fontAlpha/2,0,0,0));
|
||||
font->DrawString(buffer, qtX + 4, qtY + 4);
|
||||
JRenderer::GetInstance()->FillRect(qtX, qtY, font->GetStringWidth(buffer) + 6, 18, ARGB(fontAlpha/2,0,0,0));
|
||||
JRenderer::GetInstance()->DrawRect(qtX, qtY, font->GetStringWidth(buffer) + 6, 18, ARGB(fontAlpha/2,240,240,240));
|
||||
font->DrawString(buffer, qtX + 5, qtY + 3);
|
||||
font->SetColor(ARGB(fontAlpha,255,255,255));
|
||||
font->DrawString(buffer, qtX + 2, qtY + 2);
|
||||
font->DrawString(buffer, qtX + 4, qtY + 2);
|
||||
font->SetColor(ARGB(255,255,255,255));
|
||||
font->SetScale(1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,12 +44,16 @@ GameStateDeckViewer::GameStateDeckViewer(GameApp* parent) :
|
||||
deckMenu = NULL;
|
||||
mStatsWrapper = NULL;
|
||||
|
||||
statsPrevButton = NEW InteractiveButton(NULL, kPrevStatsButtonId, Fonts::MAIN_FONT, "Stats", SCREEN_WIDTH_F - 50, SCREEN_HEIGHT_F - 20, JGE_BTN_PREV);
|
||||
statsPrevButton = NEW InteractiveButton(NULL, kPrevStatsButtonId, Fonts::MAIN_FONT, "Stats", SCREEN_WIDTH_F - 35, SCREEN_HEIGHT_F - 20, JGE_BTN_PREV);
|
||||
toggleDeckButton = NEW InteractiveButton(NULL, kToggleDeckActionId, Fonts::MAIN_FONT, "View Deck", 10, SCREEN_HEIGHT_F - 20, JGE_BTN_PRI);
|
||||
sellCardButton = NEW InteractiveButton(NULL, kSellCardActionId, Fonts::MAIN_FONT, "Sell Card", (SCREEN_WIDTH_F/ 2) - 100, SCREEN_HEIGHT_F - 20, JGE_BTN_SEC);
|
||||
filterButton = NEW InteractiveButton(NULL, kFilterButtonId, Fonts::MAIN_FONT, "filter", (SCREEN_WIDTH_F - 110), SCREEN_HEIGHT_F - 20, JGE_BTN_CTRL);
|
||||
filterButton = NEW InteractiveButton(NULL, kFilterButtonId, Fonts::MAIN_FONT, "Filter", (SCREEN_WIDTH_F - 116), SCREEN_HEIGHT_F - 20, JGE_BTN_CTRL);
|
||||
//TODO: Check if that button is available:
|
||||
toggleViewButton = NEW InteractiveButton(NULL, kSwitchViewButton, Fonts::MAIN_FONT, "Grid", (SCREEN_WIDTH_F/ 2) + 50, SCREEN_HEIGHT_F - 20, JGE_BTN_MAX);
|
||||
toggleUpButton = NEW InteractiveButton(NULL, kToggleUpButton, Fonts::MAIN_FONT, "UP", 10, 25, JGE_BTN_DOWN);
|
||||
toggleDownButton = NEW InteractiveButton(NULL, kToggleDownButton, Fonts::MAIN_FONT, "DN", SCREEN_WIDTH_F-25, 25, JGE_BTN_UP);
|
||||
toggleLeftButton = NEW InteractiveButton(NULL, kToggleLeftButton, Fonts::MAIN_FONT, "<<", 10, SCREEN_HEIGHT_F/2, JGE_BTN_RIGHT);
|
||||
toggleRightButton = NEW InteractiveButton(NULL, kToggleRightButton, Fonts::MAIN_FONT, ">>", SCREEN_WIDTH_F-20, SCREEN_HEIGHT_F/2, JGE_BTN_LEFT);
|
||||
}
|
||||
|
||||
GameStateDeckViewer::~GameStateDeckViewer()
|
||||
@@ -61,6 +65,10 @@ GameStateDeckViewer::~GameStateDeckViewer()
|
||||
SAFE_DELETE(filterButton);
|
||||
SAFE_DELETE(toggleViewButton);
|
||||
SAFE_DELETE(mView);
|
||||
SAFE_DELETE(toggleUpButton);
|
||||
SAFE_DELETE(toggleDownButton);
|
||||
SAFE_DELETE(toggleLeftButton);
|
||||
SAFE_DELETE(toggleRightButton);
|
||||
|
||||
if (myDeck)
|
||||
{
|
||||
@@ -143,11 +151,11 @@ void GameStateDeckViewer::buildEditorMenu()
|
||||
deckMenu = NEW DeckEditorMenu(MENU_DECK_BUILDER, this, Fonts::OPTION_FONT, "Deck Editor", myDeck, mStatsWrapper);
|
||||
|
||||
deckMenu->Add(MENU_ITEM_FILTER_BY, _("Filter By..."), _("Narrow down the list of cards. "));
|
||||
deckMenu->Add(MENU_ITEM_SWITCH_DECKS_NO_SAVE, _("Switch Decks"), _("Do not make any changes. View another deck."));
|
||||
deckMenu->Add(MENU_ITEM_SWITCH_DECKS_NO_SAVE, _("Switch Decks"), _("No changes. View another deck."));
|
||||
deckMenu->Add(MENU_ITEM_SAVE_RENAME, _("Rename Deck"), _("Change the name of the deck"));
|
||||
deckMenu->Add(MENU_ITEM_SAVE_RETURN_MAIN_MENU, _("Save & Quit Editor"), _("Save changes. Return to the main menu"));
|
||||
deckMenu->Add(MENU_ITEM_SAVE_AS_AI_DECK, _("Save As AI Deck"), _("All changes are final."));
|
||||
deckMenu->Add(MENU_ITEM_MAIN_MENU, _("Quit Editor"), _("Do not make any changes to deck. Return to the main menu."));
|
||||
deckMenu->Add(MENU_ITEM_MAIN_MENU, _("Quit Editor"), _("No changes. Return to the main menu."));
|
||||
deckMenu->Add(MENU_ITEM_EDITOR_CANCEL, _("Cancel"), _("Close menu."));
|
||||
}
|
||||
|
||||
@@ -309,6 +317,10 @@ bool GameStateDeckViewer::userPressedButton()
|
||||
|| (statsPrevButton->ButtonPressed())
|
||||
|| (filterButton->ButtonPressed())
|
||||
|| (toggleViewButton->ButtonPressed())
|
||||
|| (toggleUpButton->ButtonPressed())
|
||||
|| (toggleDownButton->ButtonPressed())
|
||||
|| (toggleLeftButton->ButtonPressed())
|
||||
|| (toggleRightButton->ButtonPressed())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -319,7 +331,10 @@ void GameStateDeckViewer::setButtonState(bool state)
|
||||
statsPrevButton->setIsSelectionValid(state);
|
||||
filterButton->setIsSelectionValid(state);
|
||||
toggleViewButton->setIsSelectionValid(state);
|
||||
|
||||
toggleUpButton->setIsSelectionValid(state);
|
||||
toggleDownButton->setIsSelectionValid(state);
|
||||
toggleLeftButton->setIsSelectionValid(state);
|
||||
toggleRightButton->setIsSelectionValid(state);
|
||||
}
|
||||
|
||||
void GameStateDeckViewer::RenderButtons()
|
||||
@@ -329,6 +344,10 @@ void GameStateDeckViewer::RenderButtons()
|
||||
filterButton->Render();
|
||||
statsPrevButton->Render();
|
||||
toggleViewButton->Render();
|
||||
toggleUpButton->Render();
|
||||
toggleDownButton->Render();
|
||||
toggleLeftButton->Render();
|
||||
toggleRightButton->Render();
|
||||
}
|
||||
|
||||
void GameStateDeckViewer::setupView(GameStateDeckViewer::AvailableView view, DeckDataWrapper *deck)
|
||||
@@ -596,19 +615,20 @@ void GameStateDeckViewer::renderSlideBar()
|
||||
int total = mView->deck()->Size();
|
||||
if (total == 0) return;
|
||||
|
||||
float filler = 15;
|
||||
float y = SCREEN_HEIGHT_F - 25;
|
||||
float filler = 25;
|
||||
float y = SCREEN_HEIGHT_F - 30;
|
||||
float bar_size = SCREEN_WIDTH_F - 2 * filler;
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
int currentPos = mView->getPosition();
|
||||
|
||||
float cursor_pos = bar_size * currentPos / total;
|
||||
|
||||
r->FillRoundRect(filler + 5, y + 5, bar_size, 0, 3, ARGB(hudAlpha/2,0,0,0));
|
||||
r->DrawLine(filler + cursor_pos + 5, y + 5, filler + cursor_pos + 5, y + 10, ARGB(hudAlpha/2,0,0,0));
|
||||
//r->FillRoundRect(filler + 5, y + 5, bar_size, 0, 4, ARGB(hudAlpha/2,0,0,0));
|
||||
//r->DrawLine(filler + cursor_pos + 5, y + 5, filler + cursor_pos + 5, y + 10, ARGB(hudAlpha/2,0,0,0));
|
||||
|
||||
r->FillRoundRect(filler, y, bar_size, 0, 3, ARGB(hudAlpha/2,128,128,128));
|
||||
r->DrawLine(filler + cursor_pos, y, filler + cursor_pos, y + 5, ARGB(hudAlpha,255,255,255));
|
||||
r->FillRoundRect(filler, y, bar_size, 0, 4, ARGB(hudAlpha/2,128,128,128));
|
||||
r->DrawRoundRect(filler, y, bar_size, 0, 4, ARGB(hudAlpha/2,0,0,0));
|
||||
r->DrawLine(filler + cursor_pos, y, filler + cursor_pos, y + 8, ARGB(hudAlpha,0,255,0));
|
||||
char buffer[256];
|
||||
string deckname = _("Collection");
|
||||
if (mView->deck() == myDeck)
|
||||
@@ -617,7 +637,7 @@ void GameStateDeckViewer::renderSlideBar()
|
||||
}
|
||||
sprintf(buffer, "%s - %i/%i", deckname.c_str(), currentPos, total);
|
||||
mFont->SetColor(ARGB(hudAlpha,255,255,255));
|
||||
mFont->DrawString(buffer, SCREEN_WIDTH / 2, y, JGETEXT_CENTER);
|
||||
mFont->DrawString(buffer, SCREEN_WIDTH / 2, y-2, JGETEXT_CENTER);
|
||||
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
}
|
||||
@@ -1265,8 +1285,14 @@ void GameStateDeckViewer::Render()
|
||||
setButtonState(false);
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}/*
|
||||
if (mView->deck() == myDeck && mStage != STAGE_MENU)
|
||||
renderDeckBackground();
|
||||
renderDeckBackground();*/
|
||||
|
||||
mView->Render();
|
||||
|
||||
|
||||
@@ -1037,7 +1037,12 @@ void GameStateDuel::Render()
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
JRenderer * r = JRenderer::GetInstance();
|
||||
r->ClearScreen(ARGB(0,0,0,0));
|
||||
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}
|
||||
//render the game until someone did win the game (otherwise it crashes sometimes under linux)
|
||||
if (game && !game->didWin())
|
||||
game->Render();
|
||||
|
||||
@@ -117,7 +117,7 @@ void GameStateMenu::Create()
|
||||
{
|
||||
currentState = MENU_STATE_MAJOR_LANG | MENU_STATE_MINOR_NONE;
|
||||
}
|
||||
scroller = NEW TextScroller(Fonts::MAIN_FONT, SCREEN_WIDTH / 2 - 90, SCREEN_HEIGHT - 17, 180);
|
||||
scroller = NEW TextScroller(Fonts::MAIN_FONT, SCREEN_WIDTH / 2 + 65, 5, 180);
|
||||
scrollerSet = 0;
|
||||
splashTex = NULL;
|
||||
|
||||
@@ -153,7 +153,7 @@ void GameStateMenu::Start()
|
||||
mBg = WResourceManager::Instance()->RetrieveQuad("menutitle.png", 0, 0, 0, 0); // Create background quad for rendering.
|
||||
|
||||
if (mBg)
|
||||
mBg->SetHotSpot(0, 0);
|
||||
mBg->SetHotSpot(mBg->mWidth/2, 0);
|
||||
|
||||
if (MENU_STATE_MAJOR_MAINMENU == currentState)
|
||||
currentState = currentState | MENU_STATE_MINOR_FADEIN;
|
||||
@@ -445,9 +445,11 @@ void GameStateMenu::ensureMGuiController()
|
||||
(i == 0)));
|
||||
}
|
||||
|
||||
JQuadPtr jq = WResourceManager::Instance()->RetrieveTempQuad("button_shoulder.png");
|
||||
JQuadPtr jq = WResourceManager::Instance()->RetrieveTempQuad("button_shoulder.png");//I set this transparent, don't remove button_shoulder.png
|
||||
if (!jq.get()) return;
|
||||
jq->SetHFlip(false);
|
||||
jq->mWidth = 64.f;
|
||||
jq->mHeight = 32.f;
|
||||
jq->SetColor(ARGB(abs(255),255,255,255));
|
||||
mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||
vector<ModRulesOtherMenuItem *>otherItems = gModRules.menu.other;
|
||||
@@ -455,7 +457,7 @@ void GameStateMenu::ensureMGuiController()
|
||||
mGuiController->Add(NEW OtherMenuItem(
|
||||
otherItems[0]->mActionId,
|
||||
mFont, otherItems[0]->mDisplayName,
|
||||
SCREEN_WIDTH - 64, 2,
|
||||
SCREEN_WIDTH - 64, SCREEN_HEIGHT_F-26.f,
|
||||
jq.get(), jq.get(), otherItems[0]->mKey, false
|
||||
));
|
||||
}
|
||||
@@ -733,8 +735,21 @@ void GameStateMenu::RenderTopMenu()
|
||||
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||
mFont->SetColor(ARGB(128,255,255,255));
|
||||
mFont->DrawString(GAME_VERSION, rightTextPos, 5, JGETEXT_RIGHT);
|
||||
//mFont->SetColor(ARGB(128,255,255,255));
|
||||
mFont->SetColor(ARGB(220,255,255,255));
|
||||
/*//tooltip
|
||||
JQuadPtr tooltips;
|
||||
tooltips = WResourceManager::Instance()->RetrieveTempQuad("tooltips.png");//new graphics tooltips
|
||||
if (tooltips.get())
|
||||
{
|
||||
float xscale = (mFont->GetStringWidth(GAME_VERSION)+(mFont->GetStringWidth(GAME_VERSION)/18)) / tooltips->mWidth;
|
||||
float yscale = mFont->GetHeight() / tooltips->mHeight;
|
||||
tooltips->SetHotSpot(tooltips->mWidth / 2,0);
|
||||
JRenderer::GetInstance()->RenderQuad(tooltips.get(), SCREEN_WIDTH_F/2, SCREEN_HEIGHT_F-17,0,xscale,yscale);
|
||||
}
|
||||
//end tooltip*/
|
||||
mFont->DrawString(GAME_VERSION, (SCREEN_WIDTH_F/2) - (mFont->GetStringWidth(GAME_VERSION))/2, SCREEN_HEIGHT_F-17, JGETEXT_LEFT);
|
||||
mFont->SetColor(ARGB(128,255,255,255));//reset color
|
||||
mFont->DrawString(GameApp::mynbcardsStr, leftTextPos, 5);
|
||||
renderer->FillRect(leftTextPos, 26, 104, 8, ARGB(255, 100, 90, 60));
|
||||
renderer->FillRect(leftTextPos + 2, 28, (float)(gamePercentComplete()), 4, ARGB(255,220,200, 125));
|
||||
@@ -815,7 +830,7 @@ void GameStateMenu::Render()
|
||||
scroller->Render();
|
||||
|
||||
if (mBg.get())
|
||||
renderer->RenderQuad(mBg.get(), (SCREEN_WIDTH/4)-6, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight);
|
||||
renderer->RenderQuad(mBg.get(), SCREEN_WIDTH_F/2, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight);
|
||||
|
||||
RenderTopMenu();
|
||||
|
||||
|
||||
@@ -214,7 +214,12 @@ void GameStateOptions::Render()
|
||||
{
|
||||
//Erase
|
||||
JRenderer::GetInstance()->ClearScreen(ARGB(0,0,0,0));
|
||||
|
||||
JTexture * wpTex = WResourceManager::Instance()->RetrieveTexture("bgdeckeditor.jpg");
|
||||
if (wpTex)
|
||||
{
|
||||
JQuadPtr wpQuad = WResourceManager::Instance()->RetrieveTempQuad("bgdeckeditor.jpg");
|
||||
JRenderer::GetInstance()->RenderQuad(wpQuad.get(), 0, 0, 0, SCREEN_WIDTH_F / wpQuad->mWidth, SCREEN_HEIGHT_F / wpQuad->mHeight);
|
||||
}
|
||||
const char * const CreditsText[] = {
|
||||
"Wagic, The Homebrew?! by Wololo",
|
||||
"",
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
const float GridDeckView::scroll_animation_duration = 0.3f;
|
||||
const float GridDeckView::slide_animation_duration = 0.6f;
|
||||
const float GridDeckView::card_scale_small = 0.47f;
|
||||
const float GridDeckView::card_scale_big = 0.6f;
|
||||
//const float GridDeckView::card_scale_small = 0.47f;
|
||||
//const float GridDeckView::card_scale_big = 0.6f;
|
||||
const float GridDeckView::card_scale_small = 0.42f;
|
||||
const float GridDeckView::card_scale_big = 0.52f;
|
||||
|
||||
GridDeckView::GridDeckView()
|
||||
: DeckView(16), mCols(8), mRows(2), mScrollOffset(0), mSlideOffset(0),
|
||||
|
||||
@@ -95,7 +95,7 @@ bool GuiPhaseBar::Leaving(JButton)
|
||||
void GuiPhaseBar::Render()
|
||||
{
|
||||
JQuadPtr quad = WResourceManager::Instance()->GetQuad("phasebar");
|
||||
JQuadPtr phaseinfo = WResourceManager::Instance()->RetrieveTempQuad("phaseinfo.png"); //new phaseinfo graphics
|
||||
JQuadPtr phaseinfo = WResourceManager::Instance()->RetrieveTempQuad("fakebar.png"); //new fakebar graphics
|
||||
//uncomment to draw a hideous line across hires screens.
|
||||
// JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255));
|
||||
|
||||
@@ -151,10 +151,10 @@ void GuiPhaseBar::Render()
|
||||
sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str());
|
||||
if(phaseinfo.get())
|
||||
{
|
||||
phaseinfo->SetHotSpot(phaseinfo->mWidth - 1.f,0);
|
||||
phaseinfo->mWidth = font->GetStringWidth(buf)+12.f;
|
||||
phaseinfo->mHeight = font->GetHeight()+5.f;
|
||||
JRenderer::GetInstance()->RenderQuad(phaseinfo.get(),SCREEN_WIDTH_F,0,0);
|
||||
phaseinfo->SetHotSpot(phaseinfo->mWidth-2.f,0);
|
||||
//phaseinfo->mWidth = font->GetStringWidth(buf)+12.f;
|
||||
//phaseinfo->mHeight = font->GetHeight()+5.f;
|
||||
JRenderer::GetInstance()->RenderQuad(phaseinfo.get(),SCREEN_WIDTH_F,0,0,SCREEN_WIDTH_F / phaseinfo->mWidth, SCREEN_HEIGHT_F / phaseinfo->mHeight);
|
||||
}
|
||||
font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT);
|
||||
}
|
||||
|
||||
@@ -41,15 +41,16 @@ void MenuItem::Render()
|
||||
if (mParticleSys)
|
||||
start = mParticleSys->info.colColorStart.GetHWColor();
|
||||
PIXEL_TYPE colors[] = { ARGB(0,0,0,0), start, ARGB(0,0,0,0), start, };
|
||||
renderer->FillRect(255, 0, SCREEN_WIDTH - 155, SCREEN_HEIGHT, colors);
|
||||
renderer->FillRect(255, 0, SCREEN_WIDTH - 165, SCREEN_HEIGHT, colors);//color on main menu right side
|
||||
// set additive blending
|
||||
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE);
|
||||
mParticleSys->Render();
|
||||
// set normal blending
|
||||
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
||||
mFont->SetColor(ARGB(255,255,255,255));
|
||||
onQuad->SetColor(ARGB(70,255,255,255));
|
||||
renderer->RenderQuad(onQuad, SCREEN_WIDTH, SCREEN_HEIGHT / 2, 0, 8, 8);
|
||||
offQuad->SetColor(ARGB(60,255,255,255));
|
||||
renderer->RenderQuad(offQuad, SCREEN_WIDTH, SCREEN_HEIGHT / 2, 0, 8, 8);//big icon main menu right side
|
||||
offQuad->SetColor(ARGB(255,255,255,255));
|
||||
onQuad->SetColor(ARGB(255,255,255,255));
|
||||
mFont->DrawString(mText.c_str(), SCREEN_WIDTH / 2, 3 * SCREEN_HEIGHT / 4, JGETEXT_CENTER);
|
||||
renderer->RenderQuad(onQuad, mX, mY, 0, mScale, mScale);
|
||||
@@ -88,7 +89,7 @@ void MenuItem::Entering()
|
||||
if (mParticleSys)
|
||||
mParticleSys->Fire();
|
||||
mHasFocus = true;
|
||||
mTargetScale = 1.3f;
|
||||
mTargetScale = 1.2f;
|
||||
}
|
||||
|
||||
bool MenuItem::Leaving(JButton)
|
||||
@@ -138,8 +139,9 @@ void OtherMenuItem::Render()
|
||||
float olds = mFont->GetScale();
|
||||
float xPos = SCREEN_WIDTH - 64;
|
||||
float xTextPos = xPos + 54;
|
||||
float yPos = SCREEN_HEIGHT_F-26.f;
|
||||
int textAlign = JGETEXT_RIGHT;
|
||||
onQuad->SetHFlip(false);
|
||||
//onQuad->SetHFlip(false);
|
||||
|
||||
switch(mKey)
|
||||
{
|
||||
@@ -147,18 +149,30 @@ void OtherMenuItem::Render()
|
||||
xPos = 5;
|
||||
xTextPos = xPos + 10;
|
||||
textAlign = JGETEXT_LEFT;
|
||||
onQuad->SetHFlip(true);
|
||||
//onQuad->SetHFlip(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
onQuad->SetColor(ARGB(abs(alpha),255,255,255));
|
||||
mFont->SetColor(ARGB(abs(alpha),0,0,0));
|
||||
//onQuad->SetColor(ARGB(abs(alpha),255,255,255));
|
||||
mFont->SetScale(1.0f);
|
||||
mFont->SetScale(50.0f / mFont->GetStringWidth(mText.c_str()));
|
||||
JRenderer::GetInstance()->RenderQuad(onQuad, xPos, 2, 0, mScale, mScale);
|
||||
mFont->DrawString(mText, xTextPos, 9, textAlign);
|
||||
//JRenderer::GetInstance()->RenderQuad(onQuad, xPos, yPos+2, 0, mScale, mScale);
|
||||
//JRenderer::GetInstance()->FillRoundRect(xPos,yPos+2,mFont->GetStringWidth(mText.c_str()),mFont->GetHeight(),2,ARGB(abs(alpha),255,255,255));
|
||||
JRenderer::GetInstance()->FillRoundRect(xPos+1, yPos+6, mFont->GetStringWidth(mText.c_str()) - 3, mFont->GetHeight() - 10, 5, ARGB(abs(alpha), 5, 5, 5));
|
||||
if(!mHasFocus)
|
||||
{
|
||||
mFont->SetColor(ARGB(abs(alpha),255,255,255));
|
||||
JRenderer::GetInstance()->FillRoundRect(xPos, yPos+5, mFont->GetStringWidth(mText.c_str()) - 3, mFont->GetHeight() - 10, 5, ARGB(abs(alpha), 140, 23, 23));
|
||||
}
|
||||
else
|
||||
{
|
||||
mFont->SetColor(ARGB(abs(alpha),5,5,5));
|
||||
JRenderer::GetInstance()->FillRoundRect(xPos, yPos+5, mFont->GetStringWidth(mText.c_str()) - 3, mFont->GetHeight() - 10, 5, ARGB(abs(alpha), 140, 140, 140));
|
||||
}
|
||||
JRenderer::GetInstance()->DrawRoundRect(xPos, yPos+5, mFont->GetStringWidth(mText.c_str()) - 3, mFont->GetHeight() - 10, 5, ARGB(abs(alpha-20), 5, 5, 5));
|
||||
mFont->DrawString(mText, xTextPos, yPos+9, textAlign);
|
||||
mFont->SetScale(olds);
|
||||
}
|
||||
|
||||
|
||||
@@ -466,6 +466,7 @@ void OptionTheme::updateValue()
|
||||
void OptionTheme::Render()
|
||||
{
|
||||
JRenderer * renderer = JRenderer::GetInstance();
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||
char buf[512];
|
||||
if (!bChecked)
|
||||
{
|
||||
@@ -493,12 +494,12 @@ void OptionTheme::Render()
|
||||
JQuadPtr q = getImage();
|
||||
if (q)
|
||||
{
|
||||
float scale = 128 / q->mHeight;
|
||||
renderer->RenderQuad(q.get(), x, y, 0, scale, scale);
|
||||
float yscale = 128 / q->mHeight;
|
||||
float xscale = 227 / q->mWidth;
|
||||
renderer->RenderQuad(q.get(), x, y, 0, xscale, yscale);
|
||||
}
|
||||
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
|
||||
mFont->SetColor(getColor(WGuiColor::TEXT_HEADER));
|
||||
renderer->FillRect(x+2, y+2, mFont->GetStringWidth(buf), mFont->GetHeight(),ARGB(220,5,5,5));
|
||||
mFont->DrawString(buf, x + 2, y + 2);
|
||||
if (bChecked && author.size())
|
||||
{
|
||||
@@ -506,6 +507,7 @@ void OptionTheme::Render()
|
||||
mFont->SetScale(0.8f);
|
||||
float hi = mFont->GetHeight();
|
||||
sprintf(buf, _("Artist: %s").c_str(), author.c_str());
|
||||
renderer->FillRect(x+2, y + getHeight() - hi, mFont->GetStringWidth(buf), mFont->GetHeight(),ARGB(220,5,5,5));
|
||||
mFont->DrawString(buf, x + 2, y + getHeight() - hi);
|
||||
mFont->SetScale(1);
|
||||
}
|
||||
|
||||
@@ -66,19 +66,25 @@ void TextScroller::Update(float dt)
|
||||
|
||||
void TextScroller::Render()
|
||||
{
|
||||
|
||||
JQuadPtr fakebar;
|
||||
JTexture * tex = WResourceManager::Instance()->RetrieveTexture("phaseinfo.png");
|
||||
if (tex)
|
||||
{
|
||||
fakebar = WResourceManager::Instance()->RetrieveQuad("phaseinfo.png", 0.0f, 0.0f, tex->mWidth - 3.5f, tex->mHeight - 2.0f); //avoids weird rectangle around the texture because of bilinear filtering
|
||||
}
|
||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||
//tooltip
|
||||
JQuadPtr tooltips;
|
||||
tooltips = WResourceManager::Instance()->RetrieveTempQuad("tooltips.png");//new graphics tooltips
|
||||
if (tooltips.get())
|
||||
mFont->SetColor(ARGB(128,255,255,255));
|
||||
if(fakebar.get())
|
||||
{
|
||||
float xscale = (mWidth+(mWidth/18)) / tooltips->mWidth;
|
||||
float yscale = mFont->GetHeight() / tooltips->mHeight;
|
||||
JRenderer::GetInstance()->RenderQuad(tooltips.get(), mX-4.5f, mY+0.5f,0,xscale,yscale);
|
||||
if(mText.length() > 1)
|
||||
{
|
||||
float xscale = (SCREEN_WIDTH_F/2.6f) / fakebar->mWidth;
|
||||
float yscale = (mFont->GetHeight()+(mFont->GetHeight()/3.5f)) / fakebar->mHeight;
|
||||
fakebar->SetHotSpot(fakebar->mWidth-8.f,0);
|
||||
JRenderer::GetInstance()->RenderQuad(fakebar.get(),SCREEN_WIDTH_F, 4,0,xscale,yscale);
|
||||
}
|
||||
}
|
||||
else
|
||||
JRenderer::GetInstance()->FillRoundRect(mX,mY,mWidth,mFont->GetHeight(), 1, ARGB(225,5,5,5));
|
||||
//end tooltip
|
||||
mFont->DrawString(mText.c_str(), mX, mY, JGETEXT_LEFT, start, mWidth);
|
||||
}
|
||||
|
||||
|
||||