forked from DopplerShift13/DopplerShift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DopplerShift13#205 from 00-Steven/ntnrc4life
Banishes the entire crew to being in a group chat together
- Loading branch information
Showing
11 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
/// Name used for the common chat all crew gets added to when they join. | ||
#define NTNRC_COMMON_CHAT "#general" | ||
|
||
/// Name used for the preference for the default NTNRC username. | ||
#define NTRNC_USERNAME_PREF_NAME "NTNRC username" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
/// Conversation subtype that doesn't allow for the addition of any single operator. Netadmin mode can still override. | ||
/datum/ntnet_conversation/common | ||
|
||
/// Override to block adding an operator. | ||
/datum/ntnet_conversation/common/changeop(datum/computer_file/program/chatclient/newop, silent = FALSE) | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
/// Enables the chat client to run without using up power. | ||
/datum/computer_file/program/chatclient | ||
program_flags = PROGRAM_ON_NTNET_STORE | PROGRAM_REQUIRES_NTNET | PROGRAM_RUNS_WITHOUT_POWER | ||
power_cell_use = 0 | ||
|
||
/datum/computer_file/program/chatclient/on_start(mob/living/user) | ||
. = ..() | ||
if(!.) | ||
return | ||
|
||
// If we're already in the common chat, start with it open. | ||
if((src in SSmodular_computers.common_chat.active_clients) || (src in SSmodular_computers.common_chat.offline_clients)) | ||
active_channel = SSmodular_computers.common_chat.id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
/// Apply our ntnrc client username prefs | ||
/obj/item/modular_computer/pda/update_pda_prefs(client/owner_client) | ||
. = ..() | ||
if(isnull(owner_client)) | ||
return | ||
|
||
var/datum/computer_file/program/chatclient/our_chat_client = locate() in stored_files | ||
if(isnull(our_chat_client)) | ||
return | ||
|
||
var/default_username = owner_client.prefs.read_preference(/datum/preference/name/ntnrc_username) | ||
if(isnull(default_username)) | ||
return | ||
|
||
our_chat_client.username = default_username | ||
SSmodular_computers.common_chat.add_client(our_chat_client) | ||
open_program(null, our_chat_client, FALSE) |
8 changes: 8 additions & 0 deletions
8
modular_doppler/ntnrc_for_all/code/ss_modular_computers_edits.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
/datum/controller/subsystem/modular_computers | ||
/// Reference to the common chat used for all crew | ||
var/datum/ntnet_conversation/common/common_chat | ||
|
||
/datum/controller/subsystem/modular_computers/Initialize() | ||
. = ..() | ||
common_chat = new(title = NTNRC_COMMON_CHAT, strong = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
/// The username to default to for NTNRC | ||
/datum/preference/name/ntnrc_username | ||
explanation = NTRNC_USERNAME_PREF_NAME | ||
group = "_usernames" // Underscore puts it high up, but below `_real_names` | ||
savefile_key = "chat_client_username" | ||
|
||
|
||
/datum/preference/name/ntnrc_username/create_default_value() | ||
return pick(GLOB.hacker_aliases) | ||
|
||
/datum/preference/name/ntnrc_username/is_valid(value) | ||
return !isnull(permissive_sanitize_name(value)) | ||
|
||
/datum/preference/name/ntnrc_username/deserialize(input, datum/preferences/preferences) | ||
return permissive_sanitize_name(input) | ||
|
||
/datum/preference/name/ntnrc_username/serialize(input) | ||
return permissive_sanitize_name(input) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## Title: NTNRC For All | ||
|
||
MODULE ID: NTNRC_FOR_ALL | ||
|
||
### Description: | ||
|
||
Implements a general NTNRC channel every crewmember is added to by default, and related username pref. | ||
|
||
### TG Proc Changes: | ||
|
||
- `/datum/computer_file/program/chatclient/ui_act(...)` - Blocked passwords from being set on `strong` channels. | ||
- `/obj/item/modular_computer/ui_act(...)` - Emergency mode exit program swaps between NTNRC and messenger. | ||
|
||
### Defines: | ||
|
||
- `code\__DEFINES\~doppler_defines\ntnrc.dm` | ||
|
||
### Master file additions | ||
|
||
N/A | ||
|
||
### Included files that are not contained in this module: | ||
|
||
N/A | ||
|
||
### Credits: | ||
|
||
- Ephe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters