uox3/source/cHTMLSystem.h
Xoduz 342385d2f2 Instance-support and misc code cleanup
Misc code and documentation cleanup:
	Updated and standardized function comment blocks throughout entire codebase
	Grouped getters and setters together in pairs and documented them as one
	Removed empty and/or non-useful information from comment blocks
	Removed unused function from cItem.cpp/h - IncID() - formerly used to change IDs for doors
Added new feature - Instances
	Objects (characters, items, multis, spawnregions) can now make use of a 5th parameter to determine their location in the game world. In addition to the traditional X, Y, Z and WORLDNUMBER parameters, a new one has been added - INSTANCEID - that allows objects to exist at the same coordinates in the same world, but in different "dimensions". Code has been updated in multiple places to support this, and a default instanceID of 0 is assumed if nothing else is specified.
Added support for new DFN tag in town regions, spawn regions and locations - INSTANCEID (defaults to 0 if not present)
Added support for another start location parameter after worldNum in UOX.INI representing instanceID (defaults to 0 if not present)
Updated TWEAK menu to include WorldNumber and instanceID
Fixed BaseWeight option in TWEAK menu
Updated CBase_Teleport - now takes an optional 5th parameter instanceID
Updated SE_SpawnNPC now takes an optional 5th parameter - instanceID
Updated SE_FindMulti now takes an optional 5th parameter - instanceID
Updated SE_GetItem now takes an optional 5th parameter - instanceID
Updated SE_FindItem now takes an optional 6th parameter - instanceID
Added new JS property for Items, Characters, Regions: .instanceID
Added JS property for Regions: .members - returns comma-separated list of town member serials
Updated JS scripts making use of the above-mentioned JS Methods/Functions
Updated dictionaries with new tweak menu entry texts
Exposed SpawnRegions to JS engine, and updated JS docs with details:
	SpawnRegion JS Functions
		IterateOverSpawnRegions()
		GetSpawnRegion( spawnRegNum )
		GetSpawnRegionCount()
	SpawnRegion JS Properties
		name
		regionNum
		itemList
		npcList
		item
		npc
		maxItems
		maxNpcs
		itemCount
		npcCount
		onlyOutside
		prefZ
		x1
		y1
		x2
		y2
		world
		instanceID
		minTime
		maxTime
		call
2020-08-08 13:57:15 +08:00

79 lines
1.6 KiB
C++

//o-----------------------------------------------------------------------------------------------o
//| File - cHTMLSystem.h
//o-----------------------------------------------------------------------------------------------o
//| Purpose - Interface for the cHTMLSystem class
//o-----------------------------------------------------------------------------------------------o
#ifndef __CHTMLSYSTEM_H__
#define __CHTMLSYSTEM_H__
#if defined(_MSC_VER)
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#endif
namespace UOX
{
enum ETemplateType
{
ETT_ALLTEMPLATES = -1,
ETT_GMSTATUS =0 ,
ETT_GUILD,
ETT_OFFLINE,
ETT_PLAYER,
ETT_ONLINE,
ETT_INVALIDTEMPLATE = 0xFF
};
class cHTMLTemplate
{
private:
UI32 UpdateTimer;
std::string InputFile;
bool Loaded;
ETemplateType Type;
std::string Content;
std::string OutputFile;
std::string Name;
UI32 ScheduledUpdate;
public:
cHTMLTemplate();
~cHTMLTemplate();
void Process( void );
void Poll( void );
void LoadTemplate( void );
void UnloadTemplate( void );
void Load( ScriptSection *found );
// Some Getters
std::string GetName( void ) const;
std::string GetOutput( void ) const;
std::string GetInput( void ) const;
ETemplateType GetTemplateType( void ) const;
UI32 GetScheduledUpdate( void ) const;
UI32 GetUpdateTimer( void ) const;
};
class cHTMLTemplates
{
private:
std::vector < cHTMLTemplate* > Templates;
public:
cHTMLTemplates();
~cHTMLTemplates();
void Load( void );
void Unload( void );
void Poll( ETemplateType nTemplateID = ETT_ALLTEMPLATES );
void TemplateInfoGump( CSocket *mySocket );
};
extern cHTMLTemplates *HTMLTemplates;
}
#endif