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

Ignore:
Timestamp:
12/18/09 15:27:43 (2 years ago)
Author:
alex
Message:

enclosed path to svn application and editor application in quotes, because that fails otherwise, if the path has spaces. what a fun it is to be able to have spaces in file and foldernames... :-(

File:
1 edited

Legend:

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

    r228 r241  
    198198   
    199199  --  clearglobals 
     200end 
     201 
     202-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     203 
     204on mGetPlayBackModeValue me, symbol_Prop 
     205  if ilk(symbol_Prop) <> #symbol then symbol_Prop = #playBackMode 
     206  playBackModeValueList = mGetGlobalValue(me, #playBackModeValueList) 
     207  if not(objectP(playBackModeValueList)) then playBackModeValueList = [:] 
     208  return playBackModeValueList[symbol_Prop] 
     209end 
     210 
     211-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     212 
     213on mSetPlayBackModeValue me, symbol_Prop, any_value 
     214  if ilk(symbol_Prop) <> #symbol then exit 
     215  playBackModeValueList = mGetGlobalValue(me, #playBackModeValueList) 
     216  if not(objectP(playBackModeValueList)) then 
     217    playBackModeValueList = [:] 
     218    mSetGlobalValue(me, #playBackModeValueList, playBackModeValueList) 
     219  end if 
     220  return playBackModeValueList[symbol_Prop] = any_value 
    200221end 
    201222 
     
    296317 
    297318on mGetFloatVersionNumber me, prodVers 
    298   offs = offset(".", prodVers) 
    299   if offs > 0 then 
    300     intVers = char 1 to offs of prodVers 
    301     delete char 1 to offs of prodVers 
    302   else 
    303     intVers = "" 
    304   end if 
    305   cnt = length(prodVers) 
    306   repeat with n = 1 to cnt 
    307     c = prodVers.char[n] 
    308     if integerP(integer(c)) then 
    309       put c after intVers 
    310     else if c <> "." then 
    311       exit repeat 
    312     end if 
    313   end repeat 
    314    
     319    offs = offset(".", prodVers) 
     320    if offs > 0 then 
     321      intVers = char 1 to offs of prodVers 
     322      delete char 1 to offs of prodVers 
     323    else 
     324      intVers = "" 
     325    end if 
     326    cnt = length(prodVers) 
     327    repeat with n = 1 to cnt 
     328      c = prodVers.char[n] 
     329      if integerP(integer(c)) then 
     330        put c after intVers 
     331      else if c <> "." then 
     332        exit repeat 
     333      end if 
     334    end repeat 
     335     
    315336  return value(intVers) 
     337end 
     338 
     339-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     340 
     341on mGetEnvironment me 
     342  ----------------------------------- 
     343  --         CREATED: 18.05.2009 
     344  --         ACTION: Getting the environment properts list is very slow, 
     345  --                 therefore we make sure to get it only once and store the rsult 
     346  --         INPUT: - 
     347  --         RETURNS: property list => the environment 
     348  ----------------------------------- 
     349   
     350  env = mGetGlobalValue(me, #theEnvironment) 
     351  if not(objectP(env)) then 
     352     
     353    if the runmode contains "aut" then 
     354      -- there is a really lame bug in the mac version 
     355      -- where querying the environment takes ages! 
     356      -- now it is only the first call, therefore we save the result 
     357      -- and in authoring we even save it in a global, so that we 
     358      -- do not have to wait on each moviestart! 
     359      global gLameAuthoringHack_forSlowEnvironment_onMac 
     360      if not(objectP(gLameAuthoringHack_forSlowEnvironment_onMac)) then 
     361        gLameAuthoringHack_forSlowEnvironment_onMac = the environment 
     362      end if 
     363      env = gLameAuthoringHack_forSlowEnvironment_onMac 
     364    else 
     365    env = the environment 
     366    end if 
     367     
     368    mSetGlobalValue(me, #theEnvironment, env) 
     369  end if 
     370  return env 
    316371end 
    317372 
     
    333388  if voidP(gPlatform) then 
    334389     
    335     isMac = the platform contains "Macintosh" 
    336     if isMac then 
    337        
    338       onX = value(char 1 of (the last word of (the environment).osversion)) <= 5 
     390  isMac = the platform contains "Macintosh" 
     391  if isMac then 
     392       
     393      onX = value(char 1 of (the last word of (mGetEnvironment(me)).osversion)) <= 5 
    339394      if onX then gPlatform = #osx 
    340395      else gPlatform = #os9 
     
    480535end 
    481536 
     537-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     538on ____PROCESS_CALLBACK_EVENTS 
     539end 
     540-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     541 
     542on mDoCallBack me, callbackObject, p1, p2, p3 
     543  ----------------------------------- 
     544  -- CREATED: 22.07.2009 
     545  -- ACTION: This is the standard way to send callback events to callbackObjects of the format: 
     546  --             [#handler:symbol, #target:object] 
     547  --             NOTE: If the #handler property is NOT a symbol, then it is considered a special case 
     548  --                   where the result will simply be "put" into the message window => suited for debugging 
     549  -- INPUT: <callbackObject> ; object (propertylist) ; required ; a callBack object of the format: 
     550  --             [#handler:symbol, #target:object], which can be any number of additional properties 
     551  --             since this object will be provided as parameter to the recipient 
     552  --             the recipient can access all these additional properties 
     553  --         <p1 - p3> ; arbitrary parameters ; just in case additional parameters are required, 
     554  --             which can not, for some reason, be stored in the object <callbackObject> itself 
     555  -- RETURNS: either a string or an integer. In case of 1 the callback was successfully called, otherwise 
     556  --             an errorstring is returned and the callback was NOT successfully called. 
     557  -- EXAMPLE: xscr().mDoCallBack(callBackObject) 
     558  ----------------------------------- 
     559   
     560  if not(objectP(callbackObject)) then return "Wrong paramater, callbackObject is not an object!" 
     561   
     562  hnd = callbackObject[#handler] 
     563  if not(symbolP(hnd)) then 
     564    put "Script 'commonMovieScript': Handler 'mDoCallBack':" 
     565    put "---------------------------" 
     566    put "callbackObject:" && callbackObject 
     567    put "------" 
     568    put "p1:" && p1 
     569    put "------" 
     570    put "p2:" && p2 
     571    put "------" 
     572    put "p3:" && p3 
     573    put "---------------------------" 
     574    return "callbackObject[#handler] is not a symbol" 
     575  end if 
     576   
     577  tgt = callbackObject[#target] 
     578  case ilk(tgt) of 
     579    #script, #instance: 
     580      call(hnd, [tgt], callbackObject, p1, p2, p3) 
     581    #list, #proplist: 
     582      if count(tgt) = 0 then 
     583        put "Script 'commonMovieScript': Handler 'mDoCallBack':" 
     584        put "---------------------------" 
     585        put "callbackObject:" && callbackObject 
     586        put "------" 
     587        put "p1:" && p1 
     588        put "------" 
     589        put "p2:" && p2 
     590        put "------" 
     591        put "p3:" && p3 
     592        put "---------------------------" 
     593      else 
     594      call(hnd, tgt, callbackObject, p1, p2, p3) 
     595      end if 
     596       
     597    otherwise: 
     598      spr = mGetKanal(me, tgt) 
     599      if spr < 1 then return "callbackObject[#target] is neither an object nor a spritenumber/name:" && callbackObject[#target] 
     600      sendSprite(spr, hnd, callbackObject, p1, p2, p3) 
     601  end case 
     602   
     603  return 1 
     604end 
    482605 
    483606-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    621744    mDebugImage me, str, overwrite, dername 
    622745  else 
    623     if overwrite = 64 then put str 
     746    if the runmode contains "aut" then 
     747      if overwrite = 64 then 
     748        put str 
     749      else 
     750        if debugFlags.getPos(1) then 
     751          put str 
     752        end if 
     753      end if 
     754    end if 
    624755  end if 
    625756   
     
    634765  if voidP(dername) then dername = "DebugImg" 
    635766   
    636   if overwrite then 
     767  if overwrite = 1 then 
    637768    neuer = member(dername) 
    638769    if mGetMemType(me, neuer) <> #bitmap then overwrite = 0 
     
    655786    f.name = "debuginfotextmember" 
    656787  end if 
     788   
     789  if mGetVersionNumber(me) > 11 then 
     790    oldscrolltop = f.scrolltop 
     791    if oldscrolltop > f.height - f.pageheight - f.lineheight then 
     792      oldscrolltop = #unten 
     793    end if 
     794  end if 
     795   
    657796  altertext = f.text 
    658797  if the number of lines of altertext > 500 then put line 300 to 500 of altertext into field "debuginfotextmember" 
    659798  put "------------------------"&RETURN&RETURN & str & return after field "debuginfotextmember" 
     799   
     800  if not voidP(oldscrolltop) then 
     801    if oldscrolltop = #unten then 
     802      f.scrolltop = f.height - f.pageheight + f.lineheight 
     803    else 
     804      f.scrolltop = oldscrolltop 
     805    end if 
     806  end if 
    660807end 
    661808 
     
    812959  -- comment here to use a *real* global: 
    813960   
     961  if not the runmode contains "aut" then return ["Arial"] -- just to be safe 
     962  -- this handler should not be called anymore in runtime 
     963  -- as mGetAFont() doesn't call it anymore 
     964  -- the lame reason is: 
     965  -- the new D11 player fucked up the unsupported function FontList() 
     966  -- :-( SHAME! 
     967   
    814968  -- faked global: 
    815969  globs = mGetGlobalList(me) 
     
    9341088-- if that fails also, takes the first installed font of the list of installed fonts 
    9351089on mGetAFont me, theFont 
     1090   
     1091  return theFont -- :-( the unsupported fontlist() method of font members now can crash the browser - tolle wurst! 
     1092   
     1093   
    9361094  fontliste = InitFonts(me) 
    9371095  if not (fontliste).getPos(theFont) then 
     
    13531511  gPowerList = theGlobs.getaprop(#gPowerList) 
    13541512  if ilk(gPowerList) <> #list then 
    1355     gPowerList = [2,4,8,16,32,64,128,256,512] --,1024] 
     1513    gPowerList = [2,4,8,16,32,64,128,256,512,1024] 
    13561514    gPowerList.sort() 
    13571515    theGlobs[#gPowerList] = gPowerList 
     
    13671525  gPowerList = theGlobs.getaprop(#gPowerList) 
    13681526  if ilk(gPowerList) <> #list then 
    1369     gPowerList = [1,2,4,8,16,32,64,128,256,512] --,1024] -- mac openGL only does 512 
     1527    gPowerList = [1,2,4,8,16,32,64,128,256,512,1024] -- mac openGL only does 512 
    13701528    gPowerList.sort() 
    13711529    theGlobs[#gPowerList] = gPowerList 
     
    14331591-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    14341592 
    1435  
    1436 -- convert a relative path to an absolute path: 
     1593on mConvertAbsolutePathToRelative me, aPath, newDelim, anAbsoluteBasedir 
     1594   
     1595  anAbsoluteBasedir = string(anAbsoluteBasedir) 
     1596  if length(anAbsoluteBasedir) < 1 then anAbsoluteBasedir = the moviepath 
     1597  if length(anAbsoluteBasedir) < 1 then return "" 
     1598   
     1599  delim = the last char of the moviepath 
     1600  if length(delim) < 1 then delim = the last char of the applicationpath 
     1601   
     1602  newDelim = string(newDelim) 
     1603  if length(newDelim) < 1 then newDelim = delim 
     1604   
     1605  offs = offset(anAbsoluteBasedir, aPath) 
     1606  if offs <> 1 then 
     1607    put "Script:commonMovieScript; Handler:mConvertAbsolutePathToRelative; The path:" &&QUOTE& aPath &QUOTE&& "is not inside the current path specified" &&QUOTE& anAbsoluteBasedir &QUOTE 
     1608    return "" 
     1609  end if 
     1610  delete char 1 to length(anAbsoluteBasedir) of aPath 
     1611  if delim = newDelim then return aPath 
     1612   
     1613  offs = offset(delim, aPath) 
     1614  repeat while offs > 0 
     1615    put newDelim into char offs of aPath 
     1616    offs = offset(delim, aPath) 
     1617  end repeat 
     1618   
     1619  return aPath 
     1620end 
     1621 
     1622-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1623 
     1624-- convert a relative path to an absolute path: (Sorry, the name of this handler couldn't be more stupid ;-) 
    14371625on mGetRelativePath me, aPath, mp -- mp optional: default = the moviepath 
    14381626   
     
    14611649    delim =  the last char of the moviepath 
    14621650    if length(delim) < 1 then 
    1463        
    14641651      if the runmode contains "plug" then 
    1465         mp = "" 
     1652        --        delim = "" 
    14661653      else 
    14671654        delim = the last char of the applicationpath 
    14681655      end if 
    1469        
    1470        
    14711656      if length(delim) < 1 then delim = "/" 
    14721657    end if 
     
    17081893  theGlobs = mGetGlobalList(me) 
    17091894  uebersetzungsListe = theGlobs.getaprop(#gUebersetzung) 
    1710   if ilk(uebersetzungsListe) <> #proplist then return aString 
     1895  if ilk(uebersetzungsListe) <> #proplist then return mReplacePlaceHoldersInString(me, aString, variablesList) 
     1896   
    17111897  uebersetzung = uebersetzungsListe.getaprop(aString) 
    1712   if voidP(uebersetzung) then 
    1713     if listP(variablesList) then return mReplacePlaceHoldersInString(me, aString, variablesList) 
    1714     return aString 
    1715   else 
     1898  if voidP(uebersetzung) then return mReplacePlaceHoldersInString(me, aString, variablesList) 
     1899   
    17161900    currLang = call(#mGetPrefValue, [mGetXScript(#GetSetPrefs)], #gLanguage) 
    17171901    if voidP(currLang) then 
     
    17221906    ind = currLang + 1 
    17231907    if ind > count(uebersetzung) then ind = 1 
    1724     return uebersetzung[ind] 
    1725   end if 
     1908   
     1909  return mReplacePlaceHoldersInString(me, uebersetzung[ind], variablesList) 
    17261910end 
    17271911 
     
    17291913 
    17301914on mReplacePlaceHoldersInString me, aString, variablesList 
    1731   if ilk(variablesList) = #proplist then 
     1915  theIlk = ilk(variablesList) 
     1916  if theIlk = #proplist then 
    17321917    cnt = count(variablesList) 
    17331918    if cnt > 0 then 
     
    17441929      end repeat         
    17451930    end if 
    1746   else if ilk(variablesList) = #list then -- printf like replacement 
     1931  else if theIlk = #list then -- printf like replacement 
    17471932    if count(variablesList) > 0 then 
    17481933      offs = offset("%s", aString) 
     
    17511936        put str into char offs to offs + 1 of aString 
    17521937        if count(variablesList) > 1 then variablesList.deleteAt(1) 
     1938        str = string(variablesList[1]) 
    17531939        offs = offset("%s", aString) 
    17541940      end repeat 
     
    19882174  end if 
    19892175   
    1990   -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZçË"&vA& "€Ì‚ƒéæèêíëì„îñï 
    1991 Íòôۆ®¯ÎÙ" 
    1992   -- pLowercase = "abcdefghijklmnopqrstuvwxyz‡ˆ"&"‰"&"Š‹ŒŽ‘’“”•–—˜™š›œžŸŸ¿ÏØ" 
    1993   pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "ç", "Ë", vA, "A", "€", "Ì", "", "‚", "ƒ", "é", "æ", "è", "ê", "í", "ë", "ì", "„", "î", "ñ", "ï", " 
    1994 ", "Í", "ò", "ô", "U", "†", "®", "¯", "Î", "Ù"]) 
    1995   pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "‡", "ˆ", vA, "‰", "Š", "‹", "Œ", "", "Ž", "", "", "‘", "’", "“", "”", "•", "–", "—", "˜", "™", "š", "›", "œ", "", "ž", "Ÿ", "Ÿ", "¿", "Ï", "Ø"]) 
     2176  -- pUPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZZÁÀ"&vA& "ÄÃà
     2177ÇÉÈÊËÍÌÎÏÑÓÒÔÖÕÚÙ€ÜÆØŒŞ" 
     2178  -- pLowercase = "abcdefghijklmnopqrstuvwxyzáà"&"â"&"ÀãåçéÚêëíìîïñóòÎöõúùûÌÊÞœÿ" 
     2179  pCaseLists.setaprop(#uppercase, ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Á", "À", vA, "A", "Ä", "Ã", "à
     2180", "Ç", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ñ", "Ó", "Ò", "Ô", "Ö", "Õ", "Ú", "Ù", "U", "Ü", "Æ", "Ø", "Œ", "Åž"]) 
     2181  pCaseLists.setaprop(#lowercase, ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "á", "à", vA, "â", "À", "ã", "Ã¥", "ç", "é", "Ú", "ê", "ë", "í", "ì", "î", "ï", "ñ", "ó", "ò", "ÃŽ", "ö", "õ", "ú", "ù", "û", "ÃŒ", "Ê", "Þ", "œ", "ÿ"]) 
    19962182   
    19972183end 
     
    20112197      li = ["Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag","Sonntag"] 
    20122198    "pt": 
    2013       li = ["Segunda-feira","Tera-feira","Quarta-feira","Quinta-feira","Sexta-feira","S‡bado","Domingo"] 
     2199      li = ["Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira","Sábado","Domingo"] 
    20142200    "fr": 
    20152201      li = ["Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"] 
    20162202    "es": 
    2017       li = ["Lunes","Martes","MiŽrcoles","Jueves","Viernes","S‡bado","Domingo"] 
     2203      li = ["Lunes","Martes","Miércoles","Jueves","Viernes","Sábado","Domingo"] 
    20182204    "it": 
    2019       li = ["Luned“","Marted“","Mercoled“","Gioved“","Venerd“","Sabato","Domenica"] 
     2205      li = ["Lunedì","Martedì","Mercoledì","Giovedì","Venerdì","Sabato","Domenica"] 
    20202206    "nl": 
    20212207      li = ["Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"] 
Note: See TracChangeset for help on using the changeset viewer.