mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Creates a tool for splitting dmis
This commit is contained in:
5
tools/IconSplitter/!README.txt
Normal file
5
tools/IconSplitter/!README.txt
Normal 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
|
||||
BIN
tools/IconSplitter/DmiToSplit.dmi
Normal file
BIN
tools/IconSplitter/DmiToSplit.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 347 KiB |
49
tools/IconSplitter/IconSplitter.dm
Normal file
49
tools/IconSplitter/IconSplitter.dm
Normal 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")
|
||||
18
tools/IconSplitter/IconSplitter.dme
Normal file
18
tools/IconSplitter/IconSplitter.dme
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user