summaryrefslogtreecommitdiffstats
path: root/knetwalk/src/main.cpp
blob: 326ed74ce7008b7def6f36c4a674e960d388ed47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/***************************************************************************
 *   Copyright (C) 2005, Thomas Nagy                                       *
 *   tnagyemail-mail@yahoo@fr                                              *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License version 2        *
 *   as published by the Free Software Foundation (see COPYING)            *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 ***************************************************************************/

#include <tdeapplication.h>
#include <tdeaboutdata.h>
#include <tdecmdlineargs.h>
#include <klocale.h>
#include <kdebug.h>
#include <khighscore.h>

#include "highscores.h"
#include "settings.h"
#include "mainwindow.h"

static const char description[] =
I18N_NOOP("KNetWalk, a game for system administrators.");

static const char version[] = "1.0";

static TDECmdLineOptions options[] =
{
	{ "Novice", I18N_NOOP( "Start in novice mode" ), 0 },
	{ "Normal", I18N_NOOP( "Start in normal mode" ), 0 },
	{ "Expert", I18N_NOOP( "Start in expert mode" ), 0 },
	{ "Master", I18N_NOOP( "Start in master mode" ), 0 },
	TDECmdLineLastOption
};

int main(int argc, char ** argv)
{
	TDEAboutData about("knetwalk", I18N_NOOP("knetwalk"), version, description,
		TDEAboutData::License_GPL, I18N_NOOP("(C) 2004, 2005 Andi Peredri, ported to KDE by Thomas Nagy"), 0, 
		"tnagyemail-mail@yahoo.fr");
	about.addAuthor( "Andi Peredri", 0, "andi@ukr.net" );
	about.addAuthor( "Thomas Nagy", 0, "tnagy2^8@yahoo.fr" );

	TDECmdLineArgs::init(argc, argv, &about);
	TDECmdLineArgs::addCmdLineOptions(options);

	TDEApplication app;

	TDEGlobal::locale()->insertCatalogue("libtdegames");

	TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
	if (args->isSet("Novice")) Settings::setSkill(Settings::EnumSkill::Novice);
	if (args->isSet("Normal")) Settings::setSkill(Settings::EnumSkill::Normal);
	if (args->isSet("Expert")) Settings::setSkill(Settings::EnumSkill::Expert);
	if (args->isSet("Master")) Settings::setSkill(Settings::EnumSkill::Master);
	args->clear();	
	
	KHighscore::init("knetwalk");
	KExtHighscore::ExtManager manager;


	MainWindow* wi = new MainWindow;
	app.setMainWidget(wi);
	wi->show();

	return app.exec();
}