mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
This is part of my ongoing project to remove the Stat panel which you can read/contribute to here: https://hackmd.io/443_dE5lRWeEAp9bjGcKYw Replaces the pAI button at the bottom of Ghost's HUD with a new button for Ghost settings Default look  With fun verbs (admin only, the 2 buttons at the top right), No body, and lag switches on (disables T-Ray and Zooming)  The ghost icon next to "re-enter body" is the DNR button, which requires double click. Extra view is now easier to understand, 0 is "default", anything more is extra vision you get. Goes to 3 for regular users, 7 for BYOND members. Removes the "Ghost" tab from the stat panel entirely, this replaces it. The Ghost tab of the stat panel is filled with barely functional stuff, like "Jump to Mob" which allows you to jump to "oranges ear" which teleports you to nullspace, or the 4 different jump to verbs for different things which is irrelevant from the Orbit menu and the many improvements it got over the years, and even the Notifications panel, which seems pretty useful, but because it's delegated to a small button filled with the rest of these it gets entirely drowned out. This puts all the important things in front of the user at the click of a button, meant to be easy to navigate and giving important information first. 🆑 add: Added a 'Ghost settings' button, taking the spot of the pAI candidate button and replacing the "Ghost" tab of the Stat panel. This button contains buttons pertinent to your time as an Observer. /🆑
44 lines
1.6 KiB
Plaintext
44 lines
1.6 KiB
Plaintext
/proc/getviewsize(view = world.view)
|
|
SHOULD_BE_PURE(TRUE)
|
|
|
|
if(isnum(view))
|
|
//resetting back to 0- this is the same as just checking !view but we want to be clear the point of the check.
|
|
if(view == 0)
|
|
return list(0, 0)
|
|
var/totalviewrange = (view < 0 ? -1 : 1) + 2 * view
|
|
return list(totalviewrange, totalviewrange)
|
|
else
|
|
var/list/viewrangelist = splittext(view, "x")
|
|
return list(text2num(viewrangelist[1]), text2num(viewrangelist[2]))
|
|
|
|
|
|
/// Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
|
|
/proc/view_to_pixels(view)
|
|
if(!view)
|
|
return list(0, 0)
|
|
var/list/view_info = getviewsize(view)
|
|
view_info[1] *= ICON_SIZE_X
|
|
view_info[2] *= ICON_SIZE_Y
|
|
return view_info
|
|
|
|
/**
|
|
* Frustrated with bugs in can_see(), this instead uses viewers for a much more effective approach.
|
|
* ### Things to note:
|
|
* - Src/source must be a mob. `viewers()` returns mobs.
|
|
* - Adjacent objects are always considered visible.
|
|
*/
|
|
|
|
/// The default tile-distance between two atoms for one to consider the other as visible.
|
|
#define DEFAULT_SIGHT_DISTANCE 7
|
|
|
|
/// Basic check to see if the src object can see the target object.
|
|
#define CAN_I_SEE(target) ((src in viewers(DEFAULT_SIGHT_DISTANCE, target)) || in_range(target, src))
|
|
|
|
|
|
/// Checks the visibility between two other objects.
|
|
#define CAN_THEY_SEE(target, source) ((source in viewers(DEFAULT_SIGHT_DISTANCE, target)) || in_range(target, source))
|
|
|
|
|
|
/// Further checks distance between source and target.
|
|
#define CAN_SEE_RANGED(target, source, dist) ((source in viewers(dist, target)) || in_range(target, source))
|