Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into bugfix-8
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Dec 20, 2024
2 parents b94cb70 + ee00e4c commit 0686c81
Show file tree
Hide file tree
Showing 13 changed files with 341 additions and 699 deletions.
2 changes: 1 addition & 1 deletion citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "code\__DEFINES\fonts.dm"
#include "code\__DEFINES\frames.dm"
#include "code\__DEFINES\gamemode.dm"
#include "code\__DEFINES\gradient.dm"
#include "code\__DEFINES\holidays.dm"
#include "code\__DEFINES\holomap.dm"
#include "code\__DEFINES\icon_smoothing.dm"
Expand Down Expand Up @@ -428,7 +429,6 @@
#include "code\__HELPERS\game\turfs\offsets.dm"
#include "code\__HELPERS\graphs\astar.dm"
#include "code\__HELPERS\icons\alpha.dm"
#include "code\__HELPERS\icons\color.dm"
#include "code\__HELPERS\icons\download.dm"
#include "code\__HELPERS\icons\flatten.dm"
#include "code\__HELPERS\icons\hologram.dm"
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/gradient.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// spacemandmm doesn't really implement gradient() right, so let's just handle that here yeah?
#define rgb_gradient(index, args...) UNLINT(gradient(args, index))
#define hsl_gradient(index, args...) UNLINT(gradient(args, space = COLORSPACE_HSL, index))
#define hsv_gradient(index, args...) UNLINT(gradient(args, space = COLORSPACE_HSV, index))
900 changes: 257 additions & 643 deletions code/__HELPERS/icons.dm

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions code/__HELPERS/icons/color.dm

This file was deleted.

9 changes: 0 additions & 9 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1372,15 +1372,6 @@ var/list/WALLITEMS = list(
if(337.5)
return "North-Northwest"

/atom/proc/Shake(pixelshiftx = 15, pixelshifty = 15, duration = 250)
var/initialpixelx = pixel_x
var/initialpixely = pixel_y
var/shiftx = rand(-pixelshiftx,pixelshiftx)
var/shifty = rand(-pixelshifty,pixelshifty)
animate(src, pixel_x = pixel_x + shiftx, pixel_y = pixel_y + shifty, time = 0.2, loop = duration)
pixel_x = initialpixelx
pixel_y = initialpixely

/**
* get_holder_at_turf_level(): Similar to get_turf(), will return the "highest up" holder of this atom, excluding the turf.
* Example: A fork inside a box inside a locker will return the locker. Essentially, get_just_before_turf().
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/gear_painter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@

/obj/machinery/gear_painter/proc/check_valid_color(list/cm, mob/user)
if(!islist(cm)) // normal
var/list/HSV = ReadHSV(RGBtoHSV(cm))
var/list/HSV = rgb2hsv(cm)
if(HSV[3] < minimum_normal_lightness)
temp = "[cm] is too dark (Minimum lightness: [minimum_normal_lightness])"
return FALSE
Expand All @@ -294,7 +294,7 @@
// We test using full red, green, blue, and white
// A predefined number of them must pass to be considered valid
var/passed = 0
#define COLORTEST(thestring, thematrix) passed += (ReadHSV(RGBtoHSV(RGBMatrixTransform(thestring, thematrix)))[3] >= minimum_matrix_lightness)
#define COLORTEST(thestring, thematrix) passed += (rgb2hsv(RGBMatrixTransform(thestring, thematrix))[3] >= minimum_matrix_lightness)
COLORTEST("FF0000", cm)
COLORTEST("00FF00", cm)
COLORTEST("0000FF", cm)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/stream_projector/medichine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ GLOBAL_LIST_EMPTY(medichine_cell_datums)
entity_beam.segmentation.color = beam_color

/obj/item/stream_projector/medichine/proc/beam_color(color)
var/list/decoded = ReadRGB(color)
var/list/decoded = rgb2num(color)
return list(
decoded[1] / 255, decoded[2] / 255, decoded[3] / 255,
0, 0, 0,
Expand Down Expand Up @@ -539,7 +539,7 @@ GLOBAL_LIST_EMPTY(medichine_cell_datums)
var/list/color_rgb_list

/datum/medichine_cell/New()
color_rgb_list = ReadRGB(color)
color_rgb_list = rgb2num(color)
for(var/i in 1 to length(effects))
var/datum/medichine_effect/effect = effects[i]
if(istype(effect))
Expand Down
18 changes: 9 additions & 9 deletions code/game/objects/obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,8 @@
color = colors[1]
if(COLORATION_MODE_RG_MATRIX)
ASSERT(length(colors) == 2)
var/list/red_decoded = ReadRGB(colors[1])
var/list/green_decoded = ReadRGB(colors[2])
var/list/red_decoded = rgb2num(colors[1])
var/list/green_decoded = rgb2num(colors[2])
color = list(
red_decoded[1] / 255, red_decoded[2] / 255, red_decoded[3] / 255, 0,
green_decoded[1] / 255, green_decoded[2] / 255, green_decoded[3] / 255, 0,
Expand All @@ -629,8 +629,8 @@
)
if(COLORATION_MODE_GB_MATRIX)
ASSERT(length(colors) == 2)
var/list/green_decoded = ReadRGB(colors[1])
var/list/blue_decoded = ReadRGB(colors[2])
var/list/green_decoded = rgb2num(colors[1])
var/list/blue_decoded = rgb2num(colors[2])
color = list(
0, 0, 0, 0,
green_decoded[1] / 255, green_decoded[2] / 255, green_decoded[3] / 255, 0,
Expand All @@ -639,8 +639,8 @@
)
if(COLORATION_MODE_RB_MATRIX)
ASSERT(length(colors) == 2)
var/list/red_decoded = ReadRGB(colors[1])
var/list/blue_decoded = ReadRGB(colors[2])
var/list/red_decoded = rgb2num(colors[1])
var/list/blue_decoded = rgb2num(colors[2])
color = list(
red_decoded[1] / 255, red_decoded[2] / 255, red_decoded[3] / 255, 0,
0, 0, 0, 0,
Expand All @@ -649,9 +649,9 @@
)
if(COLORATION_MODE_RGB_MATRIX)
ASSERT(length(colors) == 3)
var/list/red_decoded = ReadRGB(colors[1])
var/list/green_decoded = ReadRGB(colors[2])
var/list/blue_decoded = ReadRGB(colors[3])
var/list/red_decoded = rgb2num(colors[1])
var/list/green_decoded = rgb2num(colors[2])
var/list/blue_decoded = rgb2num(colors[3])
color = list(
red_decoded[1] / 255, red_decoded[2] / 255, red_decoded[3] / 255, 0,
green_decoded[1] / 255, green_decoded[2] / 255, green_decoded[3] / 255, 0,
Expand Down
4 changes: 2 additions & 2 deletions code/modules/integrated_electronics/subtypes/converters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
/obj/item/integrated_circuit/converter/hsv2hex
name = "hsv to hexadecimal converter"
desc = "This circuit can convert a HSV (Hue, Saturation, and Value) color to a Hexadecimal RGB color."
extended_desc = "The first pin controls tint (0-359), the second pin controls how intense the tint is (0-255), \
extended_desc = "The first pin controls tint (0-360), the second pin controls how intense the tint is (0-255), \
and the third controls how bright the tint is (0 for black, 127 for normal, 255 for white)."
icon_state = "hsv-hex"
inputs = list(
Expand All @@ -476,7 +476,7 @@
var/saturation = get_pin_data(IC_INPUT, 2)
var/value = get_pin_data(IC_INPUT, 3)
if(isnum(hue) && isnum(saturation) && isnum(value))
result = HSVtoRGB(hsv(AngleToHue(hue),saturation,value))
result = hsv2rgb(list(hue, saturation, value))

set_pin_data(IC_OUTPUT, 1, result)
push_data()
Expand Down
57 changes: 51 additions & 6 deletions code/modules/integrated_electronics/subtypes/manipulation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,12 @@
name = "mining drill"
desc = "A mining drill that can drill through rocks."
extended_desc = "A mining drill to strike the earth. It takes some time to get the job done and \
must remain stationary until complete."
must remain stationary until complete. By default an advanced mining drill is installed but better once can be attached."
category_text = "Manipulation"
ext_cooldown = 1
ext_cooldown = 5 //Required to not make instant death circuits
complexity = 40
cooldown_per_use = 3 SECONDS
ext_cooldown = 6 SECONDS
cooldown_per_use = 1 //We have 'busy' as our safty net
can_be_asked_input = TRUE
inputs = list(
"target" = IC_PINTYPE_REF
)
Expand All @@ -653,6 +653,9 @@
spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 1000

var/obj/item/pickaxe/current_pickaxe
var/digspeed = 3 SECONDS

var/busy = FALSE
var/targetlock
var/usedx
Expand All @@ -662,15 +665,57 @@
var/drill_force = 15
var/turf/simulated/mineral

/obj/item/integrated_circuit/mining/mining_drill/proc/ask_for_input(mob/living/user, obj/item/I, a_intent)
if(!current_pickaxe)
if(!isobj(I))
return FALSE
attackby_react(I, user, a_intent)
else
attack_self(user)

/obj/item/integrated_circuit/mining/mining_drill/attackby_react(var/obj/item/pickaxe/I, var/mob/living/user)
//Check if it truly is a pickaxe
if(!(istype(I,/obj/item/pickaxe)))
to_chat(user,"<span class='warning'>The [I.name] doesn't seem to fit in here.</span>")
return

//Check if there is no other pickaxe already inside
if(current_pickaxe)
to_chat(user,"<span class='notice'>There is already a [current_pickaxe.name] inside.</span>")
return

if(!user.attempt_insert_item_for_installation(I, src))
return

current_pickaxe = I
to_chat(user,"<span class='warning'>You attach the [I.name] inside the assembly.</span>")
digspeed = I.digspeed

/obj/item/integrated_circuit/mining/mining_drill/attack_self(mob/user)
. = ..()
if(.)
return
//Check if no drill is attached
if(!current_pickaxe)
to_chat(user, "<span class='notice'>There is currently no mining tool attached.</span>")
return

//Remove beaker and put in user's hands/location
to_chat(user, "<span class='notice'>You yank the [current_pickaxe] out of the slot.</span>")
user.put_in_hands(current_pickaxe)
current_pickaxe = null
//Reset to default
digspeed = 3 SECONDS

/obj/item/integrated_circuit/mining/mining_drill/do_work(ord)
if(ord == 1)
var/atom/target = get_pin_data(IC_INPUT, 1)
var/drill_delay = null
if(!target || busy)
if(!target || busy || !target.Adjacent(assembly))
activate_pin(3)
return
src.assembly.visible_message(SPAN_DANGER("[assembly] starts to drill [target]!"), null, SPAN_WARNING("You hear a drill."))
drill_delay = isturf(target)? 6 SECONDS : isliving(target) ? issimple(target) ? 2 SECONDS : 3 SECONDS : 4 SECONDS
drill_delay = isturf(target)? digspeed : isliving(target) ? issimple(target) ? 2 SECONDS : 3 SECONDS : 4 SECONDS
busy = TRUE
targetlock = target
usedx = assembly.loc.x
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/rendering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@
if(husk)
base_icon.ColorTone(husk_color_mod)
else if(hulk)
var/list/tone = ReadRGB(hulk_color_mod)
var/list/tone = rgb2num(hulk_color_mod)
base_icon.MapColors(rgb(tone[1],0,0),rgb(0,tone[2],0),rgb(0,0,tone[3]))

// Handle husk overlay.
Expand Down
17 changes: 11 additions & 6 deletions code/modules/paperwork/paper/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,17 @@
. += "<span class='notice'>You have to go closer if you want to read it.</span>"
return

/obj/item/paper/proc/show_content(var/mob/user, var/forceshow=0)
if(!user.client)
return
SSassets.send_asset_pack(user.client, /datum/asset_pack/simple/logos)
user.client.asset_cache_flush_browse_queue()
if(!(istype(user, /mob/living/carbon/human) || istype(user, /mob/observer/dead) || istype(user, /mob/living/silicon)) && !forceshow)
/obj/item/paper/proc/show_content(mob/user, forceshow=0)
var/client/C
if (istype(user))
C = user.client
if (istype(user, /client))
C = user
if(C)
SSassets.send_asset_pack(C, /datum/asset_pack/simple/logos)
C.asset_cache_flush_browse_queue()

if(!(ishuman(user) || istype(user, /mob/observer/dead) || istype(user, /mob/living/silicon)) && !forceshow)
user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(info)][stamps]</BODY></HTML>", "window=[name]")
onclose(user, "[name]")
else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/sprite_accessories/sprite_accessory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ GLOBAL_LIST_EMPTY(sprite_accessory_icon_cache)
continue
if(!istext(colors[i]))
stack_trace("attempted to use non-text color string with legacy additive; this is not supported.")
var/list/decoded = ReadRGB(colors[i])
var/list/decoded = rgb2num(colors[i])
var/list/computed = list(
1, 0, 0,
0, 1, 0,
Expand Down

0 comments on commit 0686c81

Please sign in to comment.