Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Event Table
- // Author: McTwist (9845)
- // Date: 2017-11-26
- //
- // Makes it possible for easier access for event variables through a table.
- // Some is even replacing existing functionality for increased performance.
- // Register input event
- function clientCmdRegisterInputEvent(%class, %name, %targetList)
- {
- $InputEvent_Count[%class] += 0;
- if ($InputEvent_Table[%class, %name] $= "")
- {
- $InputEvent_Table[%class, %name] = $InputEvent_Count[%class];
- $InputEvent_Count[%class]++;
- }
- $InputEvent_TargetList[%class, $InputEvent_Table[%class, %name]] = %targetList;
- if (SaveBricksGui.isAwake())
- {
- SaveBricks_DownloadText.setText(SaveBricks_DownloadText.getText() + 1);
- }
- }
- // Register output event
- function clientCmdRegisterOutputEvent(%class, %name, %a, %b, %c, %d)
- {
- %parameterList = %a @ %b @ %c @ %d;
- $OutputEvent_Count[%class] += 0;
- if ($OutputEvent_Table[%class, %name] $= "")
- {
- $OutputEvent_Table[%class, %name] = $OutputEvent_Count[%class];
- $InputEvent_Count[%class]++;
- }
- $OutputEvent_parameterList[%class, $OutputEvent_Table[%class, %name]] = %parameterList;
- if (SaveBricksGui.isAwake())
- {
- SaveBricks_DownloadText.setText(SaveBricks_DownloadText.getText() + 1);
- }
- }
- // Add NT name on client
- function SimGroup::CLIENTaddNTName(%obj, %name)
- {
- %obj.NTNameCount += 0;
- if (%obj.NTTable[%name] $= "")
- {
- %obj.NTTable[%name] = %obj.NTNameCount;
- %obj.NTName[%obj.NTNameCount] = %name;
- %obj.NTNameCount++;
- }
- }
- // Remove NT name on client
- function SimGroup::CLIENTremoveNTName(%obj, %name)
- {
- %obj.NTNameCount += 0;
- if (%obj.NTTable[%name] !$= "")
- {
- // Replace current index with the new name
- if (%obj.NTNameCount > 1)
- {
- %i = %obj.NTTable[%name];
- %moveName = %obj.NTName[%obj.NTNameCount - 1];
- %obj.NTName[%i] = %moveName;
- %obj.NTTable[%moveName] = %i;
- }
- // Remove name from table
- %obj.NTTable[%name] = "";
- %obj.NTName[%obj.NTNameCount - 1] = "";
- %obj.NTNameCount--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement