diff --git a/aurorastation.dme b/aurorastation.dme index 843b28cc570..6487ea3ef52 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -1347,6 +1347,7 @@ #include "code\modules\client\preference_setup\loadout\loadout.dm" #include "code\modules\client\preference_setup\loadout\loadout_accessories.dm" #include "code\modules\client\preference_setup\loadout\loadout_augments.dm" +#include "code\modules\client\preference_setup\loadout\loadout_belt.dm" #include "code\modules\client\preference_setup\loadout\loadout_computer.dm" #include "code\modules\client\preference_setup\loadout\loadout_cosmetics.dm" #include "code\modules\client\preference_setup\loadout\loadout_ears.dm" diff --git a/code/__defines/items_clothing.dm b/code/__defines/items_clothing.dm index aaef3ed1617..35c45a0c1e9 100644 --- a/code/__defines/items_clothing.dm +++ b/code/__defines/items_clothing.dm @@ -101,6 +101,7 @@ #define slot_r_hand_str "slot_r_hand" #define slot_w_uniform_str "slot_w_uniform" #define slot_head_str "slot_head" +#define slot_belt_str "slot_belt" #define slot_wear_suit_str "slot_suit" #define slot_l_ear_str "slot_l_ear" #define slot_r_ear_str "slot_r_ear" diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 0e35d176b31..f609c842c85 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -213,6 +213,7 @@ #define INV_R_HAND_DEF_ICON 'icons/mob/items/righthand.dmi' #define INV_W_UNIFORM_DEF_ICON 'icons/mob/uniform.dmi' #define INV_ACCESSORIES_DEF_ICON 'icons/mob/ties.dmi' +#define INV_BELT_DEF_ICON 'icons/mob/belt.dmi' #define INV_SUIT_DEF_ICON 'icons/mob/suit.dmi' #define INV_L_EAR_DEF_ICON 'icons/mob/l_ear.dmi' #define INV_R_EAR_DEF_ICON 'icons/mob/r_ear.dmi' diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 40fdcac0842..0a60fea5778 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -12,24 +12,49 @@ attack_verb = list("whipped", "lashed", "disciplined") drop_sound = 'sound/items/drop/toolbelt.ogg' pickup_sound = 'sound/items/pickup/toolbelt.ogg' + var/flipped = FALSE + var/show_above_suit = FALSE - var/show_above_suit = 0 +/obj/item/storage/belt/proc/update_clothing_icon() + if(ismob(src.loc)) + var/mob/M = src.loc + M.update_inv_belt() /obj/item/storage/belt/verb/toggle_layer() set name = "Switch Belt Layer" set category = "Object" if(show_above_suit == -1) - to_chat(usr, "\The [src] cannot be worn above your suit!") + to_chat(usr, SPAN_NOTICE("\The [src] cannot be worn above your suit!")) return show_above_suit = !show_above_suit - update_icon() + update_clothing_icon() -/obj/item/storage/update_icon() - if (ismob(src.loc)) - var/mob/M = src.loc - M.update_inv_belt() +/obj/item/storage/belt/Initialize() + ..() + update_flip_verb() +/obj/item/storage/belt/proc/update_flip_verb() + if(("[initial(icon_state)]_flip") in icon_states(icon)) // Check for whether it has a flipped icon. Prevents invisible sprites. + verbs += /obj/item/storage/belt/proc/flipbelt + +/obj/item/storage/belt/proc/flipbelt(mob/user, var/self = TRUE) + set category = "Object" + set name = "Flip Belt" + set src in usr + + if(self) + if(use_check_and_message(user)) + return + else + if(use_check_and_message(user, self ? USE_ALLOW_NON_ADJACENT : 0)) + return + + flipped = !flipped + icon_state = "[initial(icon_state)][flipped ? "_flip" : ""]" + item_state = icon_state + to_chat(usr, SPAN_NOTICE("You change \the [src] to be [src.flipped ? "behind" : "in front of"] you.")) + update_clothing_icon() /obj/item/storage/belt/utility name = "tool-belt" //Carn: utility belt is nicer, but it bamboozles the text parsing. @@ -194,7 +219,7 @@ item_state = "champion" storage_slots = 1 can_hold = list( - "/obj/item/clothing/mask/luchador" + /obj/item/clothing/mask/luchador ) /obj/item/storage/belt/security/tactical @@ -413,29 +438,23 @@ ) /obj/item/storage/belt/fannypack - name = "leather fannypack" + name = "fannypack" desc = "A dorky fannypack for keeping small items in." icon = 'icons/clothing/belts/fannypacks.dmi' - icon_state = "fannypack_leather" - item_state = "fannypack_leather" + icon_state = "fannypack" + item_state = "fannypack" max_w_class = ITEMSIZE_SMALL contained_sprite = TRUE storage_slots = null max_storage_space = 8 - var/flipped = FALSE -/obj/item/storage/belt/fannypack/verb/ToggleFanny() - set name = "Adjust Fannypack" - set category = "Object" - set src in usr +/obj/item/storage/belt/fannypack/recolorable + icon_state = "fannypack_colorable" + item_state = "fannypack_colorable" - if(use_check_and_message(usr)) - return 0 - - flipped = !flipped - item_state = "[initial(icon_state)][flipped ? "_flipped" : ""]" - to_chat(usr, "You flip the belt [flipped ? "behind you" : "infront of you"].") - update_icon() +/obj/item/storage/belt/fannypack/recolorable/random/Initialize() + . = ..() + color = get_random_colour(TRUE) /obj/item/storage/belt/fannypack/component name = "component pouch" @@ -443,51 +462,6 @@ starts_with = list(/obj/item/toy/snappop/syndi = 3, /obj/item/reagent_containers/glass/beaker/vial/random/toxin = 2, /obj/item/storage/pill_bottle/dice = 1) max_storage_space = 14 -/obj/item/storage/belt/fannypack/black - name = "black fannypack" - icon_state = "fannypack_black" - item_state = "fannypack_black" - -/obj/item/storage/belt/fannypack/blue - name = "blue fannypack" - icon_state = "fannypack_blue" - item_state = "fannypack_blue" - -/obj/item/storage/belt/fannypack/cyan - name = "cyan fannypack" - icon_state = "fannypack_cyan" - item_state = "fannypack_cyan" - -/obj/item/storage/belt/fannypack/green - name = "green fannypack" - icon_state = "fannypack_green" - item_state = "fannypack_green" - -/obj/item/storage/belt/fannypack/orange - name = "orange fannypack" - icon_state = "fannypack_orange" - item_state = "fannypack_orange" - -/obj/item/storage/belt/fannypack/purple - name = "purple fannypack" - icon_state = "fannypack_purple" - item_state = "fannypack_purple" - -/obj/item/storage/belt/fannypack/red - name = "red fannypack" - icon_state = "fannypack_red" - item_state = "fannypack_red" - -/obj/item/storage/belt/fannypack/white - name = "white fannypack" - icon_state = "fannypack_white" - item_state = "fannypack_white" - -/obj/item/storage/belt/fannypack/yellow - name = "yellow fannypack" - icon_state = "fannypack_yellow" - item_state = "fannypack_yellow" - /obj/item/storage/belt/shumaila_buckle name = "hammer buckle belt" desc = "A leather belt adorned by a hammer shaped buckle, worn by priesthood and worshippers of Shumaila." @@ -501,3 +475,10 @@ Holy Village's most important buildings. When Mata'ke's original hunting party had done battle with the King of Rraknarr, her beloved was killed in the fighting. Ever since then \ she has resolved to be eternally chaste in dedication to him. She is an M'sai who is depicted wearing modest dresses and carrying a hammer on a belt. She is not known for having \ much combat prowess despite her position as head of the town watch but is a capable commander for defensive tactics." + +/obj/item/storage/belt/generic + name = "belt" + desc = "Only useful for holding up your pants." // Useless belt is useless. + icon_state = "belt" + item_state = "belt" + storage_slots = 0 diff --git a/code/modules/client/preference_setup/loadout/loadout_belt.dm b/code/modules/client/preference_setup/loadout/loadout_belt.dm new file mode 100644 index 00000000000..4d157c101c5 --- /dev/null +++ b/code/modules/client/preference_setup/loadout/loadout_belt.dm @@ -0,0 +1,18 @@ +/datum/gear/belt + display_name = "belt" + path = /obj/item/storage/belt/generic + slot = slot_belt + sort_category = "Belts" + flags = GEAR_HAS_COLOR_SELECTION + +/datum/gear/belt/fannypack + display_name = "fannypack" + cost = 2 + path = /obj/item/storage/belt/fannypack/recolorable + +/datum/gear/belt/toolbelt_alt + display_name = "tool-belt, alt" + cost = 0 + path = /obj/item/storage/belt/utility/alt + allowed_roles = list("Station Engineer", "Atmospheric Technician", "Chief Engineer", "Engineering Apprentice", "Roboticist") + flags = null diff --git a/code/modules/client/preference_setup/loadout/loadout_utility.dm b/code/modules/client/preference_setup/loadout/loadout_utility.dm index ce89460ef7b..2cdab346eee 100644 --- a/code/modules/client/preference_setup/loadout/loadout_utility.dm +++ b/code/modules/client/preference_setup/loadout/loadout_utility.dm @@ -79,32 +79,6 @@ display_name = "camera" path = /obj/item/device/camera -/datum/gear/utility/fannypack - display_name = "fannypack selection" - cost = 2 - path = /obj/item/storage/belt/fannypack - -/datum/gear/utility/fannypack/New() - ..() - var/list/fannys = list() - fannys["leather fannypack"] = /obj/item/storage/belt/fannypack - fannys["black fannypack"] = /obj/item/storage/belt/fannypack/black - fannys["blue fannypack"] = /obj/item/storage/belt/fannypack/blue - fannys["cyan fannypack"] = /obj/item/storage/belt/fannypack/cyan - fannys["green fannypack"] = /obj/item/storage/belt/fannypack/green - fannys["orange fannypack"] = /obj/item/storage/belt/fannypack/orange - fannys["purple fannypack"] = /obj/item/storage/belt/fannypack/purple - fannys["red fannypack"] = /obj/item/storage/belt/fannypack/red - fannys["white fannypack"] = /obj/item/storage/belt/fannypack/white - fannys["yellow fannypack"] = /obj/item/storage/belt/fannypack/yellow - gear_tweaks += new/datum/gear_tweak/path(fannys) - -/datum/gear/utility/toolbelt_alt - display_name = "tool-belt, alt" - cost = 0 - path = /obj/item/storage/belt/utility/alt - allowed_roles = list("Station Engineer", "Atmospheric Technician", "Chief Engineer", "Engineering Apprentice", "Roboticist") - /datum/gear/utility/himeo_kit display_name = "himean voidsuit kit" path = /obj/item/himeo_kit diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index e6c1683f075..5dfc9664abd 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -959,35 +959,42 @@ There are several things that need to be remembered: if (QDELING(src)) return - overlays_raw[BELT_LAYER] = null - overlays_raw[BELT_LAYER_ALT] = null - if(belt) - belt.screen_loc = ui_belt //TODO - var/t_state = belt.item_state - var/t_icon = belt.icon || belt.icon_state - var/image/standing + belt.screen_loc = ui_belt + var/image/result_layer = null + + //Determine the icon to use + var/t_icon = INV_BELT_DEF_ICON if(belt.contained_sprite) belt.auto_adapt_species(src) - t_state = "[UNDERSCORE_OR_NULL(belt.icon_species_tag)][belt.item_state][WORN_BELT]" - - if(belt.icon_override) - t_icon = belt.icon_override + var/t_state = "[UNDERSCORE_OR_NULL(belt.icon_species_tag)][belt.item_state][WORN_BELT]" + result_layer = image(belt.icon_override || belt.icon, t_state) else if(belt.icon_override) t_icon = belt.icon_override else if(belt.sprite_sheets && belt.sprite_sheets[GET_BODY_TYPE]) t_icon = belt.sprite_sheets[GET_BODY_TYPE] + else if(belt.item_icons && (slot_belt_str in belt.item_icons)) + t_icon = belt.item_icons[slot_belt_str] else - t_icon = 'icons/mob/belt.dmi' + t_icon = INV_BELT_DEF_ICON + + if(!result_layer) //Create the image + result_layer = image(t_icon, belt.icon_state) + + if(belt.color) + result_layer.color = belt.color + + result_layer.appearance_flags = RESET_ALPHA + var/image/worn_overlays = belt.worn_overlays(t_icon) + if(worn_overlays) + result_layer.overlays.Add(worn_overlays) - standing = image(t_icon, t_state) - standing.appearance_flags = RESET_ALPHA var/list/ovr if(belt.contents.len && istype(belt, /obj/item/storage/belt)) - ovr = list(standing) + ovr = list(result_layer) for(var/obj/item/i in belt.contents) var/c_state var/c_icon @@ -995,23 +1002,31 @@ There are several things that need to be remembered: c_state = "[UNDERSCORE_OR_NULL(i.icon_species_tag)][i.item_state][WORN_BELT]" c_icon = belt.icon_override || belt.icon else - c_icon = 'icons/mob/belt.dmi' + c_icon = INV_BELT_DEF_ICON c_state = i.item_state || i.icon_state var/image/belt_item_image = image(c_icon, c_state) + if(i.color) + belt_item_image.color = i.color belt_item_image.appearance_flags = RESET_ALPHA ovr += image(c_icon, c_state) - var/beltlayer = BELT_LAYER + var/belt_layer = BELT_LAYER if(istype(belt, /obj/item/storage/belt)) - var/obj/item/storage/belt/ubelt = belt - if(ubelt.show_above_suit) - beltlayer = BELT_LAYER_ALT + var/obj/item/storage/belt/B = belt + if(B.show_above_suit) + belt_layer = BELT_LAYER_ALT - overlays_raw[beltlayer] = ovr || standing + overlays_raw[belt_layer] = ovr || result_layer + else + overlays_raw[BELT_LAYER] = null + overlays_raw[BELT_LAYER_ALT] = null if(update_icons) update_icon() + if (QDELING(src)) + return + /mob/living/carbon/human/update_inv_wear_suit(var/update_icons=1) if (QDELING(src)) return diff --git a/html/changelogs/wezzy_belt_colors.yml b/html/changelogs/wezzy_belt_colors.yml new file mode 100644 index 00000000000..a4dfcd8fde2 --- /dev/null +++ b/html/changelogs/wezzy_belt_colors.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Wowzewow (Wezzy) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds colorable belts." + - tweak: "Fannypacks are now recolorable." + - rscadd: "Belts now have a dedicated loadout section." \ No newline at end of file diff --git a/icons/clothing/belts/fannypacks.dmi b/icons/clothing/belts/fannypacks.dmi index 533bbff23d5..da496b1255b 100644 Binary files a/icons/clothing/belts/fannypacks.dmi and b/icons/clothing/belts/fannypacks.dmi differ diff --git a/icons/mob/belt.dmi b/icons/mob/belt.dmi index 010f909f544..5469d7a1ea9 100644 Binary files a/icons/mob/belt.dmi and b/icons/mob/belt.dmi differ diff --git a/icons/obj/clothing/belts.dmi b/icons/obj/clothing/belts.dmi index 1f3b9184c36..54894f14c13 100644 Binary files a/icons/obj/clothing/belts.dmi and b/icons/obj/clothing/belts.dmi differ