-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efd3b79
commit 4996bf9
Showing
20 changed files
with
284 additions
and
90 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
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
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
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
62 changes: 62 additions & 0 deletions
62
code/modules/admin/game_master/extra_buttons/rename_platoon.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,62 @@ | ||
|
||
GLOBAL_VAR_INIT(main_platoon_name, SQUAD_MARINE_1) | ||
|
||
/// Ability to rename the platoon | ||
/client/proc/game_master_rename_platoon() | ||
set name = "Rename Platoon Override" | ||
set category = "Game Master.Extras" | ||
|
||
if(!admin_holder || !check_rights(R_MOD, FALSE)) | ||
return | ||
|
||
rename_platoon() | ||
|
||
/client/proc/commander_rename_platoon() | ||
set name = "Rename Platoon" | ||
set category = "OOC.Commander" | ||
|
||
if(GLOB.main_platoon_name != SQUAD_MARINE_1) | ||
to_chat(src, SPAN_NOTICE("The platoon has already been renamed this round.")) | ||
return | ||
|
||
rename_platoon() | ||
|
||
/// Actually renames the platoon | ||
/client/proc/rename_platoon() | ||
var/new_name = tgui_input_text(mob, "New platoon name?", "Platoon Name", GLOB.main_platoon_name) | ||
if(!new_name || !istext(new_name)) | ||
return | ||
|
||
if(length(new_name) > 10) | ||
to_chat(src, SPAN_NOTICE("The platoon name should be 10 characters or less.")) | ||
return | ||
|
||
var/old_name = GLOB.main_platoon_name | ||
|
||
var/channel = radiochannels[old_name] | ||
radiochannels -= old_name | ||
|
||
radiochannels[new_name] = channel | ||
|
||
var/list/keys_to_readd = list() | ||
|
||
for(var/key in department_radio_keys) | ||
if(department_radio_keys[key] == old_name) | ||
keys_to_readd += key | ||
department_radio_keys -= key | ||
|
||
for(var/key in keys_to_readd) | ||
department_radio_keys[key] = new_name | ||
|
||
ROLES_SQUAD_ALL -= old_name | ||
ROLES_SQUAD_ALL += new_name | ||
|
||
var/list/copy_frozen_platoon_items = GLOB.frozen_items[old_name] | ||
GLOB.frozen_items -= old_name | ||
GLOB.frozen_items[new_name] = copy_frozen_platoon_items | ||
|
||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_PLATOON_NAME_CHANGE, new_name, old_name) | ||
|
||
log_admin("[key_name(src)] has renamed the platoon from [GLOB.main_platoon_name] to [new_name].") | ||
|
||
GLOB.main_platoon_name = new_name |
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
Oops, something went wrong.