Skip to content

Commit

Permalink
adds better drag and some new radial tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasint committed Nov 7, 2024
1 parent bd4d382 commit 60427ee
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
6 changes: 6 additions & 0 deletions code/_onclick/drag_drop.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
11 changes: 11 additions & 0 deletions code/modules/tooltip/tooltip.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;}

</style>
</head>
<body>
Expand Down
7 changes: 5 additions & 2 deletions monkestation/code/modules/bloody_cult/mind_ui.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions monkestation/code/modules/bloody_cult/mind_uis/blood_cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ GLOBAL_LIST_INIT(blood_communion, list())

move_whole_ui = TRUE

const_offset_y = -32
const_offset_x = -16


//////////////////////////////////////////////////Valid//////////////////
Expand Down Expand Up @@ -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 //
Expand Down Expand Up @@ -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

//------------------------------------------------------------

Expand Down Expand Up @@ -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



Expand Down Expand Up @@ -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

//------------------------------------------------------------

Expand Down

0 comments on commit 60427ee

Please sign in to comment.