Skip to content

Commit

Permalink
Partial port of tg points of intrest and improved orbit menu (#3320)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Squash of #3219 rebased ontop of a revert of #3218 cause i fucked up the
commit history

- [x] Fix admin menu
- [x] Fix auto-observe

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
This massively improves the readability of the orbit menu.
You can now add custom points of interest pretty easily as it uses an
element now.

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: You can now see ships in the orbit menu and its alot prettier!
code: ported tg points of interest and a much improved orbit menu
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: FalloutFalcon <[email protected]>
  • Loading branch information
FalloutFalcon authored Sep 25, 2024
1 parent 065b41d commit 82ad017
Show file tree
Hide file tree
Showing 49 changed files with 1,135 additions and 407 deletions.
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

0 comments on commit 82ad017

Please sign in to comment.