forked from CortexRoleplaying/CortexEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cortex.galaxy
79 lines (65 loc) · 2.67 KB
/
Cortex.galaxy
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
79
// Cortex SC2 Roleplaying Engine
// Copyright (C) 2009-2011 <http://www.cortexrp.com/>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// 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 "Cortex/Common/Global.galaxy"
include "Cortex/Toolkit/Toolkit.galaxy"
include "Cortex/Chat/Chat.galaxy"
include "Cortex/Events/Events.galaxy"
include "Cortex/Commands/Commands.galaxy"
void libcrtx_Welcome()
{
libcrtx_write(PlayerGroupActive(), "Welcome to Cortex " + IntToString(libcrtx_version_major) + "." + IntToString(libcrtx_version_minor) + "." + IntToString(libcrtx_version_bugfix) + libcrtx_version_hotfix + ". Learn more about Cortex on the web at CortexRP.com, or join our Starcraft II channel, \"Roleplaying\".");
}
bool libcrtx_MapCheck()
{
bool r = true;
// Check for map configuration errors that will degrade quality.
if( MeleeGetOption(1, c_meleeOptionDefeat) || MeleeGetOption(1, c_meleeOptionVictory) ) {
libcrtx_write(PlayerGroupAll(), "Melee trigger usage has been detected.");
r = false;
}
if( PlayerType(libcrtx_setting_getint(libcrtx_setting_int_neutralcomputer)) != c_playerTypeNeutral ) {
libcrtx_write(PlayerGroupAll(), "Incorrect neutral player settings.");
r = false;
}
if( PlayerType(libcrtx_setting_getint(libcrtx_setting_int_hostilecomputer)) != c_playerTypeHostile ) {
libcrtx_write(PlayerGroupAll(), "Incorrect hostile player settings.");
r = false;
}
if( PlayerType(libcrtx_setting_getint(libcrtx_setting_int_smarthostile)) != c_playerTypeComputer ) {
libcrtx_write(PlayerGroupAll(), "Incorrect smarthostile player settings.");
r = false;
}
if( !r ) {
libcrtx_write(PlayerGroupAll(), "One or more errors detected. Cortex has failed to startup.");
libcrtx_write(PlayerGroupAll(), "Engine Version: " + libcrtx_get_versionstring());
libcrtx_write_text(PlayerGroupAll(), StringToText("Please correct your map settings, or contact the author of ") + GameMapName() );
}
return r;
}
void libcrtx_InitLib()
{
libcrtx_set_debug_mode(false); // must be changed for release.
libcrtx_debug("cortex_init()");
// init dependencies
libactionbar_init();
libHash_InitLib();
// cortex main init.
libcrtx_settings_initdefault();
if( libcrtx_MapCheck() ) {
libcrtx_toolkit_init();
libcrtx_commands_init();
libcrtx_chat_init();
libcrtx_admin_init();
libcrtx_events_init();
}
libcrtx_Welcome();
}