Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial port of tg points of intrest and improved orbit menu #3320

Merged
merged 10 commits into from
Sep 25, 2024
12 changes: 6 additions & 6 deletions _maps/map_files/generic/CentCom.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/turf/open/floor/plasteel/dark,
/area/tdome/tdomeadmin)
"afh" = (
/obj/machinery/computer/helm{
/obj/machinery/computer{
dir = 4
},
/obj/effect/turf_decal/industrial/warning{
Expand Down Expand Up @@ -1356,7 +1356,7 @@
/turf/open/floor/plasteel,
/area/wizard_station)
"ara" = (
/obj/machinery/computer/helm,
/obj/machinery/computer,
/turf/open/floor/plasteel,
/area/wizard_station)
"ard" = (
Expand Down Expand Up @@ -3939,7 +3939,7 @@
/turf/open/floor/mineral/titanium/blue,
/area/centcom/evac)
"aLP" = (
/obj/machinery/computer/helm{
/obj/machinery/computer{
dir = 1
},
/turf/open/floor/mineral/titanium/blue,
Expand Down Expand Up @@ -8827,7 +8827,7 @@
},
/area/centcom)
"gFU" = (
/obj/machinery/computer/helm,
/obj/machinery/computer,
/obj/effect/turf_decal/industrial/warning{
dir = 6
},
Expand Down Expand Up @@ -12230,7 +12230,7 @@
/turf/open/floor/plasteel/dark,
/area/tdome/tdomeadmin)
"nEL" = (
/obj/machinery/computer/helm,
/obj/machinery/computer,
/obj/effect/turf_decal/industrial/warning{
dir = 10
},
Expand Down Expand Up @@ -15778,7 +15778,7 @@
/turf/open/floor/plasteel/dark,
/area/ctf)
"vcL" = (
/obj/machinery/computer/helm,
/obj/machinery/computer,
/obj/effect/turf_decal/corner/transparent/bar,
/obj/effect/turf_decal/corner/transparent/bar{
dir = 1
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/dcs/signals/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -735,3 +735,9 @@

///sent when the access on an id is changed/updated, ensures wallets get updated once ids generate there access
#define COSMIG_ACCESS_UPDATED "acces_updated"

// Point of interest signals
/// Sent from base of /datum/controller/subsystem/points_of_interest/proc/on_poi_element_added : (atom/new_poi)
#define COMSIG_ADDED_POINT_OF_INTEREST "added_point_of_interest"
/// Sent from base of /datum/controller/subsystem/points_of_interest/proc/on_poi_element_removed : (atom/old_poi)
#define COMSIG_REMOVED_POINT_OF_INTEREST "removed_point_of_interest"
36 changes: 36 additions & 0 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,42 @@
};\
} while(FALSE)


/**
* Custom binary search sorted insert utilising comparison procs instead of vars.
* INPUT: Object to be inserted
* LIST: List to insert object into
* TYPECONT: The typepath of the contents of the list
* COMPARE: The object to compare against, usualy the same as INPUT
* COMPARISON: The plaintext name of a proc on INPUT that takes a single argument to accept a single element from LIST and returns a positive, negative or zero number to perform a comparison.
* COMPTYPE: How should the values be compared? Either COMPARE_KEY or COMPARE_VALUE.
*/
#define BINARY_INSERT_PROC_COMPARE(INPUT, LIST, TYPECONT, COMPARE, COMPARISON, COMPTYPE) \
do {\
var/list/__BIN_LIST = LIST;\
var/__BIN_CTTL = length(__BIN_LIST);\
if(!__BIN_CTTL) {\
__BIN_LIST += INPUT;\
} else {\
var/__BIN_LEFT = 1;\
var/__BIN_RIGHT = __BIN_CTTL;\
var/__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
var ##TYPECONT/__BIN_ITEM;\
while(__BIN_LEFT < __BIN_RIGHT) {\
__BIN_ITEM = COMPTYPE;\
if(__BIN_ITEM.##COMPARISON(COMPARE) <= 0) {\
__BIN_LEFT = __BIN_MID + 1;\
} else {\
__BIN_RIGHT = __BIN_MID;\
};\
__BIN_MID = (__BIN_LEFT + __BIN_RIGHT) >> 1;\
};\
__BIN_ITEM = COMPTYPE;\
__BIN_MID = __BIN_ITEM.##COMPARISON(COMPARE) > 0 ? __BIN_MID : __BIN_MID + 1;\
__BIN_LIST.Insert(__BIN_MID, INPUT);\
};\
} while(FALSE)

//Returns a list in plain english as a string
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
var/total = length(input)
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
SSblackbox.record_feedback("associative", "antagonists", 1, antag_info)

/datum/controller/subsystem/ticker/proc/record_nuke_disk_location()
var/obj/item/disk/nuclear/N = locate() in GLOB.poi_list
var/obj/item/disk/nuclear/N = locate() in SSpoints_of_interest.other_points_of_interest
if(N)
var/list/data = list()
var/turf/T = get_turf(N)
Expand Down
61 changes: 1 addition & 60 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -294,65 +294,6 @@ Turf and target are separate in case you want to teleport some distance from a t
/proc/ionnum()
return "[pick("!","@","#","$","%","^","&")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")][pick("!","@","#","$","%","^","&","*")]"

//Returns a list of all items of interest with their name
/proc/getpois(mobs_only = FALSE, skip_mindless = FALSE, specify_dead_role = TRUE)
var/list/mobs = sortmobs()
var/list/namecounts = list()
var/list/pois = list()
for(var/mob/M in mobs)
if(skip_mindless && (!M.mind && !M.ckey))
if(!isbot(M) && !iscameramob(M) && !ismegafauna(M))
continue
if(M.client && M.client.holder && M.client.holder.fakekey) //stealthmins
continue
var/name = avoid_assoc_duplicate_keys(M.name, namecounts) + M.get_realname_string()

if(M.stat == DEAD && specify_dead_role)
if(isobserver(M))
name += " \[ghost\]"
else
name += " \[dead\]"
pois[name] = M

if(!mobs_only)
for(var/atom/A in GLOB.poi_list)
if(!A || !A.loc)
continue
pois[avoid_assoc_duplicate_keys(A.name, namecounts)] = A

return pois
//Orders mobs by type then by name
/proc/sortmobs()
var/list/moblist = list()
var/list/sortmob = sortNames(GLOB.mob_list)
for(var/mob/living/silicon/ai/M in sortmob)
moblist.Add(M)
for(var/mob/camera/M in sortmob)
moblist.Add(M)
for(var/mob/living/silicon/pai/M in sortmob)
moblist.Add(M)
for(var/mob/living/silicon/robot/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/human/M in sortmob)
moblist.Add(M)
for(var/mob/living/brain/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/alien/M in sortmob)
moblist.Add(M)
for(var/mob/dead/observer/M in sortmob)
moblist.Add(M)
for(var/mob/dead/new_player/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/monkey/M in sortmob)
moblist.Add(M)
for(var/mob/living/simple_animal/slime/M in sortmob)
moblist.Add(M)
for(var/mob/living/simple_animal/M in sortmob)
moblist.Add(M)
for(var/mob/living/carbon/true_devil/M in sortmob)
moblist.Add(M)
return moblist

// Format a power value in W, kW, MW, or GW.
/proc/DisplayPower(powerused)
if(powerused < 1000) //Less than a kW
Expand Down Expand Up @@ -384,7 +325,7 @@ Turf and target are separate in case you want to teleport some distance from a t
/proc/get_mob_by_ckey(key)
if(!key)
return
var/list/mobs = sortmobs()
var/list/mobs = SSpoints_of_interest.get_mob_pois()
for(var/mob/M in mobs)
if(M.ckey == key)
return M
Expand Down
2 changes: 0 additions & 2 deletions code/_globalvars/lists/objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ GLOBAL_LIST_EMPTY(apcs_list)
GLOBAL_LIST_EMPTY(tracked_implants)
/// List of implants the prisoner console can track and send inject commands too
GLOBAL_LIST_EMPTY(tracked_chem_implants)
/// List of points of interest for observe/follow
GLOBAL_LIST_EMPTY(poi_list)
/// List of all pinpointers. Used to change stuff they are pointing to all at once.
GLOBAL_LIST_EMPTY(pinpointer_list)
/// List of all zombie_infection organs, for any mass "animation"
Expand Down
Loading
Loading