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

Ignore:
Timestamp:
09/17/08 20:50:38 (4 years ago)
Author:
alex
Message:

incorporated changes to library scripts

File:
1 edited

Legend:

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

    r182 r186  
    1 -- LDM Xtras Moviescript -- ©05 Alex da Franca -- alex@farbflash.de 
     1-- aleXtrasMovieScript 
    22--------------------------------------------------------------------- 
    33-- CREATED: 
    44--              2005 
    55-- 
     6-- PROPERTIES: 
     7--!memberProperties: [#name: "aleXtrasMovieScript", #scripttype: #movie, #scriptSyntax: #lingo, #comments:"~/Documents/Scripts/lingo/aleXtrasMovieScript.ls"] 
     8-- 
    69-- DESCRIPTION: 
     10--             -- LDM Xtras Moviescript -- c05 Alex da Franca -- alex@farbflash.de 
    711-- store instances of scripts and bitmaps in a 'global' list (-> property pAleXtras) 
    812-- and provide access to them for all scripts 
    913-- 
    1014-- REQUIRES: 
    11 --              NONE 
     15--            script "commonmoviescript" 
    1216-- 
    1317-- 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-- - 
    1530-- 
    1631-- TODO: 
     
    2439  alextras = (script "aleXtrasMovieScript").pAleXtras 
    2540  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) 
    2752    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!" 
    2954      halt 
    3055    end if 
     
    79104  if ilk(inst) <> #instance then 
    80105    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" 
    82107    end if 
    83108      inst = [] 
     
    200225on mLoadScriptsFromLDM whichSprite 
    201226   
    202   cms = xscr() 
    203   globs = cms.mGetGlobalList() 
    204   includes = globs[#gParentScriptInstances] 
    205   if not(objectP(includes)) then 
    206227    includes = [:] 
    207     globs[#gParentScriptInstances] = includes 
    208   end if 
    209228   
    210229  tell sprite(whichSprite) 
     
    216235        if length(mem.name) > 0 then 
    217236          if mem.type = #script then 
    218             includes.setaProp(mem.name, mem.script) 
     237            includes.setaProp(symbol(mem.name), rawNew(mem.script)) 
    219238          end if 
    220239        end if 
     
    222241    end repeat 
    223242  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 
    224272   
    225273  exit 
     
    287335      memref = member(m, cl) 
    288336      if memref.type = #script then 
    289         put "Membername:" && memref.name & TAB & "(" & line 1 of memref.comments & ")" & Return after str 
     337        put "Membername:" && memref.name & TAB & "("&memref.comments&")" & Return after str 
    290338      end if 
    291339    end repeat 
     
    335383      if memref.type = #script then 
    336384        memname = memref.name 
    337         comm = line 1 of memref.comments 
     385        comm = memref.comments 
    338386        if comm.length then 
    339387           
Note: See TracChangeset for help on using the changeset viewer.