forked from tgstation/tgstation
-
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.
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> В чейнджлоге <!-- Argue for the merits of your changes and how they benefit the game, especially if they are controversial and/or far reaching. If you can't actually explain WHY what you are doing will improve the game, then it probably isn't good for the game in the first place. --> Первый шаг к светлому будущему <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> :cl: code: Добавлена поддержка модпаков config: Добавлен файл конфига для модпаков code: Обновлен CI под модпаки code: Изменен метод обнаружения мердж конфликтов /:cl: <!-- Both :cl:'s are required for the changelog to work! You can put your name to the right of the first :cl: if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. -->
- Loading branch information
Showing
13 changed files
with
123 additions
and
1 deletion.
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
Empty file.
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,17 @@ | ||
/datum/modpack | ||
/// A string name for the modpack. Used for looking up other modpacks in init. | ||
var/name | ||
/// A string desc for the modpack. Can be used for modpack verb list as description. | ||
var/desc | ||
/// A string with authors of this modpack. | ||
var/author | ||
|
||
/datum/modpack/proc/pre_initialize() | ||
if(!name) | ||
return "Modpack name is unset." | ||
|
||
/datum/modpack/proc/initialize() | ||
return | ||
|
||
/datum/modpack/proc/post_initialize() | ||
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,60 @@ | ||
#define INIT_ORDER_MODPACKS 84 | ||
|
||
SUBSYSTEM_DEF(modpacks) | ||
name = "Modpacks" | ||
init_order = INIT_ORDER_MODPACKS | ||
flags = SS_NO_FIRE | ||
var/list/loaded_modpacks = list() | ||
|
||
/datum/controller/subsystem/modpacks/Initialize() | ||
var/list/all_modpacks = list() | ||
for(var/modpack in subtypesof(/datum/modpack/)) | ||
all_modpacks.Add(new modpack) | ||
// Pre-init and register all compiled modpacks. | ||
for(var/datum/modpack/package as anything in all_modpacks) | ||
var/fail_msg = package.pre_initialize() | ||
if(QDELETED(package)) | ||
CRASH("Modpack of type [package.type] is null or queued for deletion.") | ||
if(fail_msg) | ||
CRASH("Modpack [package.name] failed to pre-initialize: [fail_msg].") | ||
if(loaded_modpacks[package.name]) | ||
CRASH("Attempted to register duplicate modpack name [package.name].") | ||
loaded_modpacks.Add(package) | ||
|
||
// Handle init and post-init (two stages in case a modpack needs to implement behavior based on the presence of other packs). | ||
for(var/datum/modpack/package as anything in all_modpacks) | ||
var/fail_msg = package.initialize() | ||
if(fail_msg) | ||
CRASH("Modpack [(istype(package) && package.name) || "Unknown"] failed to initialize: [fail_msg]") | ||
for(var/datum/modpack/package as anything in all_modpacks) | ||
var/fail_msg = package.post_initialize() | ||
if(fail_msg) | ||
CRASH("Modpack [(istype(package) && package.name) || "Unknown"] failed to post-initialize: [fail_msg]") | ||
|
||
/client/verb/modpacks_list() | ||
set name = "Modpacks List" | ||
set category = "OOC" | ||
|
||
if(!mob || !SSmodpacks.initialized) | ||
return | ||
|
||
if(length(SSmodpacks.loaded_modpacks)) | ||
. = "<hr><br><center><b><font size = 3>Список модификаций</font></b></center><br><hr><br>" | ||
for(var/datum/modpack/M as anything in SSmodpacks.loaded_modpacks) | ||
if(M.name) | ||
. += "<div class = 'statusDisplay'>" | ||
. += "<center><b>[M.name]</b></center>" | ||
|
||
if(M.desc || M.author) | ||
. += "<br>" | ||
if(M.desc) | ||
. += "<br>Описание: [M.desc]" | ||
if(M.author) | ||
. += "<br><i>Автор: [M.author]</i>" | ||
. += "</div><br>" | ||
|
||
var/datum/browser/popup = new(mob, "modpacks_list", "Список Модификаций", 480, 580) | ||
popup.set_content(.) | ||
popup.open() | ||
else | ||
to_chat(src, "Этот сервер не использует какие-либо модификации.") |
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,16 @@ | ||
/datum/modpack/example | ||
/// A string name for the modpack. Used for looking up other modpacks in init. | ||
name = "Example modpack" | ||
/// A string desc for the modpack. Can be used for modpack verb list as description. | ||
desc = "its useless" | ||
/// A string with authors of this modpack. | ||
author = "furior" | ||
|
||
/datum/modpack/example/pre_initialize() | ||
. = ..() | ||
|
||
/datum/modpack/example/initialize() | ||
. = ..() | ||
|
||
/datum/modpack/example/post_initialize() | ||
. = ..() |
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,3 @@ | ||
#include "_example.dm" | ||
|
||
#include "code/example.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,2 @@ | ||
/turf/closed/wall/example | ||
name = "Example wall" |
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,4 @@ | ||
#include "_modpack.dm" | ||
#include "_modpacks.dm" | ||
|
||
// #include "example/_example.dme" |
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,12 @@ | ||
#!/bin/bash | ||
|
||
#ANSI Escape Codes for colors to increase contrast of errors | ||
RED="\033[0;31m" | ||
GREEN="\033[0;32m" | ||
BLUE="\033[0;34m" | ||
NC="\033[0m" # No Color | ||
|
||
echo -e "${BLUE}Re-running grep checks, but looking in modular_bandastation...${NC}" | ||
|
||
# Run the linters again, but modular bandastation code. | ||
sed "s|code/\*\*/\*\.dm|modular_bandastation/\*\*/\*\.dm|g" <tools/ci/check_grep.sh | bash |
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