Skip to content

Commit

Permalink
onenewbuttoninvv
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocma-san committed Nov 28, 2024
1 parent a0772f5 commit 0ab1d0c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/~ff_defines/vv.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define VV_HK_GIVE_ADDICTION "give_addiction"
33 changes: 33 additions & 0 deletions tff_modular/modules/extra_vv/extra_carbon_vv.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* EXTRA CARBON VV
*/
/mob/living/carbon/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION(VV_HK_GIVE_ADDICTION, "Give/Remove Addiction")

/mob/living/carbon/vv_do_topic(list/href_list)
. = ..()

if(href_list[VV_HK_GIVE_ADDICTION])
if(!check_rights(R_VAREDIT))
return
if(!mind) //Addictions are stored in the mind...
return

switch(tgui_alert(usr, "Give or Remove addictions?", "Addictions", list("Give", "Remove", "Cancel")))
if("Give")
var/chosen_addiction = input(usr, "Choose an addiction to add.", "Choose an addiction.") as null|anything in sort_list(SSaddiction.all_addictions, GLOBAL_PROC_REF(cmp_typepaths_asc))
var/addiction_points = input(usr, "Choose the amount to add.\nAt least 600 are required to obtain an addiction.", "Choose the amount.", MAX_ADDICTION_POINTS) as num|null
if(chosen_addiction && addiction_points)
mind.add_addiction_points(chosen_addiction, addiction_points)
return
if("Remove")
if(!mind.active_addictions)
tgui_alert(usr, "No active addictions.", "Remove addictions")
return
var/chosen_addiction = input(usr, "Choose an addiction to remove.", "Choose an addiction.") as null|anything in sort_list(mind.active_addictions, GLOBAL_PROC_REF(cmp_typepaths_asc))
if(chosen_addiction)
mind.remove_addiction_points(chosen_addiction, MAX_ADDICTION_POINTS)
return
if("Cancel")
return
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@
#include "code\__DEFINES\~ff_defines\nabber_clothes_pathes.dm"
#include "code\__DEFINES\~ff_defines\say.dm"
#include "code\__DEFINES\~ff_defines\text.dm"
#include "code\__DEFINES\~ff_defines\vv.dm"
#include "code\__DEFINES\~ff_defines\__HELPERS\global_lists.dm"
#include "code\__DEFINES\~ff_defines\__HELPERS\ishelpers.dm"
#include "code\__DEFINES\~ff_defines\__HELPERS\names.dm"
Expand Down Expand Up @@ -8808,6 +8809,7 @@
#include "tff_modular\modules\drinks\skrelluq\reaction.dm"
#include "tff_modular\modules\drinks\skrelluq\reagent.dm"
#include "tff_modular\modules\drone\code\droneDispenser.dm"
#include "tff_modular\modules\extra_vv\extra_carbon_vv.dm"
#include "tff_modular\modules\holidays_decor\halloween\halloween-craft.dm"
#include "tff_modular\modules\holidays_decor\halloween\halloween-decor.dm"
#include "tff_modular\modules\holidays_decor\new_year\decorations.dm"
Expand Down

0 comments on commit 0ab1d0c

Please sign in to comment.