summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 21:10:31 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-13 21:11:37 +0100
commitd0a64ce8e1bad687756ea34e5388c5f103639fb3 (patch)
tree6e126afa725b591fde70e791eca4d083491c8177
parentb6eb0e404e74bad6d522bac7e07990f0b10b2703 (diff)
downloadmana-d0a64ce8e1bad687756ea34e5388c5f103639fb3.tar.gz
mana-d0a64ce8e1bad687756ea34e5388c5f103639fb3.tar.bz2
mana-d0a64ce8e1bad687756ea34e5388c5f103639fb3.tar.xz
mana-d0a64ce8e1bad687756ea34e5388c5f103639fb3.zip
Got rid of confusing --default parameter
It was only used to automatically choose the character. For choosing the character, --playername can be used.
-rw-r--r--src/main.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5159712e..cd7a11ed 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -140,14 +140,12 @@ struct Options
printHelp(false),
printVersion(false),
skipUpdate(false),
- chooseDefault(false),
serverPort(0)
{};
bool printHelp;
bool printVersion;
bool skipUpdate;
- bool chooseDefault;
std::string playername;
std::string password;
std::string configPath;
@@ -455,7 +453,6 @@ void printHelp()
" -d --data : Directory to load game data from\n"
" -U --username : Login with this username\n"
" -P --password : Login with this password\n"
- " -D --default : Bypass the login process with default settings\n"
" -s --server : Login Server name or IP\n"
" -o --port : Login Server Port\n"
" -p --playername : Login with this player\n"
@@ -484,7 +481,6 @@ void parseOptions(int argc, char *argv[], Options &options)
{ "data", required_argument, 0, 'd' },
{ "username", required_argument, 0, 'U' },
{ "password", required_argument, 0, 'P' },
- { "default", no_argument, 0, 'D' },
{ "server", required_argument, 0, 's' },
{ "port", required_argument, 0, 'o' },
{ "playername", required_argument, 0, 'p' },
@@ -494,7 +490,6 @@ void parseOptions(int argc, char *argv[], Options &options)
};
while (optind < argc) {
-
int result = getopt_long(argc, argv, optstring, long_options, NULL);
if (result == -1)
@@ -520,9 +515,6 @@ void parseOptions(int argc, char *argv[], Options &options)
case 'P':
options.password = optarg;
break;
- case 'D':
- options.chooseDefault = true;
- break;
case 's':
options.serverName = optarg;
break;
@@ -1089,20 +1081,15 @@ int main(int argc, char *argv[])
case STATE_CHAR_SELECT:
logger->log("State: CHAR_SELECT");
currentDialog =
- new CharSelectDialog(&charInfo, &loginData);
+ new CharSelectDialog(&charInfo, &loginData);
if (((CharSelectDialog*) currentDialog)->
- selectByName(options.playername))
- options.chooseDefault = true;
- else
- ((CharSelectDialog*) currentDialog)->selectByName(
- config.getValue("lastCharacter", ""));
-
- if (options.chooseDefault)
- {
+ selectByName(options.playername)) {
((CharSelectDialog*) currentDialog)->action(
gcn::ActionEvent(NULL, "ok"));
- options.chooseDefault = false;
+ } else {
+ ((CharSelectDialog*) currentDialog)->selectByName(
+ config.getValue("lastCharacter", ""));
}
break;
@@ -1115,7 +1102,7 @@ int main(int argc, char *argv[])
case STATE_CHANGEEMAIL:
logger->log("State: CHANGE EMAIL");
currentDialog = new OkDialog("Email Address change",
- "Email Address changed successfully!");
+ "Email Address changed successfully!");
currentDialog->addActionListener(&accountListener);
currentDialog = NULL; // OkDialog deletes itself
loginData.email = loginData.newEmail;