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

New Radial Menu for Xeno Evolve #5022

Merged
merged 6 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/Evolution.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@
if(!length(castes_available))
to_chat(src, SPAN_WARNING("The Hive is not capable of supporting any castes you can evolve to yet."))
return
var/castepick
if((client.prefs && client.prefs.no_radials_preference) || !hive.evolution_menu_images)
castepick = tgui_input_list(usr, "You are growing into a beautiful alien! It is time to choose a caste.", "Evolve", castes_available, theme="hive_status")
else
var/list/fancy_caste_list = list()
for(var/caste in castes_available)
fancy_caste_list[caste] = hive.evolution_menu_images[caste]

var/castepick = tgui_input_list(usr, "You are growing into a beautiful alien! It is time to choose a caste.", "Evolve", castes_available, theme="hive_status")
castepick = show_radial_menu(src, src.client?.eye, fancy_caste_list)
if(!castepick) //Changed my mind
return

Expand Down
16 changes: 16 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@
var/datum/tacmap/drawing/xeno/tacmap
var/minimap_type = MINIMAP_FLAG_XENO

/*Stores the image()'s for the xeno evolution radial menu
To add an image for your caste - add an icon to icons/mob/xenos/radial_xenos.dmi
Icon size should be 32x32, to make them fit within the radial menu border size your icon 22x22 and leave 10px transparent border.
The name of the icon should be the same as the XENO_CASTE_ define for that caste eg. #define XENO_CASTE_DRONE "Drone"
*/
var/static/list/evolution_menu_images

/datum/hive_status/New()
mutators.hive = src
hive_ui = new(src)
Expand All @@ -377,8 +384,17 @@
if(hivenumber != XENO_HIVE_NORMAL)
return

if(!evolution_menu_images)
evolution_menu_images = list()
generate_evo_menu_images()

RegisterSignal(SSdcs, COMSIG_GLOB_POST_SETUP, PROC_REF(post_setup))

///Generate the image()'s requried for the evolution radial menu.
/datum/hive_status/proc/generate_evo_menu_images()
for(var/datum/caste_datum/caste as anything in subtypesof(/datum/caste_datum))
evolution_menu_images[initial(new_caste.caste_type)] = image('icons/mob/xenos/radial_xenos.dmi', initial(new_caste.caste_type))

Check failure on line 396 in code/modules/mob/living/carbon/xenomorph/xeno_defines.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "new_caste"

Check warning on line 396 in code/modules/mob/living/carbon/xenomorph/xeno_defines.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "caste_type"

Check failure on line 396 in code/modules/mob/living/carbon/xenomorph/xeno_defines.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "new_caste"

Check warning on line 396 in code/modules/mob/living/carbon/xenomorph/xeno_defines.dm

View workflow job for this annotation

GitHub Actions / Run Linters

field access requires static type: "caste_type"
Birdtalon marked this conversation as resolved.
Show resolved Hide resolved

/datum/hive_status/proc/post_setup()
SIGNAL_HANDLER

Expand Down
Binary file added icons/mob/xenos/radial_xenos.dmi
Binary file not shown.
Loading