Commit 5fa6573a authored by edo9300's avatar edo9300

Extension update + missing flags

parent 22b3d51f
......@@ -617,7 +617,7 @@ bool Game::Initialize() {
btnReplayCancel = env->addButton(rect<s32>(460, 385, 570, 410), wReplay, BUTTON_CANCEL_REPLAY, dataManager.GetSysString(1347));
env->addStaticText(dataManager.GetSysString(1349), rect<s32>(360, 30, 570, 50), false, true, wReplay);
stReplayInfo = env->addStaticText(L"", rect<s32>(360, 60, 570, 350), false, true, wReplay);
chkYrp = env->addCheckBox(false, recti(360, 250, 460, 270), wReplay, -1, dataManager.GetSysString(1999));
chkYrp = env->addCheckBox(false, recti(360, 250, 560, 270), wReplay, -1, dataManager.GetSysString(1999));
env->addStaticText(dataManager.GetSysString(1353), rect<s32>(360, 275, 570, 295), false, true, wReplay);
ebRepStartTurn = env->addEditBox(L"", rect<s32>(360, 300, 460, 320), true, wReplay, -1);
ebRepStartTurn->setTextAlignment(irr::gui::EGUIA_CENTER, irr::gui::EGUIA_CENTER);
......
......@@ -395,6 +395,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
repinfo.append(infobuf);
mainGame->ebRepStartTurn->setText(L"1");
mainGame->SetStaticText(mainGame->stReplayInfo, 180, mainGame->guiFont, (wchar_t*)repinfo.c_str());
if(ReplayMode::cur_replay.pheader.id == 0x31707279) {
mainGame->chkYrp->setChecked(false);
mainGame->chkYrp->setEnabled(false);
} else
mainGame->chkYrp->setEnabled(true);
break;
}
}
......
......@@ -23,7 +23,7 @@ void Replay::BeginRecord(bool write) {
CloseHandle(recording_fp);
is_writing = write;
if(is_writing) {
recording_fp = CreateFileW(L"./replay/_LastReplay.yrp", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
recording_fp = CreateFileW(L"./replay/_LastReplay.yrpX", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
if(recording_fp == INVALID_HANDLE_VALUE)
return;
}
......@@ -32,7 +32,7 @@ void Replay::BeginRecord(bool write) {
fclose(fp);
is_writing = write;
if(is_writing) {
fp = fopen("./replay/_LastReplay.yrp", "wb");
fp = fopen("./replay/_LastReplay.yrpX", "wb");
if(!fp)
return;
}
......@@ -148,7 +148,7 @@ void Replay::EndRecord(size_t size) {
}
void Replay::SaveReplay(const wchar_t* name) {
wchar_t fname[256];
myswprintf(fname, L"./replay/%ls.yrp", name);
myswprintf(fname, L"./replay/%ls.yrpX", name);
#ifdef WIN32
fp = _wfopen(fname, L"wb");
#else
......
......@@ -408,6 +408,7 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
//records the replay with the new system
new_replay.BeginRecord();
rh.id = 0x58707279;
rh.flag |= REPLAY_NEWREPLAY;
new_replay.WriteHeader(rh);
new_replay.WriteData(players[0]->name, 40, false);
new_replay.WriteData(players[1]->name, 40);
......
......@@ -367,6 +367,7 @@ void TagDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
//records the replay with the new system
new_replay.BeginRecord();
rh.id = 0x58707279;
rh.flag |= REPLAY_NEWREPLAY;
new_replay.WriteHeader(rh);
new_replay.WriteData(players[0]->name, 40, false);
new_replay.WriteData(players[1]->name, 40, false);
......
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