Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Ignore:
Timestamp:
12/18/09 15:27:43 (2 years ago)
Author:
alex
Message:

enclosed path to svn application and editor application in quotes, because that fails otherwise, if the path has spaces. what a fun it is to be able to have spaces in file and foldernames... :-(

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib2/aleXtrasMovieScript.ls

    r228 r241  
    22--------------------------------------------------------------------- 
    33-- CREATED: 
    4 --              2005 
     4-- 2005 
    55-- 
    66-- PROPERTIES: 
     
    158158  --         TODO: - 
    159159  ----------------------------------- 
     160   
    160161  exit 
    161162   
    162    
    163   mediaList = mGetAleXtras() 
    164    
    165   theScripts = mediaList.getaprop(#scripts) 
    166   if ilk(theScripts) <> #proplist then 
    167     theScripts = [:] 
    168     mediaList.setaprop(#scripts, theScripts) 
    169   end if 
    170    
    171   if voidP(cls) then 
    172     cls = [] 
    173     cl = the number of castlibs 
    174     repeat with n = 1 to cl 
    175       cls.add(n) 
    176     end repeat 
    177   end if 
    178    
    179   if not listP(cls) then 
    180     cls = [cls] 
    181   end if 
    182    
    183   cl = count(cls) 
    184   repeat with n = 1 to cl 
    185     thisCL = castlib(cls[n]) 
    186     if not voidP(thisCL) then 
    187       clnum = thisCL.number 
    188       num = the number of members of castlib clnum 
    189       repeat with m = 1 to num 
    190         mem = member(m,clnum) 
    191         if length(mem.name) > 0 then 
    192           if mem.type = #script then 
    193             theScripts.setaProp(symbol(mem.name), mem.script) 
    194           end if 
    195         end if 
    196       end repeat 
    197     end if 
    198   end repeat 
    199    
    200 end 
    201  
    202  
    203 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    204  
    205 on mLoadXScript whichName 
    206    
    207   exit 
    208    
    209    
    210   whichName = string(whichName) 
    211   if length(whichName) < 1 then return 0 
    212   scr = member(whichName) 
    213   if ilk(scr) <> #member then return 0 
    214   if scr.type <> #script then return 0 
    215    
    216   scr = script(whichName) 
    217    
    218   mediaList = mGetAleXtras() 
    219    
    220   theScripts = mediaList.getaprop(#scripts) 
    221   if ilk(theScripts) <> #proplist then 
    222     theScripts = [:] 
    223     mediaList.setaprop(#scripts, theScripts) 
    224   end if 
    225   theScripts.setaProp(symbol(whichName), scr) 
    226    
    227   return scr 
     163  -- deprecated handler 
     164  -- only here for bakcward compatibility 
     165  -- the system is now built to load scripts only on demand 
     166  -- exception is mLoadScriptsFromLDM() which needs to grab all scripts 
     167  -- from the ldm and uses them. 
     168  -- be aware of the fact, that rawnew() is used on these scripts, so the ones of the LDM 
     169  -- won't have their new() handler called. I take care about that for you, though... 
     170   
     171end 
     172 
     173 
     174-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     175 
     176on mLoadXScript whichName, dontCallDestroyHandler 
     177  -- overload a script, e.g. after changing at during the movie runs 
     178   
     179  if not(symbolP(whichName)) then whichName = symbol(whichName) 
     180  if voidP(dontCallDestroyHandler) then dontCallDestroyHandler = 1 
     181  xscr().mDeleteInstance(whichName, dontCallDestroyHandler) 
     182   
     183  return xscr(whichName) 
    228184   
    229185end 
     
    233189on mLoadScriptsFromLDM whichSprite 
    234190   
    235     includes = [:] 
     191  includes = [:]  
    236192   
    237193  tell sprite(whichSprite) 
     
    280236   
    281237  exit 
    282   ------------------------------ 
     238  ------------------------------ deprecated: 
    283239   
    284240  mediaList = mGetAleXtras() 
     
    317273 
    318274on mListAleXtras 
    319   put "Handler mListAleXtras deprecated" 
     275   
     276  put "This handler used to put the alextras scripts only, now it puts all singletons instead" 
     277   
     278  globs = xscr().mGetGlobalList() 
     279  incl = globs[#gParentScriptInstances] 
     280  if not(objectP(incl)) then 
     281    put "No scriptinstances stored" 
    320282  exit 
    321    
    322   alextras = (script "aleXtrasMovieScript").pAleXtras 
    323   if voidP(alextras) then mLoadScripts 
    324   scripts = (mGetAleXtras()).getaprop(#scripts) 
    325   anz = count(scripts) 
     283  end if 
     284   
     285  anz = count(incl) 
    326286  repeat with n = 1 to anz 
    327     put RETURN & "scr = mGetXScript(#"&scripts.getPropAt(n)&")" & RETURN 
     287    put RETURN & "scr = mGetXScript(#"&incl.getPropAt(n)&")" & RETURN 
    328288  end repeat 
    329289  put RETURN & "put scr.handlers()" & RETURN 
    330   put RETURN & "put scr.interface()" & RETURN 
     290  put RETURN & "put call(#interface, [scr])" & RETURN 
    331291end 
    332292 
Note: See TracChangeset for help on using the changeset viewer.