Advertisement
svArtist

DST Mod Tools: Convert PNG to .TEX

May 9th, 2022
2,585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo OFF
  2. set "iconFile=%~1"
  3. set "iconName=%~n1"
  4. set "iconDir=%~dp1"
  5.  
  6. set steamLibDrive=C
  7. set "steamLibDir=Program Files\Steam\steamapps\common\"
  8. set "steamLibDirx86=Program Files (x86)\Steam\steamapps\common\"
  9. set "modToolsPng=Don't Starve Mod Tools\mod_tools\png.exe"
  10.  
  11. set "libDir=%steamLibDrive%:\%steamLibDir%"
  12. set "pngTool=%libDir%%modToolsPng%"
  13.  
  14. IF not exist "%pngTool%" (
  15.     set "libDir=%steamLibDrive%:\%steamLibDirx86%"
  16.     set "pngTool=%libDir%%modToolsPng%"
  17.    
  18.     IF not exist "%pngTool%" (
  19.         IF not exist "%libDir%" (
  20.             IF not exist "%steamLibDrive%:\%steamLibDir%" (
  21.                 echo "Could not find Steam Library folder. Please adjust the paths in this .cmd script"
  22.                 goto editThis
  23.             )
  24.         )
  25.         echo Could not find DST Mod Tools PNG executable. Please change the paths in this .cmd script or download the latest Mod Tools version.
  26.         setlocal EnableDelayedExpansion
  27.         :SetPrompt
  28.         set "UserChoice="
  29.         set /P "UserChoice=Would you like to download the mod tools? [Y/N]: "
  30.         set "UserChoice=!UserChoice: =!"
  31.         if /I "!UserChoice!" == "N" goto SetPromptb
  32.         if /I not "!UserChoice!" == "Y" goto SetPrompt
  33.         goto getModTools
  34.         endlocal
  35.        
  36.         setlocal EnableDelayedExpansion
  37.         :SetPromptb
  38.         set "UserChoice="
  39.         set /P "UserChoice=Would you like to edit this .cmd script? [Y/N]: "
  40.         set "UserChoice=!UserChoice: =!"
  41.         if /I "!UserChoice!" == "N" endlocal & goto end
  42.         if /I not "!UserChoice!" == "Y" goto SetPromptb
  43.         goto editThis
  44.         endlocal
  45.         goto end
  46.     )
  47. )
  48.  
  49. IF not exist "%libDir%" (
  50.     set "libDir=%steamLibDrive%:\%steamLibDirx86%"
  51. )
  52. IF not exist "%libDir%" (
  53.     echo "Could not find Steam Library folder. Please adjust the paths in this .cmd script"
  54. )
  55.  
  56. "%pngTool%" "%iconFile%" "%iconName%.tex"
  57.  
  58.  
  59. echo done?
  60. pause
  61. goto :EOF
  62.  
  63. :getModTools
  64.     endlocal
  65.     start "" "steam://install/245850"
  66.     goto end
  67.  
  68. :editThis
  69.     endlocal
  70.     start notepad "%~0"
  71.     goto end
  72.  
  73. :end
  74. echo Please try again after resolving the issue.
  75. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement