From 60427eee433466f50cb528f0d69a62394e406d20 Mon Sep 17 00:00:00 2001 From: dwasint <82520990+dwasint@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:30:44 -0800 Subject: [PATCH] adds better drag and some new radial tooltips --- code/_onclick/drag_drop.dm | 6 ++++++ code/modules/tooltip/tooltip.html | 11 +++++++++++ monkestation/code/modules/bloody_cult/mind_ui.dm | 7 +++++-- .../code/modules/bloody_cult/mind_uis/blood_cult.dm | 11 +++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/code/_onclick/drag_drop.dm b/code/_onclick/drag_drop.dm index c4f8de8e63bc..2040a8aedacc 100644 --- a/code/_onclick/drag_drop.dm +++ b/code/_onclick/drag_drop.dm @@ -87,6 +87,9 @@ if(QDELETED(object)) //Yep, you can click on qdeleted things before they have time to nullspace. Fun. return SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEDOWN, object, location, control, params) + if(istype(object, /obj/abstract/mind_ui_element/hoverable/movable)) + var/obj/abstract/mind_ui_element/hoverable/movable/ui_object = object + ui_object.MouseDown(location, control, params) if(mouse_down_icon) mouse_pointer_icon = mouse_down_icon var/delay = mob.CanMobAutoclick(object, location, params) @@ -103,6 +106,9 @@ /client/MouseUp(object, location, control, params) if(SEND_SIGNAL(src, COMSIG_CLIENT_MOUSEUP, object, location, control, params) & COMPONENT_CLIENT_MOUSEUP_INTERCEPT) click_intercept_time = world.time + if(istype(object, /obj/abstract/mind_ui_element/hoverable/movable)) + var/obj/abstract/mind_ui_element/hoverable/movable/ui_object = object + ui_object.MouseUp(location, control, params) if(mouse_up_icon) mouse_pointer_icon = mouse_up_icon selected_target[1] = null diff --git a/code/modules/tooltip/tooltip.html b/code/modules/tooltip/tooltip.html index cb7923322539..52e2b7efefd3 100644 --- a/code/modules/tooltip/tooltip.html +++ b/code/modules/tooltip/tooltip.html @@ -86,6 +86,17 @@ .detective .wrap {border-color: #2c0F0c;} .detective .wrap {color: #c7b08b; border-color: #2c0F0c; background-color: #221c1a;} + .radial-default .wrap {border-color: #2B2B33;} + .radial-default .content {color: #6087A0; border-color: #2B2B33; background-color: #36363C;} + .radial-cult .wrap {border-color: #000000;} + .radial-cult .content {font-family: 'Courier New'; color: #ffec66 ; border-color: #FF0000; background-color:#180404;} + .radial-cult2 .wrap {border-color: #2f0000;} + .radial-cult2 .content {font-family: 'Courier New'; color: #E80000 ; border-color: #000000; background-color:#221817;} + .radial-spider .wrap {border-color: #2f1800;} + .radial-spider .content {color: #944a00 ; border-color: #000000; background-color:#221e17;} + .radial-malf .wrap {border-color: #000000;} + .radial-malf .content {font-family: 'Courier New'; color: #95fc0e ; border-color: #00FF00; background-color:#041804;} + diff --git a/monkestation/code/modules/bloody_cult/mind_ui.dm b/monkestation/code/modules/bloody_cult/mind_ui.dm index c70f491f8411..d55c33a11bcb 100644 --- a/monkestation/code/modules/bloody_cult/mind_ui.dm +++ b/monkestation/code/modules/bloody_cult/mind_ui.dm @@ -268,6 +268,9 @@ GLOBAL_LIST_INIT(mind_ui_id_to_type, list()) var/offset_x = 0 var/offset_y = 0 + var/const_offset_y = 0 //these are constant offsets to ensure moving is seemless + var/const_offset_x = 0 //these are constant offsets to ensure moving is seemless + /obj/abstract/mind_ui_element/New(turf/loc, var/datum/mind_ui/P) if (!istype(P)) qdel(src) @@ -487,8 +490,8 @@ GLOBAL_LIST_INIT(mind_ui_id_to_type, list()) var/list/dest_loc_Y = splittext(dest_loc_params[2],":") var/dest_pix_x = text2num(dest_loc_X[2]) - round(I.Width()/2) var/dest_pix_y = text2num(dest_loc_Y[2]) - round(I.Height()/2) - var/dest_x_val = text2num(dest_loc_X[1])*32 + dest_pix_x - var/dest_y_val = text2num(dest_loc_Y[1])*32 + dest_pix_y + var/dest_x_val = text2num(dest_loc_X[1])*32 + dest_pix_x + const_offset_x + var/dest_y_val = text2num(dest_loc_Y[1])*32 + dest_pix_y + const_offset_y //this probably needs some more advanced math based on screen pos type //and calculate the offset between the two, which we can then add to either the element or the whole UI if (move_whole_ui) diff --git a/monkestation/code/modules/bloody_cult/mind_uis/blood_cult.dm b/monkestation/code/modules/bloody_cult/mind_uis/blood_cult.dm index fd11a5653fe4..378045e337e9 100644 --- a/monkestation/code/modules/bloody_cult/mind_uis/blood_cult.dm +++ b/monkestation/code/modules/bloody_cult/mind_uis/blood_cult.dm @@ -157,6 +157,8 @@ GLOBAL_LIST_INIT(blood_communion, list()) move_whole_ui = TRUE + const_offset_y = -32 + const_offset_x = -16 //////////////////////////////////////////////////Valid////////////////// @@ -485,6 +487,9 @@ GLOBAL_LIST_INIT(blood_communion, list()) move_whole_ui = TRUE + const_offset_y = -18 + const_offset_x = -16 + //////////////////////////////////////////////////////////////////// // // // BLOODCULT - LEFT PANEL // @@ -705,6 +710,8 @@ GLOBAL_LIST_INIT(blood_communion, list()) mouse_opacity = 1 move_whole_ui = TRUE + const_offset_y = -16 + const_offset_x = -16 //------------------------------------------------------------ @@ -1864,6 +1871,8 @@ GLOBAL_LIST_INIT(blood_communion, list()) mouse_opacity = 1 move_whole_ui = TRUE + const_offset_y = -16 + const_offset_x = -16 @@ -2032,6 +2041,8 @@ GLOBAL_LIST_INIT(blood_communion, list()) mouse_opacity = 1 move_whole_ui = TRUE + const_offset_x = -16 + const_offset_y = -16 //------------------------------------------------------------