Skip to content

Commit

Permalink
update mark for OCG/TCG cards (#2048)
Browse files Browse the repository at this point in the history
  • Loading branch information
mercury233 committed Nov 20, 2017
1 parent 5900168 commit 988e591
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
11 changes: 10 additions & 1 deletion gframe/drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,16 @@ void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, i
break;
}
}
if(mainGame->cbLimit->getSelected() >= 4) {
if(mainGame->cbLimit->getSelected() >= 4 && (cp->second.ot & mainGame->gameConf.defaultOT)) {
switch(cp->second.ot) {
case 1:
driver->draw2DImage(imageManager.tOT, recti(pos.X + 7, pos.Y + 50, pos.X + 37, pos.Y + 65), recti(0, 128, 128, 192), 0, 0, true);
break;
case 2:
driver->draw2DImage(imageManager.tOT, recti(pos.X + 7, pos.Y + 50, pos.X + 37, pos.Y + 65), recti(0, 192, 128, 256), 0, 0, true);
break;
}
} else if(mainGame->cbLimit->getSelected() >= 4 || !(cp->second.ot & mainGame->gameConf.defaultOT)) {
switch(cp->second.ot) {
case 1:
driver->draw2DImage(imageManager.tOT, recti(pos.X + 7, pos.Y + 50, pos.X + 37, pos.Y + 65), recti(0, 0, 128, 64), 0, 0, true);
Expand Down
5 changes: 5 additions & 0 deletions gframe/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ bool Game::Initialize() {
cbRule->addItem(dataManager.GetSysString(1241));
cbRule->addItem(dataManager.GetSysString(1242));
cbRule->addItem(dataManager.GetSysString(1243));
cbRule->setSelected(gameConf.defaultOT - 1);
env->addStaticText(dataManager.GetSysString(1227), rect<s32>(20, 90, 220, 110), false, false, wCreateHost);
cbMatchMode = env->addComboBox(rect<s32>(140, 85, 300, 110), wCreateHost);
cbMatchMode->addItem(dataManager.GetSysString(1244));
Expand Down Expand Up @@ -935,6 +936,7 @@ void Game::LoadConfig() {
gameConf.separate_clear_button = 1;
gameConf.auto_search_limit = -1;
gameConf.chkIgnoreDeckChanges = 0;
gameConf.defaultOT = 1;
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) {
Expand Down Expand Up @@ -993,6 +995,8 @@ void Game::LoadConfig() {
gameConf.auto_search_limit = atoi(valbuf);
} else if(!strcmp(strbuf, "ignore_deck_changes")) {
gameConf.chkIgnoreDeckChanges = atoi(valbuf);
} else if(!strcmp(strbuf, "default_ot")) {
gameConf.defaultOT = atoi(valbuf);
} else {
// options allowing multiple words
sscanf(linebuf, "%s = %240[^\n]", strbuf, valbuf);
Expand Down Expand Up @@ -1051,6 +1055,7 @@ void Game::SaveConfig() {
fprintf(fp, "#auto_search_limit >= 0: Start search automatically when the user enters N chars\n");
fprintf(fp, "auto_search_limit = %d\n", gameConf.auto_search_limit);
fprintf(fp, "ignore_deck_changes = %d\n", ((mainGame->chkIgnoreDeckChanges->isChecked()) ? 1 : 0));
fprintf(fp, "default_ot = %d\n", gameConf.defaultOT);
fclose(fp);
}
void Game::ShowCardInfo(int code) {
Expand Down
1 change: 1 addition & 0 deletions gframe/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct Config {
int separate_clear_button;
int auto_search_limit;
int chkIgnoreDeckChanges;
int defaultOT;
};

struct DuelInfo {
Expand Down
1 change: 1 addition & 0 deletions system.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ separate_clear_button = 1
#auto_search_limit >= 0: Start search automatically when the user enters N chars.
auto_search_limit = -1
ignore_deck_changes = 0
default_ot = 1
Binary file modified textures/ot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 988e591

Please sign in to comment.