From cb7e71a7b9a8893d02cafc10eaec67581f6f59d3 Mon Sep 17 00:00:00 2001 From: ItsSelis Date: Wed, 31 Aug 2022 16:51:51 +0200 Subject: [PATCH] Added Prefs --- code/__HELPERS/unsorted.dm | 6 +++--- code/_onclick/hud/movable_screen_objects.dm | 4 ++-- code/datums/explosion.dm | 6 +++--- code/modules/client/preferences.dm | 11 ++++++++++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 428784e953..08b2ae8079 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -249,7 +249,7 @@ Turf and target are separate in case you want to teleport some distance from a t var/list/borgs = active_free_borgs() if(borgs.len) if(user) - . = input(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs[1]) in borgs + . = tgui_input_list(user,"Unshackled cyborg signals detected:", "Cyborg Selection", borgs, borgs[1]) else . = pick(borgs) return . @@ -258,7 +258,7 @@ Turf and target are separate in case you want to teleport some distance from a t var/list/ais = active_ais() if(ais.len) if(user) - . = input(user,"AI signals detected:", "AI Selection", ais[1]) in ais + . = tgui_input_list(user,"AI signals detected:", "AI Selection", ais, ais[1]) else . = pick(ais) return . @@ -1086,7 +1086,7 @@ B --><-- A /proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) if (value == FALSE) //nothing should be calling us with a number, so this is safe - value = input("Enter type to find (blank for all, cancel to cancel)", "Search for type") as null|text + value = tgui_input_text("Enter type to find (blank for all, cancel to cancel)", "Search for type") if (isnull(value)) return value = trim(value) diff --git a/code/_onclick/hud/movable_screen_objects.dm b/code/_onclick/hud/movable_screen_objects.dm index eeb56d67f5..7d75fd8b5a 100644 --- a/code/_onclick/hud/movable_screen_objects.dm +++ b/code/_onclick/hud/movable_screen_objects.dm @@ -62,7 +62,7 @@ M.maptext = "Movable" M.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") as text + var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Movable UI Object") if(!screen_l) return @@ -81,7 +81,7 @@ S.maptext = "Snap" S.maptext_width = 64 - var/screen_l = input(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") as text + var/screen_l = tgui_input_text(usr,"Where on the screen? (Formatted as 'X,Y' e.g: '1,1' for bottom left)","Spawn Snap UI Object") if(!screen_l) return diff --git a/code/datums/explosion.dm b/code/datums/explosion.dm index ec0d35b5a3..1c0a6803c9 100644 --- a/code/datums/explosion.dm +++ b/code/datums/explosion.dm @@ -411,9 +411,9 @@ GLOBAL_LIST_EMPTY(explosions) heavy = 5 light = 7 if("Custom Bomb") - dev = input("Devastation range (Tiles):") as num - heavy = input("Heavy impact range (Tiles):") as num - light = input("Light impact range (Tiles):") as num + dev = tgui_input_number("Devastation range (Tiles):") + heavy = tgui_input_number("Heavy impact range (Tiles):") + light = tgui_input_number("Light impact range (Tiles):") var/max_range = max(dev, heavy, light) var/x0 = epicenter.x diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 256a34392b..9bfdb7de32 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1016,6 +1016,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Screentip Color: [screentip_color] Change
" dat += "tgui Monitors: [(tgui_lock) ? "Primary" : "All"]
" dat += "tgui Style: [(tgui_fancy) ? "Fancy" : "No Frills"]
" + dat += "Input Framework: [(tgui_input_mode) ? "tgui" : "BYOND"]
" + dat += "tgui Button Size: [(tgui_large_buttons) ? "Large" : "Small"]
" + dat += "tgui Buttons Swapped: [(tgui_swapped_buttons) ? "Yes" : "No"]
" dat += "Show Runechat Chat Bubbles: [chat_on_map ? "Enabled" : "Disabled"]
" dat += "Runechat message char limit: [max_chat_length]
" dat += "See Runechat for non-mobs: [see_chat_non_mob ? "Enabled" : "Disabled"]
" @@ -2004,7 +2007,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") if("age") - var/new_age = input(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference") as num|null + var/new_age = tgui_input_number(user, "Choose your character's age:\n([AGE_MIN]-[AGE_MAX])", "Character Preference", null, AGE_MAX, AGE_MIN) if(new_age) age = max(min( round(text2num(new_age)), AGE_MAX),AGE_MIN) @@ -3348,6 +3351,12 @@ GLOBAL_LIST_EMPTY(preferences_datums) buttons_locked = !buttons_locked if("tgui_fancy") tgui_fancy = !tgui_fancy + if("tgui_input_mode") + tgui_input_mode = !tgui_input_mode + if("tgui_large_buttons") + tgui_large_buttons = !tgui_large_buttons + if("tgui_swapped_buttons") + tgui_swapped_buttons = !tgui_swapped_buttons if("outline_enabled") outline_enabled = !outline_enabled if("outline_color")