Let's see if this complains

This commit is contained in:
Exxion
2015-03-08 11:05:43 -04:00
parent a738027be2
commit b0bb88b0d4
6 changed files with 108 additions and 5 deletions

View File

@@ -44,6 +44,16 @@ var/list/all_supply_groups = list("Supplies","Clothing","Security","Hospitality"
containername = "Toner Cartridges"
group = "Supplies"
/datum/supply_packs/labels
name = "Label Rolls"
contains = list(/obj/item/weapon/storage/box/labels,
/obj/item/weapon/storage/box/labels, //21 label rolls is enough to label Beepsky "SHITCURITRON" 375 times,
/obj/item/weapon/storage/box/labels) //so this might be a bit excessive.
cost = 10
containertype = /obj/structure/closet/crate
containername = "Label Rolls"
group = "Supplies"
/datum/supply_packs/internals
name = "Internals crate"
contains = list(/obj/item/clothing/mask/gas,

View File

@@ -41,6 +41,8 @@ var/global/list/ghdel_profiling = list()
// When this object moves. (args: loc)
var/event/on_moved = new()
var/labeled //Stupid and ugly way to do it, but the alternative would probably require rewriting everywhere a name is read.
/atom/proc/beam_connect(var/obj/effect/beam/B)
if(!(B in beams))
beams.Add(B)

View File

@@ -551,6 +551,15 @@
new /obj/item/ammo_casing/shotgun/dart(src)
new /obj/item/ammo_casing/shotgun/dart(src)
/obj/item/weapon/storage/box/labels
name = "label roll box"
icon_state = "labels"
New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/device/label_roll(src)
/obj/item/weapon/storage/box/snappops
name = "snap pop box"
desc = "Eight wrappers of fun! Ages 8 and up. Not suitable for children."

View File

@@ -4,7 +4,7 @@
icon_state = "labeler0"
item_state = "labeler0"
var/label = null
var/labels_left = 30
var/chars_left = 250 //Like in an actual label maker, uses an amount per character rather than per label.
var/mode = 0 //off or on.
/obj/item/weapon/hand_labeler/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
@@ -16,12 +16,14 @@
if(target == loc) // if placing the labeller into something (e.g. backpack)
return // don't set a label
if(!labels_left)
user << "<span class='notice'>No labels left.</span>"
if(!chars_left)
user << "<span class='notice'>Out of label.</span>"
return
if(!label || !length(label))
user << "<span class='notice'>No text set.</span>"
return
if(length(target.name) + length(label) > 64)
user << "<span class='notice'>Label too big.</span>"
return
@@ -37,15 +39,32 @@
user.visible_message("<span class='notice'>[user] labels [target] as [label].</span>", \
"<span class='notice'>You label [target] as [label].</span>")
if(target.labeled)
target.remove_label()
target.labeled = " ([label])"
target.name = "[target.name] ([label])"
new/atom/proc/remove_label(target)
chars_left = max(chars_left - (length(label) + 2),0)
if(!chars_left)
user << "<span class='notice'>The labeler is empty.</span>"
mode = 0
icon_state = "labeler_e"
return
if(chars_left < length(label) + 2)
user << "<span class='notice'>The labeler is almost empty.</span>"
label = copytext(label,1,min(chars_left, length(label) + 1))
/obj/item/weapon/hand_labeler/attack_self(mob/user as mob)
if(!chars_left)
user << "<span class='notice'>It's empty.</span>"
return
mode = !mode
icon_state = "labeler[mode]"
if(mode)
user << "<span class='notice'>You turn on \the [src].</span>"
//Now let them chose the text.
var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
var/str = copytext(reject_bad_text(input(user,"Label text?","Set label","")),1,min(MAX_NAME_LEN,chars_left - 1))
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
@@ -53,3 +72,66 @@
user << "<span class='notice'>You set the text to '[str]'.</span>"
else
user << "<span class='notice'>You turn off \the [src].</span>"
/obj/item/weapon/hand_labeler/attackby(obj/item/O, mob/user)
if(istype(O, /obj/item/device/label_roll))
if(mode)
user << "<span class='notice'>Turn it off first.</span>"
return
var/obj/item/device/label_roll/LR = O
var/holder = chars_left //I hate having to do this.
chars_left = LR.left
if(holder)
LR.left = holder
user << "<span class='notice'>You switch the label rolls.</span>"
else
del(LR)
user << "<span class='notice'>You replace the label roll.</span>"
icon_state = "labeler0"
/obj/item/weapon/hand_labeler/attack_hand(mob/user) //Shamelessly stolen from stack.dm.
if(mode)
user << "<span class='notice'>Turn it off first.</span>"
return
if (user.get_inactive_hand() == src)
var/obj/item/device/label_roll/LR = new(user, amount=chars_left)
user.put_in_hands(LR)
user << "<span class='notice'>You remove the label roll.</span>"
chars_left = 0
icon_state = "labeler_e"
else
..()
/obj/item/weapon/hand_labeler/examine(mob/user) //Shamelessly stolen from the paper bin.
..()
if(chars_left)
user << "<span class='info'>There " + (chars_left > 1 ? "are [chars_left] letters" : "is one letter") + " worth of label on the roll.</span>"
else
user << "<span class='info'>The label roll is all used up.</span>"
/atom/proc/remove_label()
set name = "Remove label"
set src in view(1)
set category = "Object"
var/atom/A = src
A.name = replacetext(A.name, A.labeled, "")
A.labeled = null
A.verbs -= /atom/proc/remove_label
/obj/item/device/label_roll
name = "label roll"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "label_cart" //Placeholder image; recolored police tape
var/left = 250
/obj/item/device/label_roll/examine(mob/user) //Shamelessly stolen from above.
..()
if(left)
user << "<span class='info'>There " + (left > 1 ? "are [left] letters" : "is one letter") + " worth of label on the roll.</span>"
else
user << "<span class='warning'>Something has fucked up and this item should have deleted itself. Throw it away for IMMERSION.</span>"
/obj/item/device/label_roll/New(var/loc, var/amount=null)
..()
if(amount)
left = amount

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB