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
This commit is contained in:
Atlantiscze
2020-04-20 08:16:19 +02:00
parent 78925e2993
commit fbf33fc5df
4 changed files with 47 additions and 6 deletions
+4 -2
View File
@@ -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)
+6 -1
View File
@@ -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, "<span class='warning'>[get_wattage()]W in power network.</span>")
to_chat(user, "<span class='warning'>[get_wattage()] in power network.</span>")
else
to_chat(user, "<span class='warning'>The cable is not powered.</span>")
@@ -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"
-3
View File
@@ -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; <font color='[input_level>output_level?"green":"red"][input_level]/[output_level]</font> | Output-mode: [output_attempt?"<font color='green'>on</font>":"<font color='red'>off</font>"] | Input-mode: [input_attempt?"<font color='green'>auto</font>":"<font color='red'>off</font>"] 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
+37
View File
@@ -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."