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

Изменяем систему модуляризации #51

Open
wants to merge 8 commits into
base: nova
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions code/__DEFINES/fonts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#define SIGNATURE_FONT "Segoe Script"

/// Emoji icon set
#define EMOJI_SET 'modular_ss220/master_files_skyrat/icons/emoji.dmi' // SKYRAT EDIT - ORIGINAL: 'icons/ui_icons/emoji/emoji.dmi'
// ex666 edit - skyrat: modular_skyrat/master_files/icons/emoji.dmi
#define EMOJI_SET 'modular_ss220/features/emote_panel/icons/emoji.dmi' // SKYRAT EDIT - ORIGINAL: 'icons/ui_icons/emoji/emoji.dmi'
// SS1984 EDIT - skyrat original: modular_skyrat/master_files/icons/emoji.dmi

// Font metrics bitfield
/// Include leading A width and trailing C width in GetWidth() or in DrawText()
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/~novarat_defines_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// THIS IS A SS1984 FILE

#include "..\..\modular_ss220\_defines\_main_modular_defines_include.dm"
3 changes: 3 additions & 0 deletions code/__HELPERS/~novarat_helpers_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// THIS IS A NOVARAT FILE

#include "..\..\modular_ss220\_helpers\_main_modular_helpers_include.dm"
3 changes: 3 additions & 0 deletions code/_globalvars/~novarat_globalvars_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// THIS IS A SS1984 FILE

#include "..\..\modular_ss220\_globalvars\_main_modular_globalvars_include.dm"
2 changes: 1 addition & 1 deletion modular_nova/modules/alerts/code/default_announcer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
ANNOUNCER_SPOOKY = 'modular_nova/modules/alerts/sound/misc/admin_horror_music.ogg',
ANNOUNCER_ERTYES = 'modular_nova/modules/alerts/sound/alerts/yesert.ogg',
ANNOUNCER_MUTANTS = 'modular_nova/modules/alerts/sound/alerts/hazdet.ogg',
ANNOUNCER_KLAXON = 'modular_ss220/modules/return_prs/black_mesa/sound/siren1_long.ogg',
ANNOUNCER_KLAXON = 'modular_ss220/reverts/return_prs/sound/black_mesa/siren1_long.ogg',
ANNOUNCER_NRI_RAIDERS = 'modular_nova/modules/encounters/sounds/morse.ogg',
ANNOUNCER_DEPARTMENTAL = 'modular_nova/modules/alerts/sound/alerts/alert3.ogg',
ANNOUNCER_SHUTTLE = 'modular_nova/modules/alerts/sound/alerts/alert3.ogg',
Expand Down
18 changes: 18 additions & 0 deletions modular_ss220/_assets_modpacks.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#define MODPACKS_SET 'modular_ss220/mods_icon_placeholder.dmi'

/datum/asset/spritesheet/simple/modpacks
name = "modpacks"

/datum/asset/spritesheet/simple/modpacks/create_spritesheets()
InsertAll("modpack", MODPACKS_SET)
// catch all modpack's previews which are pulling icons from another file
var/icon_placeholder = "default"
for(var/datum/modpack/this_modpack as anything in subtypesof(/datum/modpack))
var/icon = initial(this_modpack.icon)
var/icon_state = initial(this_modpack.id)
if(icon == MODPACKS_SET)
Insert("modpack-[icon_state]", icon, icon_state=icon_placeholder)
else
Insert("modpack-[icon_state]", icon, icon_state=icon_state)

#undef MODPACKS_SET
2 changes: 2 additions & 0 deletions modular_ss220/_defines/_main_modular_defines_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Put all you modular defines here, it would be pasted right before TG Defines
// So you can easily use your defines in TG code folder, not only in our modular folder
5 changes: 5 additions & 0 deletions modular_ss220/_defines/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Тут лежат все наши Новые Defines (определения), что мы определили в нашем модуле.

Все они добавляются непосредственно в `main_modular_defines_include.dm`

Сами дефайны инициализируются сразу после дефайнов офф ТГ в code/\_\_DEFINES/~novarat_defines_include.dm (вот такая вот переадресация типа)
4 changes: 4 additions & 0 deletions modular_ss220/_globalvars/_main_modular_globalvars_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Put all you modular helpers here, it would be pasted right before TG Helpers
// So you can easily use your helpers in TG code folder, not only in our modular folder

#include "tgui.dm"
5 changes: 5 additions & 0 deletions modular_ss220/_globalvars/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Тут лежат все наши Новые Globalvars (глобальные переменные), что мы определили в нашем модуле.

Все они добавляются непосредственно в `main_modular_globalvars_include.dm`

Сами глобальные переменные инициализируются сразу после хелперов офф ТГ в code/\_globalvars/~novarat_globalvars_include.dm (такая же переадресация аналогичная как и у дефайнов)
1 change: 1 addition & 0 deletions modular_ss220/_globalvars/tgui.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GLOBAL_DATUM(modpacks_tgui, /datum/modpack)
2 changes: 2 additions & 0 deletions modular_ss220/_helpers/_main_modular_helpers_include.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Put all you modular helpers here, it would be pasted right before TG Helpers
// So you can easily use your helpers in TG code folder, not only in our modular folder
5 changes: 5 additions & 0 deletions modular_ss220/_helpers/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Тут лежат все наши Новые Helpers (помощники), что мы определили в нашем модуле.

Все они добавляются непосредственно в `main_modular_helpers_include.dm`

Сами хелперы инициализируются сразу после хелперов офф ТГ в code/\_\_HELPERS/~novarat_helpers_include.dm (такая же переадресация аналогичная как и у дефайнов)
83 changes: 83 additions & 0 deletions modular_ss220/_modpack.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/datum/modpack
/// A string unique ID for the modpack. Used for self-cheсks, must be same as modpack name in code. /datum/modpack/ru_crayons -> "id = ru_crayons"
var/id
/// An icon for modpack preview,
var/icon = 'modular_ss220/mods_icon_placeholder.dmi'
/// 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
/// A string with group of this modpack. Choose between "Features", "Translations" and "Reverts"
var/group
/// A list of your modpack's dependencies. If you use obj from another modpack - put it here.
var/list/mod_depends = list()

/// Is modpack visible,
var/visible = TRUE // by default set to TRUE

// Modpacks initialization steps
/datum/modpack/proc/pre_initialize() // Basic modpack fuctions
if(!name)
return "Modpack name is unset."

/datum/modpack/proc/initialize() // Mods dependencies-checks
if(!mod_depends)
return
var/passed = 0
for(var/depend_id in mod_depends)
passed = 0
if(depend_id == id)
return "Mod depends on itself, ok and?"
for(var/datum/modpack/package as anything in SSmodpacks.loaded_modpacks)
if(package.id == depend_id)
if(passed >= 1)
return "Multiple include of one module in [id] mod dependencies."
passed++
if(passed == 0)
return "Module [id] depends on [depend_id], please include it in your game."

// Modpacks TGUI
/datum/modpack/ui_assets(mob/user)
return list(
get_asset_datum(/datum/asset/spritesheet/simple/modpacks),
)

/datum/modpack/ui_state()
return GLOB.always_state

/datum/modpack/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if (!ui)
ui = new(user, src, "Modpacks")
ui.open()

/datum/modpack/ui_static_data(mob/user)
. = ..()
.["categories"] = list("Features", "Reverts", "Translations")
.["features"] = list()
.["translations"] = list()
.["reverts"] = list()

var/datum/asset/spritesheet/simple/assets = get_asset_datum(/datum/asset/spritesheet/simple/modpacks)
for(var/datum/modpack/modpack as anything in SSmodpacks.loaded_modpacks)
if (!modpack.visible) // needed for examples (or for some kind of event)
continue

var/list/modpack_data = list(
"name" = modpack.name,
"desc" = modpack.desc,
"author" = modpack.author,
"icon_class" = assets.icon_class_name("modpack-[modpack.id]"),
"id" = modpack.id,
)

if (modpack.group == "Фичи" || modpack.group == "Features")
.["features"] += list(modpack_data)
else if (modpack.group == "Переводы" || modpack.group == "Translations")
.["translations"] += list(modpack_data)
else if (modpack.group == "Баланс" || modpack.group == "Reverts")
.["reverts"] += list(modpack_data)
else
CRASH("Modpack [modpack.name] has bad group name or queued for deletion.")
41 changes: 41 additions & 0 deletions modular_ss220/_modpacks_subsystem.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#define INIT_ORDER_MODPACKS 84

// Subsystem of modpacks
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]")

return SS_INIT_SUCCESS

/client/verb/modpacks_list()
set name = "Modpacks List"
set category = "OOC"

if(!GLOB.modpacks_tgui)
GLOB.modpacks_tgui = new /datum/modpack()

GLOB.modpacks_tgui.ui_interact(mob)
6 changes: 6 additions & 0 deletions modular_ss220/features/auto_cryo/cryocool.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/auto_cryo
id = "auto_cryo"
name = "Авто крио"
group = "Features"
desc = "Система автоматического перемещения игрока в длительном состоянии SSD в крио."
author = "Dimach и Bizzonium"
9 changes: 9 additions & 0 deletions modular_ss220/features/auto_cryo/cryocool.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef AUTO_CRYO
#define AUTO_CRYO

#include "cryocool.dm"

#include "code/autocryo.dm"
#include "code/autocryo_config.dm"

#endif
6 changes: 6 additions & 0 deletions modular_ss220/features/cyrillic_key_fixes/cyrillic.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/cyrillic_key_fixes
id = "cyrillic_key_fixes"
name = "Фикс букв"
group = "Features"
desc = "Фиксит использование не английских букв."
author = "Vallat и lebedev"
11 changes: 11 additions & 0 deletions modular_ss220/features/cyrillic_key_fixes/cyrillic.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef CYRILLIC_KEY_FIXES
#define CYRILLIC_KEY_FIXES

#include "cyrillic.dm"

#include "code\client_procs.dm"
#include "code\communication.dm"
#include "code\keybindings.dm"
#include "code\text.dm"

#endif
6 changes: 6 additions & 0 deletions modular_ss220/features/discord/discord.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/discord
id = "discord"
name = "Дискорд"
group = "Features"
desc = "Принудительная аутентификация Byond-аккаунта через дискорд для игры на сервере."
author = "Dimach и Bizzonium"
10 changes: 10 additions & 0 deletions modular_ss220/features/discord/discord.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef DISCORD
#define DISCORD

#include "discord.dm"

#include "code\discord_auth.dm"
#include "code\new_player.dm"
#include "code\verb.dm"

#endif
6 changes: 6 additions & 0 deletions modular_ss220/features/emote_panel/emote_panel.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/emote_panel
id = "emote_panel"
name = "Панель с эмоутами"
group = "Features"
desc = "Вкладка с эмоциями по умолчанию включена в настройках игрока."
author = "larentoun и Bizzonium"
8 changes: 8 additions & 0 deletions modular_ss220/features/emote_panel/emote_panel.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef EMOTE_PANEL
#define EMOTE_PANEL

#include "emote_panel.dm"

#include "code\m_emote_panel.dm"

#endif
6 changes: 6 additions & 0 deletions modular_ss220/features/events/events.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/events
id = "events"
name = "Изменения существующих ивентов"
group = "Features"
desc = "Изменяет поведение ивентов (\"Всплеск мощности Суперматерии\" и \"Плесень\")."
author = "Dimach и Bizzonium"
8 changes: 8 additions & 0 deletions modular_ss220/features/events/events.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef EVENTS
#define EVENTS

#include "events.dm"

#include "code\round_event.dm"

#endif
1 change: 1 addition & 0 deletions modular_ss220/features/feature_example/code/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Тут мы храним код к нашему модпаку
9 changes: 9 additions & 0 deletions modular_ss220/features/feature_example/feature_example.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/datum/modpack/feature_example
id = "feature_example"
icon = 'modular_ss220/features/feature_example/preview.dmi'
name = "feature_example"
group = "Features"
desc = "Пример написания модпаков для фич."
author = "К*дер"

visible = FALSE
6 changes: 6 additions & 0 deletions modular_ss220/features/feature_example/feature_example.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef FEATURE_EXAMPLE
#define FEATURE_EXAMPLE

#include "feature_example.dm"

#endif
1 change: 1 addition & 0 deletions modular_ss220/features/feature_example/icons/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Тут мы храним наши иконки к обьектам и т.д. в модпаке
Binary file not shown.
14 changes: 14 additions & 0 deletions modular_ss220/features/feature_example/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Module ID: FEATURES_EXAMPLE


### Defines:

- N/A

### TG Proc/File Changes:

- N/A

### TGUI Files:

- N/A
1 change: 1 addition & 0 deletions modular_ss220/features/feature_example/sound/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## Тут мы храним звуки к нашему модпаку
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/paradise_krybindings
id = "paradise_krybindings"
name = "Бинды как на Парадайзе"
group = "Features"
desc = "Изменяет стандартное назначение клавиш как на билде Paradise."
author = "К*дер"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef PARADISE_KEYBINDINGS
#define PARADISE_KEYBINDINGS

#include "paradise_keybindings.dm"

#include "code\keybinding\admin.dm"
#include "code\keybinding\artificial_intelligence.dm"
#include "code\keybinding\carbon.dm"
#include "code\keybinding\client.dm"
#include "code\keybinding\communication.dm"
#include "code\keybinding\human.dm"
#include "code\keybinding\living.dm"
#include "code\keybinding\mob.dm"
#include "code\keybinding\movement.dm"
#include "code\keybinding\robot.dm"

#endif
5 changes: 5 additions & 0 deletions modular_ss220/features/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Все-все-все КРУПНЫЕ фичи, что добавленны в этот репо.

Фича считается крупной, если она с трудом уменьшается в 1 файлик .dm + она не является переводом.

Все переводы и мелкие фиксы (они же реверты) идут в свои соответсвующие папки.
8 changes: 8 additions & 0 deletions modular_ss220/features/shutdown/shutdown.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef SHUTDOWN
#define SHUTDOWN

#include "shutdown.dm"

#include "code/shutdown_config.dm"

#endif
6 changes: 6 additions & 0 deletions modular_ss220/features/tts/tts.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/datum/modpack/tts
id = "tts"
name = "TTS озвучка станции 13"
group = "Features"
desc = "Дает возможность выбрать уникальный голос для вашего персонажа."
author = "К*дер"
Loading
Loading