mirror of
https://github.com/ondra-novak/gates_of_skeldal.git
synced 2025-07-20 22:33:43 -04:00
launcher preparation
This commit is contained in:
parent
d3bbe7b935
commit
86d0919905
3 changed files with 12 additions and 2 deletions
|
@ -15,6 +15,7 @@ typedef struct {
|
|||
const char *patch_file;
|
||||
|
||||
const char *sse_hostport;
|
||||
char launcher; //<run launcher
|
||||
|
||||
} SKELDAL_CONFIG;
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ void show_help(const char *arg0) {
|
|||
"-l <lang> set language (cz|en)\n"
|
||||
"-s <directory> generate string-tables (for localization) and exit\n"
|
||||
"-c <host:port> connect to host:port for remote control (mapedit)\n"
|
||||
"-L run launcher - select workshop adventure\n"
|
||||
"-h this help\n");
|
||||
exit(1);
|
||||
}
|
||||
|
@ -38,13 +39,15 @@ int main(int argc, char **argv) {
|
|||
std::string patch;
|
||||
std::string lang;
|
||||
std::string sse_hostport;
|
||||
for (int optchr = -1; (optchr = getopt(argc, argv, "hf:a:s:l:p:c:")) != -1; ) {
|
||||
bool launcher = false;
|
||||
for (int optchr = -1; (optchr = getopt(argc, argv, "hLf:a:s:l:p:c:")) != -1; ) {
|
||||
switch (optchr) {
|
||||
case 'f': config_name = optarg;break;
|
||||
case 'a': adv_config_file = optarg;break;
|
||||
case 'h': show_help(argv[0]);break;
|
||||
case 'p': patch = optarg; break;
|
||||
case 'l': lang = optarg;break;
|
||||
case 'L': launcher = true;break;
|
||||
case 's': gen_stringtable_path = optarg;break;
|
||||
case 'c': sse_hostport = optarg;break;
|
||||
default: show_help_short();
|
||||
|
@ -62,6 +65,7 @@ int main(int argc, char **argv) {
|
|||
cfg.lang_path = lang.empty()?NULL:lang.c_str();
|
||||
cfg.patch_file = patch.empty()?NULL:patch.c_str();
|
||||
cfg.sse_hostport = sse_hostport.empty()?NULL:sse_hostport.c_str();
|
||||
cfg.launcher = launcher?1:0;
|
||||
try {
|
||||
|
||||
if (!gen_stringtable_path.empty()) {
|
||||
|
|
|
@ -25,6 +25,7 @@ void show_help(std::ostream &out, const char *arg0) {
|
|||
"-l <lang> set language (cz|en)\n"
|
||||
"-s <directory> generate string-tables (for localization) and exit\n"
|
||||
"-c <host:port> connect to host:port for remote control (mapedit)\n"
|
||||
"-L run launcher - select workshop adventure\n"
|
||||
"-h this help\n";
|
||||
}
|
||||
|
||||
|
@ -40,14 +41,17 @@ int main(int argc, char **argv) {
|
|||
std::string lang;
|
||||
std::string patch;
|
||||
std::string sse_hostport;
|
||||
bool launcher = false;
|
||||
std::ostringstream console;
|
||||
for (int optchr = -1; (optchr = getopt(argc, argv, "hf:a:s:l:c:p:")) != -1; ) {
|
||||
for (int optchr = -1; (optchr = getopt(argc, argv, "hLf:a:s:l:c:p:")) != -1; ) {
|
||||
switch (optchr) {
|
||||
case 'f': config_name = optarg;break;
|
||||
case 'a': adv_config_file = optarg;break;
|
||||
case 'h': show_help(console, argv[0]);break;
|
||||
case 'p': patch = optarg; break;
|
||||
case 'l': lang = optarg;break;
|
||||
case 'L': launcher = true;break;
|
||||
|
||||
case 's': gen_stringtable_path = optarg;break;
|
||||
case 'c': sse_hostport = optarg;break;
|
||||
default: show_help_short(console);break;
|
||||
|
@ -72,6 +76,7 @@ int main(int argc, char **argv) {
|
|||
cfg.lang_path = lang.empty()?NULL:lang.c_str();
|
||||
cfg.patch_file = patch.empty()?NULL:patch.c_str();
|
||||
cfg.sse_hostport = sse_hostport.empty()?NULL:sse_hostport.c_str();
|
||||
cfg.launcher = launcher?1:0;
|
||||
|
||||
{
|
||||
std::string msg = console.str();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue