Skip to content

Commit

Permalink
New Radial Menu for Xeno Evolve (#5022)
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. -->

# About the pull request

Converts xeno evolve menu to a radial one.


![dreamseeker_2023-11-24_14-56-31](https://github.com/cmss13-devs/cmss13/assets/25027759/f8af0b0c-16ce-485f-bd31-a0780adda076)

![dreamseeker_2023-11-24_14-50-01](https://github.com/cmss13-devs/cmss13/assets/25027759/62e47d79-731a-4f16-86a8-a63e5ab24326)

![dreamseeker_2023-11-24_14-56-20](https://github.com/cmss13-devs/cmss13/assets/25027759/3be32724-5bf3-4438-87d7-9a4666902ffd)

# Explain why it's good for the game

It looks cool!

# Testing Photographs and Procedure
<!-- Include any screenshots/videos/debugging steps of the modified code
functioning successfully, ideally including edge cases. -->
<details>
<summary>Screenshots & Videos</summary>


![dreamseeker_2023-11-24_14-56-31](https://github.com/cmss13-devs/cmss13/assets/25027759/f8af0b0c-16ce-485f-bd31-a0780adda076)

![dreamseeker_2023-11-24_14-50-01](https://github.com/cmss13-devs/cmss13/assets/25027759/62e47d79-731a-4f16-86a8-a63e5ab24326)

![dreamseeker_2023-11-24_14-56-20](https://github.com/cmss13-devs/cmss13/assets/25027759/3be32724-5bf3-4438-87d7-9a4666902ffd)


</details>


# Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
label your changes in the changelog. Please note that maintainers freely
reserve the right to remove and add tags should they deem it
appropriate. You can attempt to finagle the system all you want, but
it's best to shoot for clear communication right off the bat. -->
<!-- If you add a name after the ':cl', that name will be used in the
changelog. You must add your CKEY after the CL if your GitHub name
doesn't match. Maintainers freely reserve the right to remove and add
tags should they deem it appropriate. -->

:cl:
add: Radial Menu for xeno Evolve
/:cl:

<!-- Both :cl:'s are required for the changelog to work! -->

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
Birdtalon and harryob committed Dec 3, 2023
1 parent a404e66 commit 02ab728
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
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 @@ -367,6 +367,13 @@

var/list/available_nicknumbers = list()

/*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 @@ -382,8 +389,17 @@
for(var/number in 1 to 999)
available_nicknumbers += number

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(caste.caste_type)] = image('icons/mob/xenos/radial_xenos.dmi', initial(caste.caste_type))

/datum/hive_status/proc/post_setup()
SIGNAL_HANDLER

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

0 comments on commit 02ab728

Please sign in to comment.