Creates a tool for splitting dmis

This commit is contained in:
Yoshax
2017-03-27 03:28:21 +01:00
parent ba7cad162d
commit c6d8d3e51c
4 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
This Byond program takes all the icons in DmiToSplit along with input from the user and
splits the icons from the original file into a new file based on the user's provided criteria.
It also produces a file that is the original file minus the icons split into the new file.
-- Yoshax

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

View File

@@ -0,0 +1,49 @@
/*
These are simple defaults for your project.
*/
world
fps = 25 // 25 frames per second
icon_size = 32 // 32x32 icon size by default
view = 6 // show up to 6 tiles outward from center (13x13 view)
// Make objects move 8 pixels per tick when walking
mob
step_size = 8
obj
step_size = 8
client/verb/split_dmi()
set name = "Split Dmi"
set desc = "Loads DmiToSplit.dmi and removes the icon_states of user provided input into another .dmi."
set category = "Here"
var/icon/DMIToSplit = icon('DmiToSplit.dmi')
var/icon/RunningOutputCut = new()
var/icon/RunningOutput = new()
var/user_input
while(!user_input)
user_input = input(usr, "Enter the criteria for the icon_states you wish to be split. For example, doing _d_s will remove all rolled down jumpsuits.","Split Criteria", "")
world << "Your split criteria is [user_input]"
for(var/OriginalState in icon_states(DMIToSplit))
if(findtext(OriginalState, user_input))
var/icon/ToAdd = icon(DMIToSplit, OriginalState)
var/good_name = replacetext(OriginalState, user_input, "")
good_name = "[good_name]_s"
RunningOutputCut.Insert(ToAdd, good_name)
else
var/icon/ToAdd = icon(DMIToSplit, OriginalState)
RunningOutput.Insert(ToAdd, OriginalState)
usr << ftp(RunningOutput,"CutUpDmi.dmi")
usr << ftp(RunningOutputCut, "CutUpDmiWithCriteria.dmi")

View File

@@ -0,0 +1,18 @@
// DM Environment file for IconSplitter.dme.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.
// BEGIN_INTERNALS
// END_INTERNALS
// BEGIN_FILE_DIR
#define FILE_DIR .
// END_FILE_DIR
// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INCLUDE
#include "IconSplitter.dm"
// END_INCLUDE