Changeset 186 for trunk/lingosource/castlib2/aleXtrasMovieScript.ls
- Timestamp:
- 09/17/08 20:50:38 (4 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib2/aleXtrasMovieScript.ls (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib2/aleXtrasMovieScript.ls
r182 r186 1 -- LDM Xtras Moviescript -- ©05 Alex da Franca -- alex@farbflash.de1 -- aleXtrasMovieScript 2 2 --------------------------------------------------------------------- 3 3 -- CREATED: 4 4 -- 2005 5 5 -- 6 -- PROPERTIES: 7 --!memberProperties: [#name: "aleXtrasMovieScript", #scripttype: #movie, #scriptSyntax: #lingo, #comments:"~/Documents/Scripts/lingo/aleXtrasMovieScript.ls"] 8 -- 6 9 -- DESCRIPTION: 10 -- -- LDM Xtras Moviescript -- c05 Alex da Franca -- alex@farbflash.de 7 11 -- store instances of scripts and bitmaps in a 'global' list (-> property pAleXtras) 8 12 -- and provide access to them for all scripts 9 13 -- 10 14 -- REQUIRES: 11 -- NONE15 -- script "commonmoviescript" 12 16 -- 13 17 -- USAGE: 14 -- put it in one of your castlib, DON'T RENAME MEMBER !! 18 -- put it in one of your castlib, DON'T RENAME THIS MEMBER !! 19 -- use xscr(<name of script as symbol>) to get a reference to the script from 20 -- every script of the movie. It will return an instance of the script 21 -- 22 -- PARAMS: 23 -- - 24 -- 25 -- RETURNS: 26 -- - 27 -- 28 -- WARNINGS: 29 -- - 15 30 -- 16 31 -- TODO: … … 24 39 alextras = (script "aleXtrasMovieScript").pAleXtras 25 40 if not(objectP(alextras)) then 26 alextras = new(script "commonMovieScript") 41 42 cms = member("commonMovieScript") 43 if ilk(cms) <> #member then 44 alert "Script commonMovieScript missing, can't proceed" 45 halt 46 end if 47 if cms.type <> #script then 48 alert "Script commonMovieScript missing, can't proceed" 49 halt 50 end if 51 alextras = rawnew(cms.script) 27 52 if ilk(alextras) <> #instance then 28 alert " HandlerMenu:Script" & QUOTE & "commonMovieScript" & QUOTE && "is missing. This movie can't proceed!"53 alert "Script" & QUOTE & "commonMovieScript" & QUOTE && "is missing. This movie can't proceed!" 29 54 halt 30 55 end if … … 79 104 if ilk(inst) <> #instance then 80 105 if the runmode contains "aut" then 81 put " HandlerMenu:Script" && QUOTE & scrName & QUOTE && "is missing! This may cause unwanted behavior"106 put "Script" && QUOTE & scrName & QUOTE && "is missing! This may cause unwanted behavior" 82 107 end if 83 108 inst = [] … … 200 225 on mLoadScriptsFromLDM whichSprite 201 226 202 cms = xscr()203 globs = cms.mGetGlobalList()204 includes = globs[#gParentScriptInstances]205 if not(objectP(includes)) then206 227 includes = [:] 207 globs[#gParentScriptInstances] = includes208 end if209 228 210 229 tell sprite(whichSprite) … … 216 235 if length(mem.name) > 0 then 217 236 if mem.type = #script then 218 includes.setaProp( mem.name, mem.script)237 includes.setaProp(symbol(mem.name), rawNew(mem.script)) 219 238 end if 220 239 end if … … 222 241 end repeat 223 242 end tell 243 244 cms = includes.getaprop(#commonMovieScript) 245 if not(objectP(cms)) then 246 cms = member("commonMovieScript") 247 if ilk(cms) <> #member then 248 alert "Script commonMovieScript missing, can't proceed" 249 halt 250 end if 251 if cms.type <> #script then 252 alert "Script commonMovieScript missing, can't proceed" 253 halt 254 end if 255 cms = rawnew(cms.script) 256 end if 257 258 (script "aleXtrasMovieScript").pAleXtras = cms 259 260 globs = cms.mGetGlobalList() 261 incl = globs[#gParentScriptInstances] 262 if not(objectP(incl)) then 263 incl = [:] 264 globs[#gParentScriptInstances] = incl 265 end if 266 267 repeat with n = count(incl) down to 1 268 includes.setaprop(incl.getPropAt(n), incl[n]) 269 end repeat 270 includes.deleteOne(#commonMovieScript) 271 globs[#gParentScriptInstances] = includes 224 272 225 273 exit … … 287 335 memref = member(m, cl) 288 336 if memref.type = #script then 289 put "Membername:" && memref.name & TAB & "(" & line 1 of memref.comments &")" & Return after str337 put "Membername:" && memref.name & TAB & "("&memref.comments&")" & Return after str 290 338 end if 291 339 end repeat … … 335 383 if memref.type = #script then 336 384 memname = memref.name 337 comm = line 1 ofmemref.comments385 comm = memref.comments 338 386 if comm.length then 339 387
Note: See TracChangeset
for help on using the changeset viewer.
