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

Ignore:
Timestamp:
10/24/08 12:12:09 (4 years ago)
Author:
alex
Message:

updated movie to incorporate new version of library scripts

File:
1 edited

Legend:

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

    r14 r18  
    1 -- LDM Xtras Moviescript -- ©05 Alex da Franca -- alex@farbflash.de 
     1-- aleXtrasMovieScript 
    22--------------------------------------------------------------------- 
    3  
    4 -- Requires: 
    5 -- nothing 
    6  
    7 -- Purpose: 
     3-- CREATED: 
     4-- 2005 
     5-- 
     6-- PROPERTIES: 
     7--!memberProperties: [#name: "aleXtrasMovieScript", #scripttype: #movie, #scriptSyntax: #lingo, #comments:"~/Documents/Scripts/lingo/aleXtrasMovieScript.ls"] 
     8-- 
     9-- DESCRIPTION: 
     10--             -- LDM Xtras Moviescript -- c05 Alex da Franca -- alex@farbflash.de 
    811-- store instances of scripts and bitmaps in a 'global' list (-> property pAleXtras) 
    912-- and provide access to them for all scripts 
    10  
    11 -- Usage: 
    12 -- put it in one of your castlib, DON'T RENAME MEMBER !! 
     13-- 
     14-- REQUIRES: 
     15--            script "commonmoviescript" 
     16-- 
     17-- USAGE: 
     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-- - 
     30-- 
     31-- TODO: 
     32--              - 
     33----------------------------------- 
    1334 
    1435property pAleXtras 
    1536 
    1637on mGetAleXtras 
     38   
     39  alextras = (script "aleXtrasMovieScript").pAleXtras 
     40  if not(objectP(alextras)) then 
     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) 
     52    if ilk(alextras) <> #instance then 
     53      alert "Script" & QUOTE & "commonMovieScript" & QUOTE && "is missing. This movie can't proceed!" 
     54      halt 
     55    end if 
     56    (script "aleXtrasMovieScript").pAleXtras = alextras 
     57  end if 
     58  return alextras 
     59  ----------------------------- 
     60   
    1761  alextras = (script "aleXtrasMovieScript").pAleXtras 
    1862  if voidP(alextras) then 
     
    2670 
    2771on xscr scrName 
     72  ----------------------------------- 
     73  --         CREATED: 11.02.2008 
     74  --         ACTION: Description 
     75  --         INPUT: - 
     76  --         RETURNS: - 
     77  --         CALLER: - 
     78  --         DEBUG: - 
     79  --         TODO: - 
     80  ----------------------------------- 
     81   
    2882  return mGetXScript(scrName) 
    2983end 
     
    3286 
    3387on mGetXScript scrName 
     88  ----------------------------------- 
     89  --         CREATED: 11.02.2008 
     90  --         ACTION: Description 
     91  --         INPUT: - 
     92  --         RETURNS: - 
     93  --         CALLER: - 
     94  --         DEBUG: - 
     95  --         TODO: - 
     96  ----------------------------------- 
     97   
     98  alextras = mGetAleXtras() 
     99  scrName = string(scrName) 
     100  if length(scrName) < 1 then return alextras 
     101  if scrName = "commonMovieScript" then return alextras 
     102   
     103  inst = alextras.mGetInstance(scrName, 1) 
     104  if ilk(inst) <> #instance then 
     105    if the runmode contains "aut" then 
     106      put "Script" && QUOTE & scrName & QUOTE && "is missing! This may cause unwanted behavior" 
     107    end if 
     108      inst = [] 
     109    end if 
     110  return inst 
     111  ---------------------- 
     112   
     113   
    34114  scrName = symbol(scrName) 
    35115  if ilk(scrName) <> #symbol then scrName = #commonmoviescript 
     
    61141 
    62142on mLoadScripts cls 
     143  ----------------------------------- 
     144  --         CREATED: 11.02.2008 
     145  --         ACTION: Description 
     146  --         INPUT: - 
     147  --         RETURNS: - 
     148  --         CALLER: - 
     149  --         DEBUG: - 
     150  --         TODO: - 
     151  ----------------------------------- 
     152  exit 
     153   
    63154   
    64155  mediaList = mGetAleXtras() 
     
    106197on mLoadXScript whichName 
    107198   
     199  exit 
     200   
     201   
    108202  whichName = string(whichName) 
    109203  if length(whichName) < 1 then return 0 
     
    130224 
    131225on mLoadScriptsFromLDM whichSprite 
     226   
     227  includes = [:]  
     228   
     229  tell sprite(whichSprite) 
     230    cl = the number of castlibs 
     231    repeat with n = 1 to cl 
     232      num = the number of members of castlib cl 
     233      repeat with m = 1 to num 
     234        mem = member(m,n) 
     235        if length(mem.name) > 0 then 
     236          if mem.type = #script then 
     237            includes.setaProp(symbol(mem.name), rawNew(mem.script)) 
     238          end if 
     239        end if 
     240      end repeat 
     241    end repeat 
     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 
     272   
     273  exit 
     274  ------------------------------ 
    132275   
    133276  mediaList = mGetAleXtras() 
     
    166309 
    167310on mListAleXtras 
     311  put "Handler mListAleXtras deprecated" 
     312  exit 
     313   
    168314  alextras = (script "aleXtrasMovieScript").pAleXtras 
    169315  if voidP(alextras) then mLoadScripts 
     
    215361  sel = the selection of castlib cl 
    216362   
    217   delim = the last char of the applicationpath 
     363   
     364  mp = the moviepath 
     365  if length(mp) < 1 then 
     366    if the runmode contains "plug" then 
     367      mp = "/" 
     368    else 
     369      mp = the applicationpath 
     370    end if 
     371  end if 
     372  delim = the last char of mp 
    218373   
    219374  the itemdelimiter = "/" 
Note: See TracChangeset for help on using the changeset viewer.