Difference between revisions of "TMap.OnAfterMapChange"

From Soldat Community Wiki
Jump to: navigation, search
(new page)
 
m
 
Line 2: Line 2:
 
   Access mode: RW
 
   Access mode: RW
 
   Event handler type: [[TOnAfterMapChangeEvent]]
 
   Event handler type: [[TOnAfterMapChangeEvent]]
   Event handler declaration: procedure (Next: string);
+
   Event handler declaration: procedure (NewMap: string);
  
 
==Description==
 
==Description==
Event property called after the map is loaded, which means all {{link|TMap|Objects}} and {{link|TMap|Spawns}} are already there for the ''Next'' map. {{test|in-depth}}
+
Event property called after the ''NewMap'' is loaded, which means all {{link|TMap|Objects}} and {{link|TMap|Spawns}} are already there for the ''NewMap''. {{test|in-depth}}
  
 
==Example==
 
==Example==
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">
  procedure OnAfter(Next: string);
+
  procedure OnAfter(NewMap: string);
 
  begin
 
  begin
   WriteLn('Map loaded: '+Next);
+
   WriteLn('Map loaded: '+NewMap);
 
  end;
 
  end;
  

Latest revision as of 00:46, 20 September 2018

property OnAfterMapChange
 Access mode: RW
 Event handler type: TOnAfterMapChangeEvent
 Event handler declaration: procedure (NewMap: string);

Description

Event property called after the NewMap is loaded, which means all Objects and Spawns are already there for the NewMap.

Needs testing (in-depth)

Example

 procedure OnAfter(NewMap: string);
 begin
   WriteLn('Map loaded: '+NewMap);
 end;

 // ...

 begin
   // assign OnJoin handler
   Map.OnAfterMapChange := @OnAfter;

   // ...

   // unassign
   Map.OnAfterMapChange := nil;
 end;