- Timestamp:
- 09/17/08 20:50:38 (3 years ago)
- Location:
- trunk/lingosource
- Files:
-
- 6 edited
-
castlib1/subversion_version_field.txt (modified) (1 diff)
-
castlib2/FileIOFunktionen.ls (modified) (3 diffs)
-
castlib2/GetSetPrefs.ls (modified) (1 diff)
-
castlib2/PseudoXMLPS.ls (modified) (2 diffs)
-
castlib2/aleXtrasMovieScript.ls (modified) (8 diffs)
-
castlib2/commonMovieScript.ls (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/subversion_version_field.txt
r184 r186 1 r18 61 r188 -
trunk/lingosource/castlib2/FileIOFunktionen.ls
r163 r186 1 -- FileIO Handlers -- ©03 Alex da Franca -- alex@farbflash.de1 -- FileIO Handlers -- c03 Alex da Franca -- alex@farbflash.de 2 2 --------------------------------------------------------------------- 3 3 … … 460 460 this = getnthfilenameinfolder(folderpath, n) 461 461 end repeat 462 end if 463 464 return retval 465 466 end 467 468 469 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 470 471 on mGetFileAndFolderList me, folderpath 472 if the runmode contains "plugin" then return [] 473 474 if length(string(folderpath)) < 1 then folderpath = mGetFolderPathFromUser(me) 475 if length(folderpath) < 1 then return [] 476 477 if xscr().mCheckForXtra("BudAPI") then -- if buddy is present... 478 -- -- budApi version: 479 retval = baFolderList(folderpath) 480 filelist = baFileList(folderpath, "*.*") 481 repeat with f in filelist 482 retval.add(f) 483 end repeat 484 485 else if xscr().mCheckForXtra("FileXtra4") then -- if not buddy then try filextra 486 -- -- filextra4 version: 487 fx = (xtra "filextra4").new() 488 if objectP(fx) then 489 retval = fx.fx_FolderToList(folderpath) 490 end if 491 fx = 0 492 493 else 494 495 retval = [] 496 n = 1 497 this = getnthfilenameinfolder(folderpath, n) 498 repeat while length(this) > 0 499 retval.add(this) 500 n = n + 1 501 this = getnthfilenameinfolder(folderpath, n) 502 end repeat 503 462 504 end if 463 505 … … 614 656 615 657 on interface me 616 str = "FileIO Scripts by alex da franca ©2003 -- alex@farbflash.de -- all rigths reserved"658 str = "FileIO Scripts by alex da franca c2003 -- alex@farbflash.de -- all rigths reserved" 617 659 618 660 put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str -
trunk/lingosource/castlib2/GetSetPrefs.ls
r178 r186 12 12 13 13 on interface me 14 str = "Handle preferences by alex da franca ©2003 -- alex@farbflash.de -- all rigths reserved"14 str = "Handle preferences by alex da franca c2003 -- alex@farbflash.de -- all rigths reserved" 15 15 16 16 put RETURN & "-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" after str -
trunk/lingosource/castlib2/PseudoXMLPS.ls
r163 r186 5 5 -- 6 6 -- DESCRIPTION: 7 -- Pseudo XML by Alex da Franca ©20037 -- Pseudo XML by Alex da Franca c2003 8 8 -- Convert a lingo list to a XML like string and back 9 9 … … 77 77 78 78 on interface me 79 str = "Pseudo XML Script by alex da franca ©2003 -- alex@farbflash.de -- all rigths reserved"79 str = "Pseudo XML Script by alex da franca c2003 -- alex@farbflash.de -- all rigths reserved" 80 80 put RETURN & "version 1" after str 81 81 -
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 -
trunk/lingosource/castlib2/commonMovieScript.ls
r184 r186 1 1 -- commonMovieScript 2 -- was anderes3 2 ----------------------------------- 4 3 -- CREATED: … … 6 5 -- 7 6 -- DESCRIPTION: 8 -- Shared Global Handlers ©03 Alex da Franca -- alex@farbflash.de7 -- Shared Global Handlers c03 Alex da Franca -- alex@farbflash.de 9 8 -- ------------------------------------------------------------------- 10 -- these handlers are shared between all of my scripts Alex da Franca ©2003 alex@farbflash.de9 -- these handlers are shared between all of my scripts Alex da Franca c2003 alex@farbflash.de 11 10 -- for private use of my scripts -> poor documentation -> use at own risk ;-) 12 11 … … 1203 1202 on mGetInstance me, instName, useRawNew 1204 1203 1204 if ilk(instName) = #string then instName = symbol(instName) 1205 1205 1206 theGlobs = mGetGlobalList(me) 1206 1207 gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances) … … 1214 1215 if ilk(saveScr) = #instance then return saveScr 1215 1216 1216 if mGetMemType(me, member( instName)) = #script then1217 if useRawNew = 1 then saveScr = rawnew(script instName)1218 else saveScr = new(script instName)1217 if mGetMemType(me, member(string(instName))) = #script then 1218 if useRawNew = 1 then saveScr = rawnew(script string(instName)) 1219 else saveScr = new(script string(instName)) 1219 1220 gParentScriptInstances.setaprop(instName, saveScr) 1220 1221 return saveScr … … 1223 1224 if saveScr = -1 then return 0 1224 1225 gParentScriptInstances.setaprop(instName, -1) 1225 inst = mGetXScript( symbol(instName))1226 inst = mGetXScript(instName) 1226 1227 if not(listP(inst)) then 1227 1228 if ilk(inst) = #instance then inst = inst.script … … 1255 1256 1256 1257 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1257 -- xxxxxxxxxxxxxxxxxx reloada stored script instance:1258 1259 on m ReloadInstance me, instName1258 -- xxxxxxxxxxxxxxxxxx delete a stored script instance: 1259 1260 on mDeleteInstance me, instName, dontCallDestroyHandler 1260 1261 theGlobs = mGetGlobalList(me) 1261 1262 gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances) 1262 1263 1263 if ilk(gParentScriptInstances) <> #proplist then exit 1264 1264 if dontCallDestroyHandler <> 1 then 1265 saveScr = gParentScriptInstances.getaprop(instName) 1266 if ilk(saveScr) = #instance then call(#mDestroy, [saveScr]) 1267 end if 1265 1268 gParentScriptInstances.deleteprop(instName) 1269 end 1270 1271 1272 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1273 -- xxxxxxxxxxxxxxxxxx reload a stored script instance: 1274 1275 on mReloadInstance me, instName, useRawNew, dontCallDestroyHandler 1276 mDeleteInstance me, instName, dontCallDestroyHandler 1277 return mGetInstance(me, instName, useRawNew) 1278 end 1279 1280 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1281 -- xxxxxxxxxxxxxxxxxx replace a stored script instance: 1282 1283 on mReplaceInstance me, instName, scriptInstance, dontCallDestroyHandler 1284 if not(objectP(scriptInstance)) then exit 1285 theGlobs = mGetGlobalList(me) 1286 gParentScriptInstances = theGlobs.getaprop(#gParentScriptInstances) 1287 if ilk(gParentScriptInstances) <> #proplist then exit 1288 if dontCallDestroyHandler <> 1 then 1289 saveScr = gParentScriptInstances.getaprop(instName) 1290 if ilk(saveScr) = #instance then call(#mDestroy, [saveScr]) 1291 end if 1292 gParentScriptInstances.setaprop(instName, scriptInstance) 1266 1293 end 1267 1294 … … 1860 1887 end 1861 1888 1889 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1890 -- the naming convention used throughout all my movies for names, filename etc.: 1891 -- Names must be only alphanumeric chars and the underscore and should not start with a number 1892 -- As a rule of thumb: every string which can be made into a symbol is valid. 1893 1894 on mValidateName me, str 1895 if ilk(str) <> #string then return 0 1896 if length(str) < 1 then return 0 1897 if "0123456789" contains char 1 of str then return 0 1898 return string(symbol(str)) = str 1899 end 1862 1900 1863 1901 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx … … 1957 1995 end 1958 1996 1997 1998 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1999 2000 on mFormatdate me, theFormat, theDate 2001 theFormat = string(theFormat) 2002 if length(theFormat) < 1 then theFormat = "yyyy/mm/dd" 2003 if ilk(theDate) <> #date then theDate = the systemdate 2004 2005 offs = offset("y", theFormat) 2006 if offs > 0 then 2007 ende = offs+1 2008 repeat while char ende of theFormat = "y" 2009 if ende > length(theFormat) then exit repeat 2010 ende = ende+1 2011 end repeat 2012 len = ende - offs 2013 if len < 3 then theYear = char 3 to 4 of string(theDate.year) 2014 else theYear = string(theDate.year) 2015 put theYear into char offs to offs + len -1 of theFormat 2016 end if 2017 2018 theFormat = mReplaceCharWithNumber(me, theFormat, "m", theDate.month) 2019 2020 theFormat = mReplaceCharWithNumber(me, theFormat, "d", theDate.day) 2021 2022 return theFormat 2023 end 2024 2025 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2026 2027 on mReplaceCharWithNumber me, theString, theChar, theNumber 2028 offs = offset(theChar, theString) 2029 if offs > 0 then 2030 ende = offs+1 2031 repeat while char ende of theString = theChar 2032 if ende > length(theString) then exit repeat 2033 ende = ende+1 2034 end repeat 2035 len = ende - offs 2036 theNumber = string(theNumber) 2037 repeat while length(theNumber) < len 2038 put "0" before theNumber 2039 end repeat 2040 put theNumber into char offs to offs + len -1 of theString 2041 end if 2042 return theString 2043 end 2044 1959 2045 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1960 2046
Note: See TracChangeset
for help on using the changeset viewer.
