Skip to content

Commit

Permalink
Version 2.2: Add drag & drop file/folder selection, add debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
n0samu committed Nov 4, 2023
1 parent 40ffbe7 commit 1483f93
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ Tools/
Xtras/
Exports/
*.exe
*.ini
*.lnk
3 changes: 2 additions & 1 deletion CommandLine.ls
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ on processCommandLineArgs args
case optName of
"help", "h": printInfo(True)
"version", "v": printInfo(False)
"debug": set the debugPlaybackEnabled = True
-- File paths can be passed without an option name
"files", EMPTY: processSelection(optVal)
"folders": set inputFolders = optVal
Expand All @@ -103,7 +104,7 @@ on processCommandLineArgs args
if listP(inputFolders) then
repeat with folderPath in inputFolders
if fxObj.fx_FolderExists(folderPath) then
processSelection(getDirFiles(folderPath))
processSelection(getDirFilesInFolder(folderPath))
else
errorMsg("The specified input folder does not exist:" && folderPath)
end if
Expand Down
Binary file modified DirectorCastRipper.dir
Binary file not shown.
3 changes: 3 additions & 0 deletions Export.ls
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ on exportFlash flashMember, basePath
repeat with i = 1 to 5
set ok = exportSWF(flashMember, basePath & ".swf")
if ok then exit repeat
else if the debugPlaybackEnabled then
warnMsg("Failed to export" && getMemberIdString(flashMember) & ". Retrying...")
end if
end repeat
return not ok
end
Expand Down
8 changes: 6 additions & 2 deletions Files.ls
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ on filterFiles fileList, exts
return ret
end
on getDirFiles folderPath
on getDirFiles files
set dirExts = ["dir", "dxr", "dcr", "cst", "cxt", "cct"]
return filterFiles(files, dirExts)
end
on getDirFilesInFolder folderPath
set folderPath = ensureTrailingSlash(folderPath)
set dirFiles = filterFiles(fxObj.fx_folderToList(folderPath), dirExts)
set dirFiles = getDirFiles(fxObj.fx_folderToList(folderPath))
set dirFilePaths = list()
repeat with fName in dirFiles
dirFilePaths.append(folderPath & fName)
Expand Down
1 change: 0 additions & 1 deletion Init.ls
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ end
on prepareMovie
global pathSep, fileioObj, fxObj
clearGlobals()
-- set the debugPlaybackEnabled = 1
set the idleLoadMode = 0
set the title of the window = line 1 of the movieAboutInfo
set pathSep = "\"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The following table lists member types that Director Cast Ripper can export, alo
| Field | TXT |

## Other Features
Director Cast Ripper exports information about movies and cast members into CSV spreadsheets. When adding and removing files, it allows multiselection of files using Shift-click or Ctrl-click. All of its functionality is also accessible via the command line; run `DirectorCastRipper.exe --help` for details. Director Cast Ripper can also integrate with [ProjectorRays](https://github.com/ProjectorRays/ProjectorRays); just download the EXE file and place it in Cast Ripper's `Tools` folder.
Director Cast Ripper exports information about movies and cast members into CSV spreadsheets. When adding and removing files, it allows multiselection of files using Shift-click or Ctrl-click. Files can also be added by dragging them into the window. All of its functionality is also accessible via the command line; run `DirectorCastRipper.exe --help` for details. Director Cast Ripper can also integrate with [ProjectorRays](https://github.com/ProjectorRays/ProjectorRays); just download the EXE file and place it in Cast Ripper's `Tools` folder.

Although Cast Ripper runs within the Director Player, it disables scripting for all loaded movies, preventing their code from interfering with the export process. But the Director Player still attempts to load any cast files, linked cast members, and Xtras that each movie depends on. Therefore when exporting it is best to keep movies in their original folders and to copy any required Xtras into Cast Ripper's Xtras folder, otherwise error dialogs may pop up during the export process. If you are using Cast Ripper to process many files and don't know what Xtras they may need, Cast Ripper provides an option to auto-dismiss the error dialogs, preventing the export process from stalling.

Expand All @@ -29,6 +29,7 @@ Director Cast Ripper uses several third-party Xtras which are listed below.
- Kent Kersten's [FileXtra4](http://web.archive.org/web/20040803131759/http://www.kblab.net/xtras/FileXtra4/index.html) handles files and folders, while Magic Modules' [Buddy API](http://mods.com.au/) provides file and folder selection dialogs and other useful functions.
- Valentin's [Console Xtra](https://valentin.dasdeck.com/xtras/console_xtra/win/) and [CommandLine Xtra](https://valentin.dasdeck.com/xtras/commandline_xtra/win/) provide command line functionality.
- Valentin's [Msg Xtra](https://valentin.dasdeck.com/xtras/msg_xtra/win/) provides functionality for the auto-dismiss feature.
- Valentin's [Drop Xtra](https://valentin.dasdeck.com/xtras/drop_xtra/win/) allows drag & drop file and folder selection.
- Tomysshadow's [MoaProperties Xtra](https://github.com/tomysshadow/MoaProperties-Xtra/) provides access to movie metadata that is otherwise inaccessible from Lingo.

Special thanks to [Tomysshadow](https://github.com/tomysshadow/) for his extensive help and guidance throughout the development process, and to [Valentin](https://valentin.dasdeck.com/) for developing so many great and useful Xtras!
13 changes: 13 additions & 0 deletions UI.ls
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
global nextBtn, backBtn

on initUI
global dropXtra
set nextBtn = sprite "NextButton"
set backBtn = sprite "BackButton"
repeat with btn in [nextBtn, backBtn]
if the visible of btn then btn.setStyle("fontSize", 18)
end repeat
set dropXtra = xtra("DropXtra").new(#itemsDropped)
dropXtra.dropStart()
-- Setting Flash sprite properties does not work until after the first stage update
updateStage()
initScreen()
Expand Down Expand Up @@ -228,6 +231,16 @@ on chooseFolder
if folderPath <> EMPTY then set the text of sprite "FolderPathBox" to folderPath
end

on itemsDropped items
case the frameLabel of
"Choose Files":
addFiles(getDirFiles(items.getaProp(#Files)))
"Options":
set the text of sprite "FolderPathBox" to items.getaProp(#Folders).getAt(1)
end case
updateScreen()
end

on updateProgressBar
set fraction = getProgress()
set progBarRect = the rect of sprite "ProgressBar"
Expand Down

0 comments on commit 1483f93

Please sign in to comment.