Commit fbf88bd5 authored by fallenstardust's avatar fallenstardust

添加加速动画快捷按钮

调整效果文字边距
放大左侧卡图
parent 9a7ff47a
......@@ -75,6 +75,7 @@ void DeckBuilder::Initialize() {
mainGame->btnLeaveGame->setText(dataManager.GetSysString(1306));
mainGame->wPallet->setVisible(true);
mainGame->imgChat->setVisible(false);
mainGame->imgQuickAnimation->setVisible(false);
mainGame->btnSideOK->setVisible(false);
mainGame->btnSideShuffle->setVisible(false);
mainGame->btnSideSort->setVisible(false);
......@@ -110,6 +111,7 @@ void DeckBuilder::Terminate() {
mainGame->btnLeaveGame->setVisible(false);
mainGame->wPallet->setVisible(false);
mainGame->imgChat->setVisible(true);
mainGame->imgQuickAnimation->setVisible(true);
mainGame->wSettings->setVisible(false);
mainGame->wLogs->setVisible(false);
mainGame->PopupElement(mainGame->wMainMenu);
......
......@@ -209,6 +209,18 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->soundManager->EnableMusic(mainGame->chkEnableMusic->isChecked());
break;
}
case BUTTON_QUICK_ANIMIATION: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if (mainGame->gameConf.quick_animation) {
mainGame->gameConf.quick_animation = false;
mainGame->imgQuickAnimation->setImage(imageManager.tDoubleX);
} else {
mainGame->gameConf.quick_animation = true;
mainGame->imgQuickAnimation->setImage(imageManager.tOneX);
}
mainGame->chkQuickAnimation->setChecked(mainGame->gameConf.quick_animation);
break;
}
case BUTTON_CHATTING: {
mainGame->soundManager->PlaySoundEffect(SoundManager::SFX::BUTTON);
if (mainGame->gameConf.chkIgnore1) {
......@@ -2098,7 +2110,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
break;
}
u32 pos = mainGame->scrCardText->getPos();
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 15, mainGame->textFont, mainGame->showingtext, pos);
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth(), mainGame->textFont, mainGame->showingtext, pos);
return true;
break;
}
......@@ -2287,7 +2299,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
if(pos < 0) pos = 0;
if(pos > max) pos = max;
mainGame->scrCardText->setPos(pos);
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth() - 15, mainGame->textFont, mainGame->showingtext, pos);
mainGame->SetStaticText(mainGame->stText, mainGame->stText->getRelativePosition().getWidth(), mainGame->textFont, mainGame->showingtext, pos);
}
if(is_dragging_lstLog) {
if(!mainGame->lstLog->getVerticalScrollBar()->isVisible()) {
......
......@@ -445,11 +445,10 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
ChangeToIGUIImageButton(btnHostPrepCancel, imageManager.tButton_S, imageManager.tButton_S_pressed);
//img always use *yScale to keep proportion
wCardImg = env->addImage(rect<s32>(1 * yScale, 1 * yScale, ( 1 + CARD_IMG_WIDTH + 20) * yScale, (1 + CARD_IMG_HEIGHT + 18) * yScale), 0, -1, 0, true);
wCardImg->setImage(imageManager.tDialog_S);
wCardImg->setScaleImage(true);
wCardImg = env->addStaticText(L"",rect<s32>(1 * yScale, 1 * yScale, ( 2 + CARD_IMG_WIDTH) * yScale, (2 + CARD_IMG_HEIGHT) * yScale), true, false, 0, -1, true);
wCardImg->setBackgroundColor(0xc0c0c0c0);
wCardImg->setVisible(false);
imgCard = env->addImage(rect<s32>(10 * yScale, 9 * yScale, (10 + CARD_IMG_WIDTH) * yScale, (9 + CARD_IMG_HEIGHT) * yScale), wCardImg);
imgCard = env->addImage(rect<s32>(2 * yScale, 2 * yScale, CARD_IMG_WIDTH * yScale, CARD_IMG_HEIGHT * yScale), wCardImg);
imgCard->setImage(imageManager.tCover[0]);
imgCard->setScaleImage(true);
imgCard->setUseAlphaChannel(true);
......@@ -473,7 +472,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
btnEP->setVisible(false);
//tab(changed)
wInfos = env->addWindow(rect<s32>(1 * xScale, 275 * yScale, 260 * xScale, 639 * yScale), false, L"");
wInfos = env->addWindow(rect<s32>(1 * xScale, (3 + CARD_IMG_HEIGHT) * yScale, 260 * xScale, 639 * yScale), false, L"");
wInfos->getCloseButton()->setVisible(false);
wInfos->setDraggable(false);
wInfos->setVisible(false);
......@@ -487,14 +486,14 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
stDataInfo->setOverrideColor(SColor(255, 222, 215, 100));//255, 0, 0, 255
stSetName = env->addStaticText(L"", rect<s32>(10 * xScale, 83 * yScale, 260 * xScale, 106 * yScale), false, true, wInfos, -1, false);
stSetName->setOverrideColor(SColor(255, 255, 152, 42));//255, 0, 0, 255
stText = env->addStaticText(L"", rect<s32>(10 * xScale, 106 * yScale, 260 * xScale, 345 * yScale), false, true, wInfos, -1, false);
stText = env->addStaticText(L"", rect<s32>(10 * xScale, 106 * yScale, 250 * xScale, 340 * yScale), false, true, wInfos, -1, false);
stText->setOverrideFont(textFont);
scrCardText = env->addScrollBar(false, rect<s32>(250 * xScale, 106 * yScale, 258 * xScale, 639 * yScale), wInfos, SCROLL_CARDTEXT);
scrCardText->setLargeStep(1);
scrCardText->setSmallStep(1);
scrCardText->setVisible(false);
//imageButtons pallet
wPallet = env->addWindow(rect<s32>(262 * xScale, 275 * yScale, 307 * xScale, 639 * yScale), false, L"");
wPallet = env->addWindow(rect<s32>(262 * xScale, (3 + CARD_IMG_HEIGHT) * yScale, 307 * xScale, 639 * yScale), false, L"");
wPallet->getCloseButton()->setVisible(false);
wPallet->setDraggable(false);
wPallet->setDrawTitlebar(false);
......@@ -523,7 +522,15 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
} else {
imgVol->setImage(imageManager.tMute);
}
//Settings
//shift quick animation
imgQuickAnimation = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(0 * yScale, 165 * yScale, 45 * yScale, 210 * yScale), wPallet, BUTTON_QUICK_ANIMIATION);
imgQuickAnimation->setImageSize(core::dimension2di(28 * yScale, 28 * yScale));
if (gameConf.quick_animation) {
imgQuickAnimation->setImage(imageManager.tDoubleX);
} else {
imgQuickAnimation->setImage(imageManager.tOneX);
}
//Settings
imgSettings = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(0 * yScale, 0 * yScale, 45 * yScale, 45 * yScale), wPallet, BUTTON_SETTINGS);
imgSettings->setImageSize(core::dimension2di(28 * yScale, 28 * yScale));
imgSettings->setImage(imageManager.tSettings);
......@@ -1160,7 +1167,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
btnReplayExit = env->addButton(rect<s32>(0, 225 * yScale, 110 * yScale, 265 * yScale), wReplayControl, BUTTON_REPLAY_EXIT, dataManager.GetSysString(1347));
ChangeToIGUIImageButton(btnReplayExit, imageManager.tButton_S, imageManager.tButton_S_pressed);
//chat
imgChat = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(0 * yScale, 319 * yScale, 45 * yScale, 364 * yScale), wPallet, BUTTON_CHATTING);
imgChat = irr::gui::CGUIImageButton::addImageButton(env, rect<s32>(0 * yScale, 300 * yScale, 45 * yScale, 345 * yScale), wPallet, BUTTON_CHATTING);
imgChat->setImageSize(core::dimension2di(28 * yScale, 28 * yScale));
if (gameConf.chkIgnore1) {
imgChat->setImage(imageManager.tShut);
......@@ -1174,15 +1181,15 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
wChat->setVisible(false);
ebChatInput = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(3 * xScale, 2 * yScale, 710 * xScale, 28 * yScale), wChat, EDITBOX_CHAT);
//swap
btnSpectatorSwap = env->addButton(rect<s32>(200 * yScale, 70 * yScale, 310 * yScale, 110 * yScale), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
btnSpectatorSwap = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 70 * yScale, 310 * yScale, 110 * yScale), 0, BUTTON_REPLAY_SWAP, dataManager.GetSysString(1346));
ChangeToIGUIImageButton(btnSpectatorSwap, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnSpectatorSwap->setVisible(false);
//chain buttons
btnChainIgnore = env->addButton(rect<s32>(200 * yScale, 70 * yScale, 310 * yScale, 110 * yScale), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
btnChainIgnore = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 70 * yScale, 310 * yScale, 110 * yScale), 0, BUTTON_CHAIN_IGNORE, dataManager.GetSysString(1292));
ChangeToIGUIImageButton(btnChainIgnore, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnChainAlways = env->addButton(rect<s32>(200 * yScale, 115 * yScale, 310 * yScale, 155 * yScale), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
btnChainAlways = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 115 * yScale, 310 * yScale, 155 * yScale), 0, BUTTON_CHAIN_ALWAYS, dataManager.GetSysString(1293));
ChangeToIGUIImageButton(btnChainAlways, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnChainWhenAvail = env->addButton(rect<s32>(200 * yScale, 160 * yScale, 310 * yScale, 200 * yScale), 0, BUTTON_CHAIN_WHENAVAIL, dataManager.GetSysString(1294));
btnChainWhenAvail = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 160 * yScale, 310 * yScale, 200 * yScale), 0, BUTTON_CHAIN_WHENAVAIL, dataManager.GetSysString(1294));
ChangeToIGUIImageButton(btnChainWhenAvail, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnChainIgnore->setIsPushButton(true);
btnChainAlways->setIsPushButton(true);
......@@ -1191,11 +1198,11 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
btnChainAlways->setVisible(false);
btnChainWhenAvail->setVisible(false);
//shuffle
btnShuffle = env->addButton(rect<s32>(200 * yScale, 205 * yScale, 310 * yScale, 245 * yScale), 0, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1297));
btnShuffle = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 205 * yScale, 310 * yScale, 245 * yScale), 0, BUTTON_CMD_SHUFFLE, dataManager.GetSysString(1297));
ChangeToIGUIImageButton(btnShuffle, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnShuffle->setVisible(false);
//cancel or finish
btnCancelOrFinish = env->addButton(rect<s32>(200 * yScale, 205 * yScale, 310 * yScale, 255 * yScale), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295));
btnCancelOrFinish = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 205 * yScale, 310 * yScale, 255 * yScale), 0, BUTTON_CANCEL_OR_FINISH, dataManager.GetSysString(1295));
ChangeToIGUIImageButton(btnCancelOrFinish, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnCancelOrFinish->setVisible(false);
soundManager = Utils::make_unique<SoundManager>();
......@@ -1230,7 +1237,7 @@ bool Game::Initialize(ANDROID_APP app, android::InitOptions *options) {
btnBigCardZoomOut->setVisible(false);
btnBigCardClose->setVisible(false);
//leave/surrender/exit
btnLeaveGame = env->addButton(rect<s32>(200 * yScale, 1 * yScale, 310 * yScale, 51 * yScale), 0, BUTTON_LEAVE_GAME, L"");
btnLeaveGame = env->addButton(rect<s32>((3 + CARD_IMG_WIDTH) * yScale, 1 * yScale, 310 * yScale, 51 * yScale), 0, BUTTON_LEAVE_GAME, L"");
ChangeToIGUIImageButton(btnLeaveGame, imageManager.tButton_S, imageManager.tButton_S_pressed);
btnLeaveGame->setVisible(false);
//tip
......@@ -1369,13 +1376,13 @@ void Game::MainLoop() {
driver->enableMaterial2D(true);
driver->getMaterial2D().ZBuffer = ECFN_NEVER;
if(imageManager.tBackGround) {
driver->draw2DImage(imageManager.tBackGround, recti(0 * xScale, 0 * yScale, 1280 * xScale, 720 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
driver->draw2DImage(imageManager.tBackGround, recti(0 * xScale, 0 * yScale, 1920 * xScale, 1080 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
}
if(imageManager.tBackGround_menu) {
driver->draw2DImage(imageManager.tBackGround_menu, recti(0 * xScale, 0 * yScale, 1280 * xScale, 720 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
driver->draw2DImage(imageManager.tBackGround_menu, recti(0 * xScale, 0 * yScale, 1920 * xScale, 1080 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
}
if(imageManager.tBackGround_deck) {
driver->draw2DImage(imageManager.tBackGround_deck, recti(0 * xScale, 0 * yScale, 1280 * xScale, 720 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
driver->draw2DImage(imageManager.tBackGround_deck, recti(0 * xScale, 0 * yScale, 1920 * xScale, 1080 * yScale), recti(0, 0, imageManager.tBackGround->getOriginalSize().Width, imageManager.tBackGround->getOriginalSize().Height));
}
driver->enableMaterial2D(false);
#endif
......@@ -1496,7 +1503,7 @@ void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cH
env->removeFocus(scrCardText);
return;
}
format_text = SetStaticText(pControl, cWidth - int(15 * xScale), font, text);
format_text = SetStaticText(pControl, cWidth, font, text);
u32 fontheight = font->getDimension(L"A").Height + font->getKerningHeight();
u32 step = (font->getDimension(format_text.c_str()).Height - cHeight) / fontheight + 1;
scrCardText->setVisible(true);
......@@ -1866,15 +1873,15 @@ void Game::ShowCardInfo(int code) {
}
stDataInfo->setText(formatBuffer);
stSetName->setRelativePosition(rect<s32>(10 * xScale, 83 * yScale, 250 * xScale, 106 * yScale));
stText->setRelativePosition(rect<s32>(10 * xScale, (83 + offset) * yScale, 260 * xScale, 345 * yScale));
scrCardText->setRelativePosition(rect<s32>(255 * xScale, (83 + offset) * yScale, 258 * xScale, 345 * yScale));
stText->setRelativePosition(rect<s32>(10 * xScale, (83 + offset) * yScale, 251 * xScale, 340 * yScale));
scrCardText->setRelativePosition(rect<s32>(255 * xScale, (83 + offset) * yScale, 258 * xScale, 340 * yScale));
} else {
myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(cd.type));
stInfo->setText(formatBuffer);
stDataInfo->setText(L"");
stSetName->setRelativePosition(rect<s32>(10 * xScale, 60 * yScale, 250 * xScale, 106 * yScale));
stText->setRelativePosition(rect<s32>(10 * xScale, (60 + offset) * yScale, 260 * xScale, 345 * yScale));
scrCardText->setRelativePosition(rect<s32>(255 * xScale, (60 + offset) * yScale, 258 * xScale, 345 * yScale));
stText->setRelativePosition(rect<s32>(10 * xScale, (60 + offset) * yScale, 251 * xScale, 340 * yScale));
scrCardText->setRelativePosition(rect<s32>(255 * xScale, (60 + offset) * yScale, 258 * xScale, 340 * yScale));
}
showingtext = dataManager.GetText(code);
const auto& tsize = stText->getRelativePosition();
......
......@@ -272,7 +272,7 @@ public:
irr::gui::CGUITTFont* titleFont;
std::map<irr::gui::CGUIImageButton*, int> imageLoading;
//card image
irr::gui::IGUIImage* wCardImg;
irr::gui::IGUIStaticText* wCardImg;
irr::gui::IGUIImage* imgCard;
//imageButtons pallet
irr::gui::IGUIWindow* wPallet;
......@@ -285,6 +285,8 @@ public:
irr::gui::IGUIButton* btnCloseLog;//
//imageButton BGM
irr::gui::CGUIImageButton* imgVol;
//imageButton Quick Animation
irr::gui::CGUIImageButton* imgQuickAnimation;
//imageButton Chatting
irr::gui::CGUIImageButton* imgChat;
//Settings
......@@ -700,8 +702,8 @@ extern Game* mainGame;
}
#define CARD_IMG_WIDTH 177
#define CARD_IMG_HEIGHT 254
#define CARD_IMG_WIDTH 200
#define CARD_IMG_HEIGHT 290
#define CARD_THUMB_WIDTH 44
#define CARD_THUMB_HEIGHT 64
......@@ -907,6 +909,7 @@ extern Game* mainGame;
#define CHECKBOX_PREFER_EXPANSION 373
#define CHECKBOX_DRAW_SINGLE_CHAIN 374
#define CHECKBOX_LFLIST 375
#define BUTTON_QUICK_ANIMIATION 376
#define BUTTON_BIG_CARD_CLOSE 380
#define BUTTON_BIG_CARD_ZOOM_IN 381
#define BUTTON_BIG_CARD_ZOOM_OUT 382
......
......@@ -49,6 +49,8 @@ bool ImageManager::Initial(const path dir) {
tMute = driver->getTexture((dir + path("/textures/extra/tmute.png")).c_str());
tPlay = driver->getTexture((dir + path("/textures/extra/tplay.png")).c_str());
tTalk = driver->getTexture((dir + path("/textures/extra/ttalk.png")).c_str());
tOneX = driver->getTexture((dir + path("/textures/extra/tonex.png")).c_str());
tDoubleX = driver->getTexture((dir + path("/textures/extra/tdoublex.png")).c_str());
tShut = driver->getTexture((dir + path("/textures/extra/tshut.png")).c_str());
tClose = driver->getTexture((dir + path("/textures/extra/tclose.png")).c_str());
tTitleBar = driver->getTexture((dir + path("/textures/extra/stitlebar.png")).c_str());
......
......@@ -64,6 +64,8 @@ public:
irr::video::ITexture* tMute;
irr::video::ITexture* tPlay;
irr::video::ITexture* tTalk;
irr::video::ITexture* tOneX;
irr::video::ITexture* tDoubleX;
irr::video::ITexture* tShut;
irr::video::ITexture* tClose;
irr::video::ITexture* tTitleBar;
......
......@@ -9,7 +9,7 @@ android {
minSdkVersion 21
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
versionCode 310090944
versionCode 310090945
versionName "3.10.9"
flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true
......
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