Commit 24690686 authored by edo9300's avatar edo9300

Merge remote-tracking branch 'refs/remotes/Fluorohydride/master'

parents fd74c401 3de8cf69
......@@ -402,7 +402,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
else if(conti_selecting)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->chain_code));
else
mainGame->btnCardSelect[i]->setImage(imageManager.tCover[0]);
mainGame->btnCardSelect[i]->setImage(imageManager.tCover[selectable_cards[i]->controler]);
mainGame->btnCardSelect[i]->setRelativePosition(rect<s32>(startpos + i * 125, 55, startpos + 120 + i * 125, 225));
mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true);
......@@ -488,7 +488,7 @@ void ClientField::ShowChainCard() {
if(selectable_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardSelect[i], selectable_cards[i]->code));
else
mainGame->btnCardSelect[i]->setImage(imageManager.tCover[0]);
mainGame->btnCardSelect[i]->setImage(imageManager.tCover[selectable_cards[i]->controler]);
mainGame->btnCardSelect[i]->setRelativePosition(rect<s32>(startpos + i * 125, 55, startpos + 120 + i * 125, 225));
mainGame->btnCardSelect[i]->setPressed(false);
mainGame->btnCardSelect[i]->setVisible(true);
......@@ -543,7 +543,7 @@ void ClientField::ShowLocationCard() {
if(display_cards[i]->code)
mainGame->imageLoading.insert(std::make_pair(mainGame->btnCardDisplay[i], display_cards[i]->code));
else
mainGame->btnCardDisplay[i]->setImage(imageManager.tCover[0]);
mainGame->btnCardDisplay[i]->setImage(imageManager.tCover[display_cards[i]->controler]);
mainGame->btnCardDisplay[i]->setRelativePosition(rect<s32>(startpos + i * 125, 55, startpos + 120 + i * 125, 225));
mainGame->btnCardDisplay[i]->setPressed(false);
mainGame->btnCardDisplay[i]->setVisible(true);
......
......@@ -962,7 +962,7 @@ void Game::ShowElement(irr::gui::IGUIElement * win, int autoframe) {
FadingUnit fu;
fu.fadingSize = win->getRelativePosition();
for(auto fit = fadingList.begin(); fit != fadingList.end(); ++fit)
if(win == fit->guiFading)
if(win == fit->guiFading && win != wOptions) // the size of wOptions is always setted by ClientField::ShowSelectOption before showing it
fu.fadingSize = fit->fadingSize;
irr::core::position2di center = fu.fadingSize.getCenter();
fu.fadingDiff.X = fu.fadingSize.getWidth() / 10;
......@@ -1036,7 +1036,7 @@ void Game::PopupElement(irr::gui::IGUIElement * element, int hideframe) {
}
void Game::WaitFrameSignal(int frame) {
frameSignal.Reset();
signalFrame = frame;
signalFrame = (gameConf.quick_animation && frame >= 12) ? 12 : frame;
frameSignal.Wait();
}
void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, int>* lflist, bool drag) {
......
......@@ -1811,6 +1811,9 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
mainGame->engineMusic->stopAllSounds();
break;
}
case CHECKBOX_QUICK_ANIMATION: {
mainGame->gameConf.quick_animation = mainGame->chkQuickAnimation->isChecked() ? 1 : 0;
}
}
break;
}
......
......@@ -345,6 +345,8 @@ bool Game::Initialize() {
srcVolume->setPos(gameConf.volume * 100);
srcVolume->setLargeStep(1);
srcVolume->setSmallStep(1);
chkQuickAnimation = env->addCheckBox(false, rect<s32>(20, 315, 280, 340), tabSystem, CHECKBOX_QUICK_ANIMATION, dataManager.GetSysString(1299));
chkQuickAnimation->setChecked(gameConf.quick_animation != 0);
//
wHand = env->addWindow(rect<s32>(500, 450, 825, 605), false, L"");
wHand->getCloseButton()->setVisible(false);
......@@ -1107,6 +1109,7 @@ void Game::LoadConfig() {
gameConf.volume = 1.0;
gameConf.enablemusic = true;
gameConf.draw_field_spell = 1;
gameConf.quick_animation = 0;
gameConf.chkAnime = 0;
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
......@@ -1161,6 +1164,8 @@ void Game::LoadConfig() {
gameConf.chkHideHintButton = atoi(valbuf);
} else if(!strcmp(strbuf, "draw_field_spell")) {
gameConf.draw_field_spell = atoi(valbuf);
} else if(!strcmp(strbuf, "quick_animation")) {
gameConf.quick_animation = atoi(valbuf);
} else if(!strcmp(strbuf, "show_anime")) {
gameConf.chkAnime = atoi(valbuf);
} else if(!strcmp(strbuf, "enable_sound")) {
......@@ -1225,6 +1230,7 @@ void Game::SaveConfig() {
fprintf(fp, "hide_setname = %d\n", ((gameConf.chkHideSetname) ? 1 : 0));
fprintf(fp, "hide_hint_button = %d\n", ((chkHideHintButton->isChecked()) ? 1 : 0));
fprintf(fp, "draw_field_spell = %d\n", gameConf.draw_field_spell);
fprintf(fp, "quick_animation = %d\n", gameConf.quick_animation);
fprintf(fp, "show_anime = %d\n", ((chkAnime->isChecked()) ? 1 : 0));
fprintf(fp, "skin_index = %d\n", gameConf.skin_index);
fprintf(fp, "enable_sound = %d\n", ((chkEnableSound->isChecked()) ? 1 : 0));
......
......@@ -37,6 +37,7 @@ struct Config {
int chkHideSetname;
int chkHideHintButton;
int draw_field_spell;
int quick_animation;
int chkAnime;
bool enablesound;
......@@ -252,6 +253,7 @@ public:
irr::gui::IGUICheckBox* chkRandomPos;
irr::gui::IGUICheckBox* chkAutoChain;
irr::gui::IGUICheckBox* chkWaitChain;
irr::gui::IGUICheckBox* chkQuickAnimation;
irr::gui::IGUICheckBox* chkHideSetname;
irr::gui::IGUICheckBox* chkHideHintButton;
irr::gui::IGUICheckBox* chkEnableSound;
......@@ -668,6 +670,7 @@ extern Game* mainGame;
#define CHECKBOX_ENABLE_MUSIC 366
#define SCROLL_VOLUME 367
#define CHECKBOX_SHOW_ANIME 368
#define CHECKBOX_QUICK_ANIMATION 369
#define COMBOBOX_SORTTYPE 370
#define BUTTON_MARKS_FILTER 380
......
......@@ -2,6 +2,7 @@
#include "game.h"
#include "data_manager.h"
#include <event2/thread.h>
#include <memory>
#ifdef __APPLE__
#import <CoreFoundation/CoreFoundation.h>
#endif
......@@ -61,10 +62,12 @@ int main(int argc, char* argv[]) {
#ifdef _WIN32
int wargc;
wchar_t** wargv = CommandLineToArgvW(GetCommandLineW(), &wargc);
std::unique_ptr<wchar_t*[], void(*)(wchar_t**)> wargv(CommandLineToArgvW(GetCommandLineW(), &wargc), [](wchar_t** wargv) {
LocalFree(wargv);
});
#else
int wargc = argc;
wchar_t (*wargv)[256] = new wchar_t[wargc][256];
auto wargv = std::make_unique<wchar_t[][256]>(wargc);
for(int i = 0; i < argc; ++i) {
BufferIO::DecodeUTF8(argv[i], wargv[i]);
}
......@@ -174,11 +177,6 @@ int main(int argc, char* argv[]) {
}
}
}
#ifdef _WIN32
LocalFree(wargv);
#else
delete[] wargv;
#endif
ygo::mainGame->MainLoop();
#ifdef _WIN32
WSACleanup();
......
......@@ -324,6 +324,7 @@
!system 1294 Normal Chain
!system 1295 Cancel
!system 1296 Finish
!system 1299 Quick Animation
!system 1300 Ban List:
!system 1301 Deck:
!system 1302 Save
......
......@@ -2,7 +2,7 @@
#nickname & gamename should be less than 20 characters
use_d3d = 0
antialias = 2
errorlog = 1
errorlog = 3
nickname = Player
gamename = Game
lastdeck = new
......@@ -12,14 +12,14 @@ serverport = 7911
lasthost = 127.0.0.1
lastport = 7911
automonsterpos = 0
autospellpos = 1
autospellpos = 0
randompos = 0
autochain = 0
waitchain = 0
mute_opponent = 0
mute_spectators = 0
hide_setname = 0
hide_hint_button = 1
hide_hint_button = 0
#control_mode = 0: Key A/S/D/R Chain Buttons. control_mode = 1: MouseLeft/MouseRight/NULL/F9 Without Chain Buttons
control_mode = 0
draw_field_spell = 1
......
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