From fbf33fc5df0daa383e1cf2a17b8565a256a9ae84 Mon Sep 17 00:00:00 2001 From: Atlantiscze Date: Mon, 20 Apr 2020 08:16:19 +0200 Subject: [PATCH] Final tweaks - Refactors some code to more modern standards, fixes problem with PSUs not reacting to UI input. - Adds cable coil recoloring using multitool (Bay went the path of having dedicated cable painter device but that really feels as too much of a hassle having to carry another device for this - lets just say the paint is electrically reactive in some way). - Adds changelog --- code/modules/power/batteryrack.dm | 6 +++-- code/modules/power/cable.dm | 7 ++++- code/modules/power/smes.dm | 3 --- html/changelogs/atlantiscze-power.yml | 37 +++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 html/changelogs/atlantiscze-power.yml diff --git a/code/modules/power/batteryrack.dm b/code/modules/power/batteryrack.dm index e1ea9e9dc0..3d73a6890a 100644 --- a/code/modules/power/batteryrack.dm +++ b/code/modules/power/batteryrack.dm @@ -14,6 +14,8 @@ icon_state = "rack" capacity = 0 charge = 0 + output_attempt = FALSE + input_attempt = FALSE var/max_transfer_rate = 0 // Maximal input/output rate. Determined by used capacitors when building the device. var/mode = PSU_OFFLINE // Current inputting/outputting mode @@ -259,9 +261,9 @@ return if(istype(W, /obj/item/weapon/cell)) // ID Card, try to insert it. if(insert_cell(W, user)) - user << "You insert \the [W] into \the [src]." + to_chat(user, "You insert \the [W] into \the [src].") else - user << "\The [src] has no empty slot for \the [W]" + to_chat(user, "\The [src] has no empty slot for \the [W]") /obj/machinery/power/smes/batteryrack/attack_hand(var/mob/user) ui_interact(user) diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index fc817d062a..fc3011793c 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -237,7 +237,7 @@ var/list/possible_cable_coil_colours = list( else if(istype(W, /obj/item/device/multitool)) if(powernet && (powernet.avail > 0)) // is it powered? - to_chat(user, "[get_wattage()]W in power network.") + to_chat(user, "[get_wattage()] in power network.") else to_chat(user, "The cable is not powered.") @@ -625,6 +625,11 @@ obj/structure/cable/proc/cableColor(var/colorC) to_chat(user, msg) +/obj/item/stack/cable_coil/attackby(obj/item/W, mob/user) + if(istype(W, /obj/item/device/multitool)) + var/selected_type = input("Pick new colour.", "Cable Colour", null, null) as null|anything in possible_cable_coil_colours + set_cable_color(selected_type, usr) + return /obj/item/stack/cable_coil/verb/make_restraint() set name = "Make Cable Restraints" diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index e4eab302e5..abe258cd42 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -409,9 +409,6 @@ output_level = (input(usr, "Enter new output level (0-[output_level_max/1000] kW)", "SMES Output Power Control", output_level/1000) as num) * 1000 output_level = max(0, min(output_level_max, output_level)) // clamp to range return 1 - investigate_log("input/output; on":"off"] | Input-mode: [input_attempt?"auto":"off"] by [usr.key]","singulo") - log_game("SMES([x],[y],[z]) [key_name(usr)] changed settings: I:[input_level]([input_attempt]), O:[output_level]([output_attempt])") - return 1 /obj/machinery/power/smes/proc/inputting(var/do_input) input_attempt = do_input diff --git a/html/changelogs/atlantiscze-power.yml b/html/changelogs/atlantiscze-power.yml new file mode 100644 index 0000000000..6a850e9920 --- /dev/null +++ b/html/changelogs/atlantiscze-power.yml @@ -0,0 +1,37 @@ +################################ +# 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 +################################# + +# Your name. +author: N3X15 + +# 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: "Added a changelog editing system that should cause fewer conflicts and more accurate timestamps." + - rscdel: "Killed innocent kittens."