Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

TribesGUI.TribesHUDScriptBase


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
//================================================================
// Class: TribesHUDScriptBase
//
// Base hud script class, which loads any user created hud elements.
//
//================================================================

class TribesHUDScriptBase extends HUDContainer
	native
	abstract;

struct native HUDExtension
{
	var() config String ElementName	"Name to load the extension from in the ini file";
	var() config String ClassName	"Fully qualified (package name included) class name of the extension";
	var() config String IniFile		"Ini file to load the extension from";
};

var() config Array<HUDExtension>	ExtensionSpecs;

overloaded function Construct()
{
	super.Construct();

	LoadExtensions();
}

function LoadExtensions()
{
	local class<HUDElement> ExtensionClass;
	local HUDElement NewElement;
	local int i;

	for(i = 0; i < ExtensionSpecs.Length; ++i)
	{
		ExtensionClass = class<HUDElement>(DynamicLoadObject(ExtensionSpecs[i].ClassName, class'Class'));
		NewElement = HUDElement(FindObject(ExtensionSpecs[i].ElementName, ExtensionClass));
		if(NewElement == None)
			NewElement = CreateHUDElement(ExtensionClass, ExtensionSpecs[i].ElementName);

		// add the element
		NewElement.iniOverride = ExtensionSpecs[i].IniFile;
		AddExistingElement(NewElement);

		// do a specific load config with the specced filename if necessary
		if(ExtensionSpecs[i].IniFile != "")
			NewElement.LoadConfig(ExtensionSpecs[i].ElementName, ExtensionClass, ExtensionSpecs[i].IniFile);
	}
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: st 16.4.2014 10:20:46.000 - Creation time: st 23.5.2018 00:10:48.347 - Created with UnCodeX