Skip to content

Commit

Permalink
actual stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 22, 2023
1 parent 2d9a77e commit 8e5ef02
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
20 changes: 11 additions & 9 deletions code/modules/admin/game_master/game_master.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/// Assoc list that holds our custom game master objectives, formatted as atom = objective_string
GLOBAL_LIST_EMPTY(game_master_objectives)

/// Percentage of characters end up clear when sent via radio message
GLOBAL_VAR_INIT(radio_communication_clarity, 100)

/proc/open_game_master_panel(client/using_client)
set name = "Game Master Panel"
set category = "Game Master"
Expand Down Expand Up @@ -72,12 +75,6 @@ GLOBAL_LIST_EMPTY(game_master_objectives)

/// End Objective Stuff


/// Communication stuff


/// End Communication stuff

/// Holds what type of click intercept we are using
var/current_click_intercept_action

Expand All @@ -96,9 +93,6 @@ GLOBAL_LIST_EMPTY(game_master_objectives)
submenu_types = null
current_submenus = null

if(user_client?.click_intercept == src)
user_client.click_intercept = null

/datum/game_master/ui_data(mob/user)
. = ..()

Expand All @@ -113,6 +107,9 @@ GLOBAL_LIST_EMPTY(game_master_objectives)
// Objective stuff
data["objective_click_intercept"] = objective_click_intercept

// Communication stuff
data["communication_clarity"] = GLOB.radio_communication_clarity

return data

/datum/game_master/ui_static_data(mob/user)
Expand Down Expand Up @@ -170,6 +167,11 @@ GLOBAL_LIST_EMPTY(game_master_objectives)

//Communication Section
if("set_communication_clarity")
var/new_clarity = text2num(params["clarity"])
if(!isnum(new_clarity))
return

GLOB.radio_communication_clarity = clamp(new_clarity, 0, 100)

/datum/game_master/ui_close(mob/user)
. = ..()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/hear_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@
else
message = stars(message)

if(GLOB.radio_communication_clarity < 100)
message = stars(message, GLOB.radio_communication_clarity)

if(language)
style = language.color

Expand Down
49 changes: 24 additions & 25 deletions tgui/packages/tgui/interfaces/GameMaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,30 @@ export const GameMaster = (props, context) => {
</Section>
</Flex.Item>
<Flex.Item>
<Flex grow>
<Section title="Communication">
<Flex grow direction="column">
<Flex.Item>
<Button
content="Game Master Phone"
onClick={() => {
act('use_game_master_phone');
}}
/>
</Flex.Item>
<Flex.Item>Communication Clarity</Flex.Item>
<Flex.Item>
<Slider
maxValue={100}
minValue={0}
value={data.communication_clarity}
onChange={(e, clarity) => {
act('set_communication_clarity', { clarity });
}}
/>
</Flex.Item>
</Flex>
</Section>
</Flex>
<Section title="Communication">
<Flex grow direction="column">
<Flex.Item>
<Button
content="Game Master Phone (SoonTM)"
onClick={() => {
act('use_game_master_phone');
}}
/>
</Flex.Item>
<Flex.Item>Communication Clarity</Flex.Item>
<Flex.Item>
<Slider
maxValue={100}
minValue={0}
value={data.communication_clarity}
suppressFlicker={2500}
onChange={(e, clarity) => {
act('set_communication_clarity', { clarity });
}}
/>
</Flex.Item>
</Flex>
</Section>
</Flex.Item>
</Flex>
</Window.Content>
Expand Down

0 comments on commit 8e5ef02

Please sign in to comment.