ISXDK:ISInterface

From Lavish Software Wiki
Revision as of 23:21, 22 July 2005 by Lax (talk | contribs)
Jump to navigation Jump to search

Overview

ISInterface is the interface given to your extension to communicate directly with Inner Space. The functions provided should be sufficient to perform any necessary task. If this is NOT sufficient, please post on our forums requesting whatever features you need.

Functions

Base

 unsigned long GetVersion()

Extensions

 bool LoadExtension(char *Filename)
 bool UnloadExtension(char *Filename)
 bool IsExtensionLoaded(char *Filename)

Paths

 void GetInnerSpacePath(char *buffer, unsigned long buflen)
 char *GetCWD()
 void SetRoot(char *Filename, char *Dest)

Services

Master
 HISXSERVICE RegisterService(ISXInterface *pMaster, char *Name, fISServiceRequest RequestCallback=0)
 bool ServiceBroadcast(ISXInterface *pMaster, HISXSERVICE hService, unsigned long MSG, void *lpData)
 bool ServiceNotify(ISXInterface *pMaster, HISXSERVICE hService, ISXInterface *pTarget, unsigned long MSG, void *lpData)
 bool ShutdownService(ISXInterface *pMaster, HISXSERVICE hService)
Client
 HISXSERVICE ConnectService(ISXInterface *pClient, char *ServiceName, fISService NotifyCallback)
 bool ServiceRequest(ISXInterface *pClient, HISXSERVICE hService, unsigned long MSG, void *lpData)
 void DisconnectService(ISXInterface *pClient, HISXSERVICE hService)

LavishScript

 bool AddCommand(char *Command, fLSCommand Function, bool Parse=true, bool Hidden=false)
 bool RemoveCommand(char *Command)
 bool AddAlias(char *Replace, char *With)
 bool RemoveAlias(char *Replace)
 char *GetArgs(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
 char *GetArgsQuoted(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
 char *GetArgsQuotedNF(int BeginInclusive, int EndExclusive, char *argv[], char *buf)
 void ExecuteTimedCommand(unsigned long DelayMS, const char *Command)
 int ExecuteCommand(const char *Text)
 bool DataParse(char *ToParse)
 bool RunScript(char *Filename)
 bool EndScript(char *Filename)
 bool RunCommandFile(char *Filename)
 bool AddTopLevelObject(char *Name, fLSTopLevelObject Function)
 bool RemoveTopLevelObject(char *Name)
 bool AddLSType(class LSType &Type)
 bool RemoveLSType(class LSType &Type)
 LSType *FindLSType(char *Name)
 bool IsCommand(char *Name)
 bool IsAlias(char *Name)
 bool IsTopLevelObject(char *Name)
 bool IsLSType(char *Name)
 bool ResolveCommand(char *Text, char *buf,unsigned long buflen)

Scripts

 char *GetCurrentScript()
 unsigned long EnumScripts(fScriptEnumCallback Callback, void *pData)
 bool GetScriptCWD(char *ScriptName, char *buffer, unsigned long buflen)
 bool QueueCommand(char *ScriptName, char *Command)
 unsigned long GetScriptRuntime(char *ScriptName)
 unsigned long PauseScripts()
 unsigned long ResumeScripts()

Input

 bool AddHotkey(char *Name, char *Combo, char *Command, bool Press=false)
 bool IsHotkey(char *Name)
 bool RemoveHotkey(char *Name)
 bool MouseTo(int X, int Y)
 bool GetMousePos(int &X, int &Y)
 bool EmulateKeyPress(char *Combo, bool Hold)
 bool EmulateKeyRelease(char *Combo)
 bool EmulateTyping(char *Text)
 bool EmulateMousePress(unsigned long Button, bool Hold)
 bool EmulateMouseRelease(unsigned long Button)
 void DirectInputMousePosition(int X, int Y)

Display

 bool GetDisplaySize(unsigned long &Height, unsigned long &Width)
 bool GetPixel(int X, int Y, RGBCOLOR &Color)
 bool GetPixels(int X, int Y, unsigned long nRows, unsigned long nColumns, RGBCOLOR **Rows)

Main HUD

 bool AddElement(char *Name, char *Data, int X, int Y, unsigned long Color, char *Group="Default")
 bool RemoveElement(char *Name)

Console

 void Printf(const char *Format, ...)
 unsigned long GetConsoleWidth()	// width of console, in characters
 void ClearConsole()

Inter-Process

 void Relay(char *Session, char *Command)
 unsigned long GetSessionCount()
 bool GetSessionName(unsigned long nSession, char *buf, int buflen)

Settings

Game
 void GetGameName(char *buf, unsigned long buflen)
 bool GetGameSetting(char *Setting, char *buf, unsigned long buflen)
 void SetGameSetting(char *Setting, char *Value)
 void SaveGames()
Profile
 void GetProfileName(char *buf, unsigned long buflen)
 bool GetProfileSetting(char *Setting, char *buf, unsigned long buflen)
 void SetProfileSetting(char *Setting, char *Value)
 void SaveProfiles()
Setting Files
 bool OpenSettings(char *Filename)
 bool SaveSettings(char *Filename)
 bool UnloadSettings(char *Filename)
 bool GetSetting(char *Filename, char *Set, char *Setting, char *buf, unsigned long buflen)
 bool SetSetting(char *Filename, char *Set, char *Setting, char *Value)
 bool GetSettingb(char *Filename, char *Set, char *Setting, bool &bValue)
 bool GetSettingi(char *Filename, char *Set, char *Setting, int &iValue)
 bool SetSettingi(char *Filename, char *Set, char *Setting, int iValue)
 bool GetSettingf(char *Filename, char *Set, char *Setting, float &fValue)
 bool SetSettingf(char *Filename, char *Set, char *Setting, float fValue)
 void EnumSets(char *Filename, fSetEnumCallback Callback, void *pData)
 void EnumSettings(char *Filename, char *Set, fSettingEnumCallback Callback, void *pData)

Miscellaneous

 unsigned long GetRuntime()
 char *Escape(char *text, char *buf, int buflen)
 char *EscapeQuotes(char *text, char *buf, int buflen)
 bool CalculateResult(const char *Formula, double &Result)

Navigation

 bool NavigationLoadXML(char *Filename)
 bool NavigationDumpXML(char *Filename)
 void NavigationClearPoints()
 bool NavigationGetPoint3f(char *World, char *Name, POINT3F &Dest)
 bool NavigationSetPoint3f(char *World, char *Name, POINT3F &Pt)
 bool NavigationGetPath(char *World, char *From, char *To, CNavPath &Dest)
 bool NavigationGetNearestPoint(char *World, POINT3F &To, POINT3F &Dest)
 void NavigationRemovePoint(char *World, char *Name)
 bool NavigationAddConnection(char *World, char *From, char *To)
 void NavigationRemoveConnection(char *World, char *From, char *To)

See Also