Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deatmatch bug + Adding monsters box drop-down-list #15

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/ZDLSettingsPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ protected slots:
protected:
QStringList getFilesMaps();
QComboBox *diffList;
QComboBox *monstersList;
QComboBox *sourceList;
QListWidget *IWADList;
QComboBox *warpCombo;
Expand Down
48 changes: 29 additions & 19 deletions src/ZDLMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,19 +402,28 @@ QString ZDLMainWindow::getArgumentsString(bool native_sep)
}
}

if (zconf->hasValue("zdl.save", "skill")){
if (zconf->hasValue("zdl.save", "monsters")){
bool ok;
QString s_skill=zconf->getValue("zdl.save", "skill");
int i_skill=s_skill.toInt(&ok, 10);

if (i_skill>0&&i_skill<6) {
args.append(" -skill ");
args.append(s_skill);
} else if (i_skill==6) {
args.append(" -nomonsters");
int i_monsters=zconf->getValue("zdl.save", "monsters").toInt(&ok, 10);
if (i_monsters > 0){
if (i_monsters == 1){
args.append(" -nomonsters");
} else {
if (i_monsters % 2 == 0){
args.append(" -fast");
}
if (i_monsters >= 3){
args.append(" -respawn");
}
}
}
}

if (zconf->hasValue("zdl.save", "skill")){
args.append(" -skill ");
args.append(zconf->getValue("zdl.save", "skill"));
}

if (zconf->hasValue("zdl.save", "warp")){
QString map_arg=zconf->getValue("zdl.save", "warp");
QStringList warp_args=WarpBackwardCompat(iwadPath, map_arg);
Expand Down Expand Up @@ -505,7 +514,7 @@ QString ZDLMainWindow::getArgumentsString(bool native_sep)
}

if (tGameType == "2"){
args.append(" -deathmath");
args.append(" -deathmatch");
} else if (tGameType == "3"){
args.append(" -altdeath");
}
Expand Down Expand Up @@ -639,15 +648,16 @@ QStringList ZDLMainWindow::getArgumentsList()
}
}

if (zconf->hasValue("zdl.save", "skill")){
if (zconf->hasValue("zdl.save", "monsters")){
bool ok;
QString s_skill=zconf->getValue("zdl.save", "skill");
int i_skill=s_skill.toInt(&ok, 10);

if (i_skill>0&&i_skill<6) {
args<<"-skill"<<s_skill;
} else if (i_skill==6) {
args<<"-nomonsters";
int i_monsters=zconf->getValue("zdl.save", "monsters").toInt(&ok, 10);
if (i_monsters > 0){
if (i_monsters == 1){
args << "-nomonsters";
} else {
if (i_monsters % 2 == 0) args << "-fast";
if (i_monsters >= 3) args << "-respawn";
}
}
}

Expand Down Expand Up @@ -736,7 +746,7 @@ QStringList ZDLMainWindow::getArgumentsList()
}

if (tGameType == "2"){
args<<"-deathmath";
args<<"-deathmatch";
} else if (tGameType == "3"){
args<<"-altdeath";
}
Expand Down
39 changes: 38 additions & 1 deletion src/ZDLSettingsPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ ZDLSettingsPane::ZDLSettingsPane(QWidget *parent):ZDLWidget(parent){
QVBoxLayout *skillBox = new QVBoxLayout();
box2->addLayout(skillBox);

QVBoxLayout *monstersBox = new QVBoxLayout();
box2->addLayout(monstersBox);

warpCombo = new VerboseComboBox(this);
connect(warpCombo, SIGNAL(activated(int)), this, SLOT(currentRowChanged(int)));
connect(warpCombo, SIGNAL(onPopup()), this, SLOT(VerbosePopup()));