Changeset 241 for trunk/lingosource/castlib2/aleXtrasMovieScript.ls
- Timestamp:
- 12/18/09 15:27:43 (2 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib2/aleXtrasMovieScript.ls (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib2/aleXtrasMovieScript.ls
r228 r241 2 2 --------------------------------------------------------------------- 3 3 -- CREATED: 4 -- 20054 -- 2005 5 5 -- 6 6 -- PROPERTIES: … … 158 158 -- TODO: - 159 159 ----------------------------------- 160 160 161 exit 161 162 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 171 end 172 173 174 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 175 176 on 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) 228 184 229 185 end … … 233 189 on mLoadScriptsFromLDM whichSprite 234 190 235 includes = [:]191 includes = [:] 236 192 237 193 tell sprite(whichSprite) … … 280 236 281 237 exit 282 ------------------------------ 238 ------------------------------ deprecated: 283 239 284 240 mediaList = mGetAleXtras() … … 317 273 318 274 on 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" 320 282 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) 326 286 repeat with n = 1 to anz 327 put RETURN & "scr = mGetXScript(#"& scripts.getPropAt(n)&")" & RETURN287 put RETURN & "scr = mGetXScript(#"&incl.getPropAt(n)&")" & RETURN 328 288 end repeat 329 289 put RETURN & "put scr.handlers()" & RETURN 330 put RETURN & "put scr.interface()" & RETURN290 put RETURN & "put call(#interface, [scr])" & RETURN 331 291 end 332 292
Note: See TracChangeset
for help on using the changeset viewer.
