Commit 65f536df authored by fallenstardust's avatar fallenstardust

录像转卡组

parent fedea2bb
...@@ -836,9 +836,9 @@ bool Game::Initialize() { ...@@ -836,9 +836,9 @@ bool Game::Initialize() {
env->addStaticText(dataManager.GetSysString(1349), rect<s32>(360 * xScale, 30 * yScale, 570 * xScale, 50 * yScale), false, true, wReplay); env->addStaticText(dataManager.GetSysString(1349), rect<s32>(360 * xScale, 30 * yScale, 570 * xScale, 50 * yScale), false, true, wReplay);
stReplayInfo = env->addStaticText(L"", rect<s32>(360 * xScale, 60 * yScale, 570 * xScale, 315 * yScale), false, true, wReplay); stReplayInfo = env->addStaticText(L"", rect<s32>(360 * xScale, 60 * yScale, 570 * xScale, 315 * yScale), false, true, wReplay);
env->addStaticText(dataManager.GetSysString(1353), rect<s32>(360 * xScale, 240 * yScale, 570 * xScale, 260 * yScale), false, true, wReplay); env->addStaticText(dataManager.GetSysString(1353), rect<s32>(360 * xScale, 240 * yScale, 570 * xScale, 260 * yScale), false, true, wReplay);
ebRepStartTurn = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(360 * xScale, 270 * yScale, 460 * xScale, 310 * yScale), wReplay, -1);
ebRepStartTurn = CAndroidGUIEditBox::addAndroidEditBox(L"", true, env, rect<s32>(360 * xScale, 275 * yScale, 460 * xScale, 295 * yScale), wReplay, -1);
ebRepStartTurn->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER); ebRepStartTurn->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
btnExportDeck = env->addButton(rect<s32>(470 * xScale, 270 * yScale, 570 * xScale, 310 * yScale), wReplay, BUTTON_EXPORT_DECK, dataManager.GetSysString(1281));
//single play window //single play window
wSinglePlay = env->addWindow(rect<s32>(220 * xScale, 100 * yScale, 800 * xScale, 520 * yScale), false, dataManager.GetSysString(1201)); wSinglePlay = env->addWindow(rect<s32>(220 * xScale, 100 * yScale, 800 * xScale, 520 * yScale), false, dataManager.GetSysString(1201));
wSinglePlay->getCloseButton()->setVisible(false); wSinglePlay->getCloseButton()->setVisible(false);
......
...@@ -319,6 +319,7 @@ public: ...@@ -319,6 +319,7 @@ public:
irr::gui::IGUIButton* btnDeleteReplay; irr::gui::IGUIButton* btnDeleteReplay;
irr::gui::IGUIButton* btnRenameReplay; irr::gui::IGUIButton* btnRenameReplay;
irr::gui::IGUIButton* btnReplayCancel; irr::gui::IGUIButton* btnReplayCancel;
irr::gui::IGUIButton* btnExportDeck;
irr::gui::IGUIEditBox* ebRepStartTurn; irr::gui::IGUIEditBox* ebRepStartTurn;
//single play //single play
irr::gui::IGUIWindow* wSinglePlay; irr::gui::IGUIWindow* wSinglePlay;
...@@ -574,6 +575,7 @@ extern Game* mainGame; ...@@ -574,6 +575,7 @@ extern Game* mainGame;
#define BUTTON_CANCEL_REPLAY 132 #define BUTTON_CANCEL_REPLAY 132
#define BUTTON_DELETE_REPLAY 133 #define BUTTON_DELETE_REPLAY 133
#define BUTTON_RENAME_REPLAY 134 #define BUTTON_RENAME_REPLAY 134
#define BUTTON_EXPORT_DECK 135
#define BUTTON_REPLAY_START 140 #define BUTTON_REPLAY_START 140
#define BUTTON_REPLAY_PAUSE 141 #define BUTTON_REPLAY_PAUSE 141
#define BUTTON_REPLAY_STEP 142 #define BUTTON_REPLAY_STEP 142
......
...@@ -295,6 +295,42 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -295,6 +295,42 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame->ShowElement(mainGame->wMainMenu); mainGame->ShowElement(mainGame->wMainMenu);
break; break;
} }
case BUTTON_EXPORT_DECK: {
if(mainGame->lstReplayList->getSelected() == -1)
break;
Replay replay;
wchar_t ex_filename[256];
wchar_t namebuf[4][20];
wchar_t filename[256];
myswprintf(ex_filename, L"%ls", mainGame->lstReplayList->getListItem(mainGame->lstReplayList->getSelected()));
if(!replay.OpenReplay(ex_filename))
break;
const ReplayHeader& rh = replay.pheader;
if(rh.flag & REPLAY_SINGLE_MODE)
break;
int max = (rh.flag & REPLAY_TAG) ? 4 : 2;
//player name
for(int i = 0; i < max; ++i)
replay.ReadName(namebuf[i]);
//skip pre infos
for(int i = 0; i < 4; ++i)
replay.ReadInt32();
//deck
for(int i = 0; i < max; ++i) {
int main = replay.ReadInt32();
Deck tmp_deck;
for(int j = 0; j < main; ++j)
tmp_deck.main.push_back(dataManager.GetCodePointer(replay.ReadInt32()));
int extra = replay.ReadInt32();
for(int j = 0; j < extra; ++j)
tmp_deck.extra.push_back(dataManager.GetCodePointer(replay.ReadInt32()));
myswprintf(filename, L"%ls %ls", ex_filename, namebuf[i]);
deckManager.SaveDeck(tmp_deck, filename);
}
mainGame->stACMessage->setText(dataManager.GetSysString(1335));
mainGame->PopupElement(mainGame->wACMessage, 20);
break;
}
//TEST BOT MODE //TEST BOT MODE
case BUTTON_BOT_START: { case BUTTON_BOT_START: {
int sel = mainGame->lstBotList->getSelected(); int sel = mainGame->lstBotList->getSelected();
......
...@@ -321,6 +321,7 @@ ...@@ -321,6 +321,7 @@
!system 1278 自动选择魔法/陷阱卡位置 !system 1278 自动选择魔法/陷阱卡位置
!system 1279 显示场地背景 !system 1279 显示场地背景
!system 1280 重命名成功后请重新选择卡组 !system 1280 重命名成功后请重新选择卡组
!system 1281 提取卡组
!system 1290 停用聊天功能 !system 1290 停用聊天功能
!system 1291 忽略观战者发言 !system 1291 忽略观战者发言
!system 1292 □忽略时点 !system 1292 □忽略时点
......
...@@ -321,6 +321,7 @@ ...@@ -321,6 +321,7 @@
!system 1278 Auto spell/trap placing !system 1278 Auto spell/trap placing
!system 1279 Drawing field spell !system 1279 Drawing field spell
!system 1280 please rechoose deck after rename. !system 1280 please rechoose deck after rename.
!system 1281 Export Deck
!system 1290 Disable Chatting !system 1290 Disable Chatting
!system 1291 Mute spectators !system 1291 Mute spectators
!system 1292 Ignore chain !system 1292 Ignore chain
......
...@@ -321,6 +321,7 @@ ...@@ -321,6 +321,7 @@
!system 1278 카드 위치 자동 (마법&함정) !system 1278 카드 위치 자동 (마법&함정)
!system 1279 필드 이미지 활성화 !system 1279 필드 이미지 활성화
!system 1280 이름을 변경후 덱을 다시 선택해주세요. !system 1280 이름을 변경후 덱을 다시 선택해주세요.
!system 1281 추출물 선택
!system 1290 상대방 메시지 무시 !system 1290 상대방 메시지 무시
!system 1291 관전자 메시지 무시 !system 1291 관전자 메시지 무시
!system 1292 체인 무시 !system 1292 체인 무시
......
...@@ -8,7 +8,7 @@ android { ...@@ -8,7 +8,7 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 28
versionCode 340400513 versionCode 340400527
versionName "3.4.4" versionName "3.4.4"
flavorDimensions "versionCode" flavorDimensions "versionCode"
vectorDrawables.useSupportLibrary = true 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