Merge pull request #768 from kevlahnota/master
Some changes on Deck Editor & Others
This commit is contained in:
BIN
projects/mtg/bin/Res/graphics/bgdeckeditor.jpg
Normal file
BIN
projects/mtg/bin/Res/graphics/bgdeckeditor.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
BIN
projects/mtg/bin/Res/graphics/menubgdeckeditor.jpg
Normal file
BIN
projects/mtg/bin/Res/graphics/menubgdeckeditor.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 60 KiB |
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
@@ -334,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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user