-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.cpp
78 lines (69 loc) · 5.6 KB
/
main.cpp
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
73
74
75
76
77
78
#include <QtGui/QApplication>
//#include <QWindowsMime>
#include "tibiaeditor.h"
#include "resourcehandler.h"
#include "formathandler.h"
/*#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>*/
#ifndef NO_STARTUP
#include <QDialog>
#include <QLabel>
#include <QVBoxLayout>
#endif
TibiaHandler g_tibiaHandler;
ResourceHandler g_resourceHandler;
FormatHandler g_formatHandler;
Q_DECLARE_METATYPE( ResourceList )
Q_DECLARE_METATYPE( ItemList )
int main( int argc, char *argv[] )
{
//_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
QApplication application( argc, argv );
QCoreApplication::setApplicationVersion( "6.7" );
QCoreApplication::setApplicationName( "Tibia Editor" );
QCoreApplication::setOrganizationName( "Demonic Applications" );
qRegisterMetaType<ResourceList>( "ResourceList" );
qRegisterMetaType<ItemList>( "ItemList" );
#ifndef NO_STARTUP
QDialog *dialog = new QDialog( NULL );
dialog->setWindowFlags( Qt::Tool );
if( dialog->objectName().isEmpty() )
dialog->setObjectName( QString::fromUtf8( "Dialog" ) );
dialog->resize( 250, 250 );
dialog->setMinimumSize( QSize( 250, 250 ) );
dialog->setMaximumSize( QSize( 250, 250 ) );
dialog->setStyleSheet(QString::fromUtf8("QDialog { background-image: url(:/TibiaEditor/Resources/SplashScreen.png); }"));
QVBoxLayout *verticalLayout = new QVBoxLayout( dialog );
verticalLayout->setSpacing( 5 );
verticalLayout->setMargin( 5 );
verticalLayout->setObjectName( QString::fromUtf8( "verticalLayout" ) );
QLabel *label = new QLabel( dialog );
label->setObjectName( QString::fromUtf8( "label" ) );
label->setAlignment( Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter );
label->setWordWrap( true );
label->setOpenExternalLinks( true );
verticalLayout->addWidget( label );
dialog->setWindowTitle(QApplication::translate("Dialog", "TE6.7A", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("Dialog", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; color:#ffffff;\">You are using an Alpha version of TibiaEditor V6.7, functions are limited.</span></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; color:#ffffff;\"></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; color:#ffffff;\">If you would like to make a donation, click the link below.</span></p>\n"
"<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=10112933\"><span style=\" font-size:18pt; text-decoration: underline; color:#ff0004;\">Donate</span></a></p></body></html>", 0, QApplication::UnicodeUTF8));
dialog->exec();
#endif
TibiaEditor window;
QObject::connect( &application, SIGNAL( focusChanged( QWidget *, QWidget * ) ), &window, SLOT( onFocusChanged( QWidget *, QWidget * ) ) );
window.show();
return application.exec();
}