Commit e3264fff authored by Chen Bill's avatar Chen Bill

remove wcscat

parent 26c2446f
...@@ -1274,52 +1274,50 @@ void Game::DrawDeckBd() { ...@@ -1274,52 +1274,50 @@ void Game::DrawDeckBd() {
if(deckBuilder.hovered_pos == 4 && deckBuilder.hovered_seq == (int)i) if(deckBuilder.hovered_pos == 4 && deckBuilder.hovered_seq == (int)i)
driver->draw2DRectangle(0x80000000, Resize(806, 164 + i * 66, 1019, 230 + i * 66)); driver->draw2DRectangle(0x80000000, Resize(806, 164 + i * 66, 1019, 230 + i * 66));
DrawThumb(ptr, position2di(810, 165 + i * 66), deckBuilder.filterList); DrawThumb(ptr, position2di(810, 165 + i * 66), deckBuilder.filterList);
const wchar_t* availBuffer = L"";
if ((ptr->second.ot & AVAIL_OCGTCG) == AVAIL_OCG)
availBuffer = L" [OCG]";
else if ((ptr->second.ot & AVAIL_OCGTCG) == AVAIL_TCG)
availBuffer = L" [TCG]";
else if ((ptr->second.ot & AVAIL_CUSTOM) == AVAIL_CUSTOM)
availBuffer = L" [Custom]";
if(ptr->second.type & TYPE_MONSTER) { if(ptr->second.type & TYPE_MONSTER) {
myswprintf(textBuffer, L"%ls", dataManager.GetName(ptr->first)); myswprintf(textBuffer, L"%ls", dataManager.GetName(ptr->first));
DrawShadowText(textFont, textBuffer, Resize(860, 165 + i * 66, 955, 185 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 165 + i * 66, 955, 185 + i * 66), Resize(1, 1, 0, 0));
const wchar_t* form = L"\u2605";
wchar_t adBuffer[32]{};
wchar_t scaleBuffer[16]{};
if(!(ptr->second.type & TYPE_LINK)) { if(!(ptr->second.type & TYPE_LINK)) {
const wchar_t* form = L"\u2605"; if(ptr->second.type & TYPE_XYZ)
if(ptr->second.type & TYPE_XYZ) form = L"\u2606"; form = L"\u2606";
myswprintf(textBuffer, L"%ls/%ls %ls%d", dataManager.FormatAttribute(ptr->second.attribute), dataManager.FormatRace(ptr->second.race), form, ptr->second.level);
DrawShadowText(textFont, textBuffer, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0));
if(ptr->second.attack < 0 && ptr->second.defense < 0) if(ptr->second.attack < 0 && ptr->second.defense < 0)
myswprintf(textBuffer, L"?/?"); myswprintf(adBuffer, L"?/?");
else if(ptr->second.attack < 0) else if(ptr->second.attack < 0)
myswprintf(textBuffer, L"?/%d", ptr->second.defense); myswprintf(adBuffer, L"?/%d", ptr->second.defense);
else if(ptr->second.defense < 0) else if(ptr->second.defense < 0)
myswprintf(textBuffer, L"%d/?", ptr->second.attack); myswprintf(adBuffer, L"%d/?", ptr->second.attack);
else myswprintf(textBuffer, L"%d/%d", ptr->second.attack, ptr->second.defense); else
myswprintf(adBuffer, L"%d/%d", ptr->second.attack, ptr->second.defense);
} else { } else {
myswprintf(textBuffer, L"%ls/%ls LINK-%d", dataManager.FormatAttribute(ptr->second.attribute), dataManager.FormatRace(ptr->second.race), ptr->second.level); form = L"LINK-";
DrawShadowText(textFont, textBuffer, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0));
if(ptr->second.attack < 0) if(ptr->second.attack < 0)
myswprintf(textBuffer, L"?/-"); myswprintf(adBuffer, L"?/-");
else myswprintf(textBuffer, L"%d/-", ptr->second.attack); else
myswprintf(adBuffer, L"%d/-", ptr->second.attack);
} }
myswprintf(textBuffer, L"%ls/%ls %ls%d", dataManager.FormatAttribute(ptr->second.attribute), dataManager.FormatRace(ptr->second.race), form, ptr->second.level);
DrawShadowText(textFont, textBuffer, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0));
if(ptr->second.type & TYPE_PENDULUM) { if(ptr->second.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16];
myswprintf(scaleBuffer, L" %d/%d", ptr->second.lscale, ptr->second.rscale); myswprintf(scaleBuffer, L" %d/%d", ptr->second.lscale, ptr->second.rscale);
wcscat(textBuffer, scaleBuffer);
} }
if((ptr->second.ot & AVAIL_OCGTCG) == AVAIL_OCG) myswprintf(textBuffer, L"%ls%ls%ls", adBuffer, scaleBuffer, availBuffer);
wcscat(textBuffer, L" [OCG]");
else if((ptr->second.ot & AVAIL_OCGTCG) == AVAIL_TCG)
wcscat(textBuffer, L" [TCG]");
else if((ptr->second.ot & AVAIL_CUSTOM) == AVAIL_CUSTOM)
wcscat(textBuffer, L" [Custom]");
DrawShadowText(textFont, textBuffer, Resize(860, 209 + i * 66, 955, 229 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 209 + i * 66, 955, 229 + i * 66), Resize(1, 1, 0, 0));
} else { } else {
myswprintf(textBuffer, L"%ls", dataManager.GetName(ptr->first)); myswprintf(textBuffer, L"%ls", dataManager.GetName(ptr->first));
DrawShadowText(textFont, textBuffer, Resize(860, 165 + i * 66, 955, 185 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 165 + i * 66, 955, 185 + i * 66), Resize(1, 1, 0, 0));
const wchar_t* ptype = dataManager.FormatType(ptr->second.type); const wchar_t* ptype = dataManager.FormatType(ptr->second.type);
DrawShadowText(textFont, ptype, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, ptype, Resize(860, 187 + i * 66, 955, 207 + i * 66), Resize(1, 1, 0, 0));
textBuffer[0] = 0; myswprintf(textBuffer, L"%ls", availBuffer);
if((ptr->second.ot & AVAIL_OCGTCG) == AVAIL_OCG)
wcscat(textBuffer, L"[OCG]");
else if((ptr->second.ot & AVAIL_OCGTCG) == AVAIL_TCG)
wcscat(textBuffer, L"[TCG]");
else if((ptr->second.ot & AVAIL_CUSTOM) == AVAIL_CUSTOM)
wcscat(textBuffer, L"[Custom]");
DrawShadowText(textFont, textBuffer, Resize(860, 209 + i * 66, 955, 229 + i * 66), Resize(1, 1, 0, 0)); DrawShadowText(textFont, textBuffer, Resize(860, 209 + i * 66, 955, 229 + i * 66), Resize(1, 1, 0, 0));
} }
} }
......
...@@ -1580,11 +1580,12 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1580,11 +1580,12 @@ void Game::ShowCardInfo(int code, bool resize) {
irr::core::dimension2d<unsigned int> dtxt = guiFont->getDimension(formatBuffer); irr::core::dimension2d<unsigned int> dtxt = guiFont->getDimension(formatBuffer);
if(dtxt.Width > (300 * xScale - 13) - 15) if(dtxt.Width > (300 * xScale - 13) - 15)
offset_info = 15; offset_info = 15;
const wchar_t* form = L"\u2605";
wchar_t adBuffer[64]{};
wchar_t scaleBuffer[16]{};
if(!(cd.type & TYPE_LINK)) { if(!(cd.type & TYPE_LINK)) {
const wchar_t* form = L"\u2605";
if(cd.type & TYPE_XYZ) if(cd.type & TYPE_XYZ)
form = L"\u2606"; form = L"\u2606";
wchar_t adBuffer[16];
if(cd.attack < 0 && cd.defense < 0) if(cd.attack < 0 && cd.defense < 0)
myswprintf(adBuffer, L"?/?"); myswprintf(adBuffer, L"?/?");
else if(cd.attack < 0) else if(cd.attack < 0)
...@@ -1593,20 +1594,17 @@ void Game::ShowCardInfo(int code, bool resize) { ...@@ -1593,20 +1594,17 @@ void Game::ShowCardInfo(int code, bool resize) {
myswprintf(adBuffer, L"%d/?", cd.attack); myswprintf(adBuffer, L"%d/?", cd.attack);
else else
myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defense); myswprintf(adBuffer, L"%d/%d", cd.attack, cd.defense);
myswprintf(formatBuffer, L"[%ls%d] %ls", form, cd.level, adBuffer);
} else { } else {
wchar_t adBuffer[16]; form = L"LINK-";
if(cd.attack < 0) if(cd.attack < 0)
myswprintf(adBuffer, L"?/- "); myswprintf(adBuffer, L"?/- %ls", dataManager.FormatLinkMarker(cd.link_marker));
else else
myswprintf(adBuffer, L"%d/- ", cd.attack); myswprintf(adBuffer, L"%d/- %ls", cd.attack, dataManager.FormatLinkMarker(cd.link_marker));
myswprintf(formatBuffer, L"[LINK-%d] %ls%ls", cd.level, adBuffer, dataManager.FormatLinkMarker(cd.link_marker));
} }
if(cd.type & TYPE_PENDULUM) { if(cd.type & TYPE_PENDULUM) {
wchar_t scaleBuffer[16];
myswprintf(scaleBuffer, L" %d/%d", cd.lscale, cd.rscale); myswprintf(scaleBuffer, L" %d/%d", cd.lscale, cd.rscale);
wcscat(formatBuffer, scaleBuffer);
} }
myswprintf(formatBuffer, L"[%ls%d] %ls%ls", form, cd.level, adBuffer, scaleBuffer);
stDataInfo->setText(formatBuffer); stDataInfo->setText(formatBuffer);
int offset_arrows = offset_info; int offset_arrows = offset_info;
dtxt = guiFont->getDimension(formatBuffer); dtxt = guiFont->getDimension(formatBuffer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment