core/CoreConfig.h
author David Anderson <dvander@alliedmods.net>
Sun Aug 19 18:34:36 2007 +0000 (2007-08-19)
changeset 1361 591f6d2fd11d
parent 1330 ab94316bb52b
child 1541 e46ad208b9b4
permissions -rw-r--r--
added helper function for panel text
ds@661
     1
/**
ds@661
     2
 * vim: set ts=4 :
ds@1330
     3
 * =============================================================================
dvander@1231
     4
 * SourceMod
dvander@1231
     5
 * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
ds@1330
     6
 * =============================================================================
ds@661
     7
 *
ds@1330
     8
 * This program is free software; you can redistribute it and/or modify it under
ds@1330
     9
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1330
    10
 * Free Software Foundation.
dvander@1231
    11
 * 
ds@1330
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1330
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1330
    14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1330
    15
 * details.
dvander@1231
    16
 *
ds@1330
    17
 * You should have received a copy of the GNU General Public License along with
ds@1330
    18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@1231
    19
 *
ds@1330
    20
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1330
    21
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1330
    22
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1330
    23
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1330
    24
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1330
    25
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1330
    26
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1330
    27
 * or <http://www.sourcemod.net/license.php>.
ds@661
    28
 *
ds@661
    29
 * Version: $Id$
ds@661
    30
 */
ds@661
    31
ds@661
    32
#ifndef _INCLUDE_SOURCEMOD_CORECONFIG_H_
ds@661
    33
#define _INCLUDE_SOURCEMOD_CORECONFIG_H_
ds@661
    34
ds@661
    35
#include "sm_globals.h"
ds@661
    36
#include <ITextParsers.h>
ds@661
    37
#include <IRootConsoleMenu.h>
ds@661
    38
ds@661
    39
using namespace SourceMod;
ds@661
    40
ds@661
    41
class CoreConfig : 
ds@661
    42
	public SMGlobalClass,
ds@661
    43
	public ITextListener_SMC,
ds@661
    44
	public IRootConsoleCommand
ds@661
    45
{
ds@661
    46
public: // SMGlobalClass
ds@661
    47
	void OnSourceModAllInitialized();
ds@661
    48
	void OnSourceModShutdown();
dvander@978
    49
	void OnSourceModLevelChange(const char *mapName);
ds@661
    50
public: // ITextListener_SMC
ds@661
    51
	SMCParseResult ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes);
ds@661
    52
public: // IRootConsoleCommand
ds@661
    53
	void OnRootConsoleCommand(const char *command, unsigned int argcount);
ds@661
    54
public:
ds@661
    55
	/**
ds@661
    56
	 * Initializes CoreConfig by reading from core.cfg file
ds@661
    57
	 */
ds@661
    58
	void Initialize();
ds@661
    59
private:
ds@661
    60
	/**
ds@661
    61
	 * Sets configuration option by notifying SourceMod components that rely on core.cfg
ds@661
    62
	 */
dvander@663
    63
	ConfigResult SetConfigOption(const char *option, const char *value, ConfigSource, char *Error, size_t maxlength);
ds@661
    64
};
ds@661
    65
dvander@978
    66
extern bool SM_AreConfigsExecuted();
dvander@978
    67
extern void SM_ExecuteAllConfigs();
dvander@978
    68
extern void SM_ExecuteForPlugin(IPluginContext *ctx);
dvander@978
    69
extern void SM_ConfigsExecuted_Global();
dvander@978
    70
extern void SM_ConfigsExecuted_Plugin(unsigned int serial);
dvander@978
    71
ds@661
    72
extern CoreConfig g_CoreConfig;
ds@661
    73
ds@661
    74
#endif // _INCLUDE_SOURCEMOD_CORECONFIG_H_