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

Changeset 105 for trunk/lingosource


Ignore:
Timestamp:
12/16/07 22:41:38 (4 years ago)
Author:
alex
Message:

incorporated changes from the beta version, caching and sort by member

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/thisMoviesScript.ls

    r63 r105  
    7474  li = [] 
    7575  mscr = [] 
     76  currMScripts = [] 
     77   
    7678  pscr = [] 
     79  currPScripts = [] 
     80   
    7781  bscr = [] 
    78    
     82  currBScripts = [] 
    7983   
    8084  li.add([#title: "Movie scripts", #items: mscr]) 
    8185  li.add([#title: "Behavior scripts", #items: bscr]) 
    8286  li.add([#title: "Parent scripts", #items: pscr]) 
     87   
     88   
    8389   
    8490  ---------------- menu divider for better readability: 
     
    113119                  mclnum = n 
    114120                   
    115                   mscr.add([#title:"Castlib" && n &":", #items:[], #type:#divider]) 
     121                  currMScripts = [] 
     122                  -- mscr.add([#title:"Castlib" && n &":", #items:currMScripts, #type:#divider]) 
     123                  mscr.add([#title:"Castlib" && n &":", #items:currMScripts, #name:"Castlib"&n]) 
    116124                   
    117125                end if 
    118126                ---------------- // menu divider 
    119127                 
    120                 mscr.add(thisScriptList) 
     128                currMScripts.add(thisScriptList) 
    121129              #parent: 
    122130                 
     
    124132                if pclnum <> n then 
    125133                  pclnum = n 
    126                   pscr.add([#title:"Castlib" && n &":", #items:[], #type:#divider]) 
     134                  currPScripts = [] 
     135                  -- pscr.add([#title:"Castlib" && n &":", #items:currPScripts, #type:#divider]) 
     136                  pscr.add([#title:"Castlib" && n &":", #items:currPScripts, #name:"Castlib"&n]) 
    127137                end if 
    128138                ---------------- // menu divider 
    129139                 
    130                 pscr.add(thisScriptList) 
     140                currPScripts.add(thisScriptList) 
    131141              #score: 
    132142                 
     
    134144                if bclnum <> n then 
    135145                  bclnum = n 
    136                   bscr.add([#title:"Castlib" && n &":", #items:[], #type:#divider]) 
     146                  currBScripts = [] 
     147                  -- bscr.add([#title:"Castlib" && n &":", #items:currBScripts, #type:#divider]) 
     148                  bscr.add([#title:"Castlib" && n &":", #items:currBScripts, #name:"Castlib"&n]) 
    137149                end if 
    138150                ---------------- // menu divider 
    139151                 
    140                 bscr.add(thisScriptList) 
     152                currBScripts.add(thisScriptList) 
    141153            end case 
    142154             
     
    249261    defaultItem = [#title: "", #items: [], #scripttype: memref.scripttype, #memName:dername, #memNum:memref.membernum, #clibNum:memref.castlibnum, #sel:[1,1]] 
    250262     
     263    if len < 1 then 
     264      -- we cache only the results, if there is no search word 
     265      -- otherwise we would need to cache the result for every different searchword 
     266      pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
     267      if ilk(pCachedResults) <> #proplist then 
     268        pCachedResults = [:] 
     269        xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
     270      end if 
     271      cached = pCachedResults.getaprop(string(memref)) 
     272      if ilk(cached) = #proplist then 
     273        theDate = cached.getaprop(#theDate) 
     274        if theDate = memref.modifiedDate then 
     275          found = 1 
     276          thisScriptList.setaprop(#items, cached.getaprop(#items)) 
     277        else 
     278          pCachedResults.deleteprop(string(memref)) 
     279        end if 
     280      end if 
     281    end if 
     282    if found <> 1 then 
    251283    found = mParseScriptText(scrtext, theItems, defaultItem, kw, searchmode, len) 
    252      
     284      if len < 1 then 
     285        pCachedResults = xscr().mGetGlobalValue(#pCachedResults) 
     286        if ilk(pCachedResults) <> #proplist then 
     287          pCachedResults = [:] 
     288          xscr().mSetGlobalValue(#pCachedResults, pCachedResults) 
     289        end if 
     290        pCachedResults.setaprop(string(memref), [#theDate:memref.modifiedDate, #items:duplicate(theItems)]) 
     291      end if 
     292    end if 
    253293  end if 
    254294   
Note: See TracChangeset for help on using the changeset viewer.