Commit 4e91fcdb authored by fallenstardust's avatar fallenstardust

将界面文字统一使用guifont

parent 3860804f
...@@ -1033,7 +1033,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1033,7 +1033,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, dataManager.GetSysString(1510), dataManager.GetDesc(data)); myswprintf(textBuffer, dataManager.GetSysString(1510), dataManager.GetDesc(data));
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40); mainGame->WaitFrameSignal(40);
...@@ -1050,7 +1050,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1050,7 +1050,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatRace(data));
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40); mainGame->WaitFrameSignal(40);
...@@ -1060,7 +1060,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1060,7 +1060,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.FormatAttribute(data));
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40); mainGame->WaitFrameSignal(40);
...@@ -1070,7 +1070,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1070,7 +1070,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.GetName(data)); myswprintf(textBuffer, dataManager.GetSysString(1511), dataManager.GetName(data));
mainGame->AddLog(textBuffer, data); mainGame->AddLog(textBuffer, data);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40); mainGame->WaitFrameSignal(40);
...@@ -1080,7 +1080,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1080,7 +1080,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, dataManager.GetSysString(1512), data); myswprintf(textBuffer, dataManager.GetSysString(1512), data);
mainGame->AddLog(textBuffer); mainGame->AddLog(textBuffer);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stACMessage, 310, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wACMessage, 20); mainGame->PopupElement(mainGame->wACMessage, 20);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
mainGame->WaitFrameSignal(40); mainGame->WaitFrameSignal(40);
...@@ -1461,7 +1461,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1461,7 +1461,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, dataManager.GetDesc(desc), dataManager.GetName(code)); myswprintf(textBuffer, dataManager.GetDesc(desc), dataManager.GetName(code));
} }
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery); mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
return false; return false;
...@@ -1731,7 +1731,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) { ...@@ -1731,7 +1731,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
myswprintf(textBuffer, L"%ls\n%ls\n%ls", event_string, dataManager.GetSysString(222), dataManager.GetSysString(223)); myswprintf(textBuffer, L"%ls\n%ls\n%ls", event_string, dataManager.GetSysString(222), dataManager.GetSysString(223));
else else
myswprintf(textBuffer, L"%ls\n%ls", event_string, dataManager.GetSysString(203)); myswprintf(textBuffer, L"%ls\n%ls", event_string, dataManager.GetSysString(203));
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery); mainGame->PopupElement(mainGame->wQuery);
} }
} }
......
...@@ -353,7 +353,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -353,7 +353,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->btnOptionn->setVisible(true); mainGame->btnOptionn->setVisible(true);
if(selected_option == 0) if(selected_option == 0)
mainGame->btnOptionp->setVisible(false); mainGame->btnOptionp->setVisible(false);
mainGame->SetStaticText(mainGame->stOptions, 350 * mainGame->xScale, mainGame->textFont, dataManager.GetDesc(select_options[selected_option])); mainGame->SetStaticText(mainGame->stOptions, 350 * mainGame->xScale, mainGame->guiFont, dataManager.GetDesc(select_options[selected_option]));
break; break;
} }
case BUTTON_OPTION_NEXT: { case BUTTON_OPTION_NEXT: {
...@@ -362,7 +362,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -362,7 +362,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->btnOptionp->setVisible(true); mainGame->btnOptionp->setVisible(true);
if(selected_option == select_options.size() - 1) if(selected_option == select_options.size() - 1)
mainGame->btnOptionn->setVisible(false); mainGame->btnOptionn->setVisible(false);
mainGame->SetStaticText(mainGame->stOptions, 350 * mainGame->xScale, mainGame->textFont, dataManager.GetDesc(select_options[selected_option])); mainGame->SetStaticText(mainGame->stOptions, 350 * mainGame->xScale, mainGame->guiFont, dataManager.GetDesc(select_options[selected_option]));
break; break;
} }
case BUTTON_OPTION_0: case BUTTON_OPTION_0:
...@@ -1574,7 +1574,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1574,7 +1574,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
should_show_tip = true; should_show_tip = true;
myswprintf(formatBuffer, dataManager.GetSysString(1700), mainGame->btnCancelOrFinish->getText()); myswprintf(formatBuffer, dataManager.GetSysString(1700), mainGame->btnCancelOrFinish->getText());
mainGame->stTip->setText(formatBuffer); mainGame->stTip->setText(formatBuffer);
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10); irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(formatBuffer) + irr::core::dimension2d<unsigned int>(10, 10);
mainGame->stTip->setRelativePosition(recti(x - 10 * mainGame->xScale - dtip.Width, y - 10 * mainGame->yScale - dtip.Height, x - 10 * mainGame->xScale, y - 10 * mainGame->yScale)); mainGame->stTip->setRelativePosition(recti(x - 10 * mainGame->xScale - dtip.Width, y - 10 * mainGame->yScale - dtip.Height, x - 10 * mainGame->xScale, y - 10 * mainGame->yScale));
} }
mainGame->stTip->setVisible(should_show_tip); mainGame->stTip->setVisible(should_show_tip);
...@@ -1703,7 +1703,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1703,7 +1703,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer); str.append(formatBuffer);
} }
should_show_tip = true; should_show_tip = true;
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10 * mainGame->xScale, 10 * mainGame->yScale); irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10 * mainGame->xScale, 10 * mainGame->yScale);
mainGame->stTip->setRelativePosition(recti(x - 10 * mainGame->xScale - dtip.Width, y - 10 * mainGame->yScale - dtip.Height, x - 10 * mainGame->xScale, y - 10 * mainGame->yScale)); mainGame->stTip->setRelativePosition(recti(x - 10 * mainGame->xScale - dtip.Width, y - 10 * mainGame->yScale - dtip.Height, x - 10 * mainGame->xScale, y - 10 * mainGame->yScale));
mainGame->stTip->setText(str.c_str()); mainGame->stTip->setText(str.c_str());
} }
...@@ -1742,7 +1742,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1742,7 +1742,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
str.append(formatBuffer); str.append(formatBuffer);
} }
should_show_tip = true; should_show_tip = true;
irr::core::dimension2d<unsigned int> dtip = mainGame->textFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10 * mainGame->xScale, 10 * mainGame->yScale); irr::core::dimension2d<unsigned int> dtip = mainGame->guiFont->getDimension(str.c_str()) + irr::core::dimension2d<unsigned int>(10 * mainGame->xScale, 10 * mainGame->yScale);
mainGame->stTip->setRelativePosition(recti(x - 10 * mainGame->xScale - dtip.Width, y + 10 * mainGame->yScale, x - 10 * mainGame->xScale, y + 10 * mainGame->yScale + dtip.Height)); mainGame->stTip->setRelativePosition(recti(x - 10 * mainGame->xScale - dtip.Width, y + 10 * mainGame->yScale, x - 10 * mainGame->xScale, y + 10 * mainGame->yScale + dtip.Height));
mainGame->stTip->setText(str.c_str()); mainGame->stTip->setText(str.c_str());
} }
...@@ -2098,7 +2098,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2098,7 +2098,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break; break;
} }
u32 pos = mainGame->scrCardText->getPos(); u32 pos = mainGame->scrCardText->getPos();
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->textFont, mainGame->showingtext, pos); mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 25, mainGame->guiFont, mainGame->showingtext, pos);
return true; return true;
break; break;
} }
......
...@@ -36,8 +36,6 @@ void Game::process(irr::SEvent &event) { ...@@ -36,8 +36,6 @@ void Game::process(irr::SEvent &event) {
} }
} }
#ifdef _IRR_ANDROID_PLATFORM_
void Game::stopBGM() { void Game::stopBGM() {
ALOGD("stop bgm"); ALOGD("stop bgm");
gMutex.lock(); gMutex.lock();
...@@ -97,12 +95,10 @@ void Game::onHandleAndroidCommand(ANDROID_APP app, int32_t cmd){ ...@@ -97,12 +95,10 @@ void Game::onHandleAndroidCommand(ANDROID_APP app, int32_t cmd){
} }
bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) { bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
this->appMain = app; this->appMain = app;
#endif
srand(time(0)); srand(time(0));
irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters(); irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters();
#ifdef _IRR_ANDROID_PLATFORM_ #ifdef _IRR_ANDROID_PLATFORM_
glversion = options->getOpenglVersion(); glversion = options->getOpenglVersion();
if (glversion == 0) { if (glversion == 0) {
params.DriverType = irr::video::EDT_OGLES1; params.DriverType = irr::video::EDT_OGLES1;
...@@ -119,6 +115,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) { ...@@ -119,6 +115,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
device = irr::createDeviceEx(params); device = irr::createDeviceEx(params);
if(!device) if(!device)
return false; return false;
#ifdef _IRR_ANDROID_PLATFORM_ #ifdef _IRR_ANDROID_PLATFORM_
if (!android::perfromTrick(app)) { if (!android::perfromTrick(app)) {
return false; return false;
...@@ -239,12 +236,12 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) { ...@@ -239,12 +236,12 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
LoadExpansions(); LoadExpansions();
env = device->getGUIEnvironment(); env = device->getGUIEnvironment();
bool isAntialias = options->isFontAntiAliasEnabled(); bool isAntialias = options->isFontAntiAliasEnabled();
numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, (int)16 * yScale, isAntialias, false); numFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 16 * yScale, isAntialias, false);
adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, (int)12 * yScale, isAntialias, false); adFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 12 * yScale, isAntialias, false);
lpcFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, (int)48 * yScale, isAntialias, true); lpcFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.numfont, 48 * yScale, isAntialias, true);
guiFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, (int)gameConf.textfontsize * yScale, isAntialias, true); guiFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, 16 * yScale, isAntialias, true);
titleFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, (int)32 * yScale, isAntialias, true); titleFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, 32 * yScale, isAntialias, true);
textFont = guiFont; textFont = irr::gui::CGUITTFont::createTTFont(env, gameConf.textfont, (int)gameConf.textfontsize * yScale, isAntialias, true);
if(!numFont || !textFont) { if(!numFont || !textFont) {
ALOGW("add font fail "); ALOGW("add font fail ");
} }
......
...@@ -277,7 +277,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -277,7 +277,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->gMutex.lock(); mainGame->gMutex.lock();
wchar_t textBuffer[256]; wchar_t textBuffer[256];
myswprintf(textBuffer, L"%ls\n%ls", mainGame->lstReplayList->getListItem(sel), dataManager.GetSysString(1363)); myswprintf(textBuffer, L"%ls\n%ls", mainGame->lstReplayList->getListItem(sel), dataManager.GetSysString(1363));
mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->textFont, textBuffer); mainGame->SetStaticText(mainGame->stQMessage, 370 * mainGame->xScale, mainGame->guiFont, textBuffer);
mainGame->PopupElement(mainGame->wQuery); mainGame->PopupElement(mainGame->wQuery);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
prev_operation = id; prev_operation = id;
......
...@@ -751,7 +751,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) { ...@@ -751,7 +751,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
memcpy(msgbuf, begin, len + 1); memcpy(msgbuf, begin, len + 1);
BufferIO::DecodeUTF8(msgbuf, msg); BufferIO::DecodeUTF8(msgbuf, msg);
mainGame->gMutex.lock(); mainGame->gMutex.lock();
mainGame->SetStaticText(mainGame->stMessage, 370 * mainGame->xScale, mainGame->textFont, msg); mainGame->SetStaticText(mainGame->stMessage, 370 * mainGame->xScale, mainGame->guiFont, msg);
mainGame->PopupElement(mainGame->wMessage); mainGame->PopupElement(mainGame->wMessage);
mainGame->gMutex.unlock(); mainGame->gMutex.unlock();
mainGame->actionSignal.Reset(); mainGame->actionSignal.Reset();
......
...@@ -110,6 +110,7 @@ import ocgcore.data.LimitList; ...@@ -110,6 +110,7 @@ import ocgcore.data.LimitList;
import ocgcore.enums.LimitType; import ocgcore.enums.LimitType;
public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewItemListener.OnItemListener, OnItemDragListener, YGODialogUtil.OnDeckMenuListener, CardLoader.CallBack, CardSearcher.CallBack { public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewItemListener.OnItemListener, OnItemDragListener, YGODialogUtil.OnDeckMenuListener, CardLoader.CallBack, CardSearcher.CallBack {
private static String TAG = "DeckManagerFragment";
protected DrawerLayout mDrawerLayout; protected DrawerLayout mDrawerLayout;
protected RecyclerView mListView; protected RecyclerView mListView;
protected CardSearcher mCardSelector; protected CardSearcher mCardSelector;
...@@ -303,7 +304,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte ...@@ -303,7 +304,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
public void onDragLongPress(int pos) { public void onDragLongPress(int pos) {
if (pos < 0) return; if (pos < 0) return;
if (Constants.DEBUG) if (Constants.DEBUG)
Log.d("kk", "delete " + pos); Log.d(TAG, "delete " + pos);
if (mSettings.isDialogDelete()) { if (mSettings.isDialogDelete()) {
DeckItem deckItem = mDeckAdapater.getItem(pos); DeckItem deckItem = mDeckAdapater.getItem(pos);
if (deckItem == null || deckItem.getCardInfo() == null) { if (deckItem == null || deckItem.getCardInfo() == null) {
...@@ -406,7 +407,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte ...@@ -406,7 +407,7 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
if (file == null) { if (file == null) {
return new DeckInfo(); return new DeckInfo();
} }
Log.i("kk", "load ydk " + file); Log.i(TAG, "load ydk " + file);
if (mCardLoader.isOpen() && file.exists()) { if (mCardLoader.isOpen() && file.exists()) {
return mDeckAdapater.read(mCardLoader, file, mCardLoader.getLimitList()); return mDeckAdapater.read(mCardLoader, file, mCardLoader.getLimitList());
} else { } else {
......
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