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

Comms clarity #24

Merged
merged 2 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 12 additions & 1 deletion 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,7 +75,6 @@ GLOBAL_LIST_EMPTY(game_master_objectives)

/// End Objective Stuff


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

Expand Down Expand Up @@ -105,6 +107,8 @@ 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

Expand Down Expand Up @@ -161,6 +165,13 @@ GLOBAL_LIST_EMPTY(game_master_objectives)
current_click_intercept_action = OBJECTIVE_CLICK_INTERCEPT_ACTION
return

//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
30 changes: 28 additions & 2 deletions tgui/packages/tgui/interfaces/GameMaster.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useBackend } from '../backend';
import { Flex, Dropdown, Button, Section } from '../components';
import { Flex, Dropdown, Button, Section, Slider } from '../components';
import { Window } from '../layouts';

export const GameMaster = (props, context) => {
Expand All @@ -25,7 +25,7 @@ export const GameMaster = (props, context) => {
}}
/>
</Flex.Item>
<Flex.Item grow>
<Flex.Item>
<Dropdown
options={data.spawnable_xenos}
selected={data.selected_xeno}
Expand Down Expand Up @@ -76,6 +76,32 @@ export const GameMaster = (props, context) => {
</Flex>
</Section>
</Flex.Item>
<Flex.Item>
<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>
</Window>
Expand Down
Loading