forked from Huz2e/massmeta
-
Notifications
You must be signed in to change notification settings - Fork 1
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 Huz2e#181 from Artemchik542/modular-stage-2
Modular stage 2 + new modpacks TGUI
- Loading branch information
Showing
48 changed files
with
682 additions
and
176 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 |
---|---|---|
@@ -1 +1,3 @@ | ||
#include "..\..\modular_meta\__config_modpaks.dm" | ||
// THIS IS A MASSMETA FILE | ||
|
||
#include "..\..\modular_meta\__config_modpacks.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 |
---|---|---|
@@ -1 +1,3 @@ | ||
// THIS IS A MASSMETA FILE | ||
|
||
#include "..\..\modular_meta\_defines\_main_modular_defines_include.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 |
---|---|---|
@@ -1 +1,3 @@ | ||
// THIS IS A MASSMETA FILE | ||
|
||
#include "..\..\modular_meta\_helpers\_main_modular_helpers_include.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 |
---|---|---|
@@ -1 +1,3 @@ | ||
// THIS IS A MASSMETA FILE | ||
|
||
#include "..\..\modular_meta\_globalvars\_main_modular_globalvars_include.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
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,21 @@ | ||
#define MODPACKS_SET 'modular_meta/__modpack/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 preview.dmi files | ||
var/icon_placeholder = "default" | ||
for(var/datum/modpack/this_modpack as anything in subtypesof(/datum/modpack)) | ||
if(!this_modpack.visible) | ||
continue | ||
|
||
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 |
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,87 @@ | ||
/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_meta/__modpack/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, (for hidden modpacks, like "example" one) | ||
var/visible = TRUE // by default set to TRUE | ||
|
||
|
||
// Modpacks initialization steps | ||
/datum/modpack/proc/pre_initialize() // Basic modpack fuctions | ||
if(!id) | ||
return "Modpack ID is unset." | ||
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", "Translations", "Reverts") | ||
.["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) // if modpack hidden then do not add it to list | ||
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.") | ||
// TODO: add here events group, only visible for admins |
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
File renamed without changes.
Binary file not shown.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## Тут лежат все наши Новые Helpers (помощники?), что мы определили в нашем модуле. | ||
## Тут лежат все наши Новые Helpers (помощники), что мы определили в нашем модуле. | ||
|
||
Все они добавляются непосредственно в `main_modular_helpers_include.dm` | ||
|
||
Сами хелперы инициализируются сразу после хелперов офф ТГ в code/\_\_DEFINES/~meta_helpers_include.dm (такая же переадресация аналогичная как и у дефайнов) | ||
Сами хелперы инициализируются сразу после хелперов офф ТГ в code/\_\_HELPERS/~meta_helpers_include.dm (такая же переадресация аналогичная как и у дефайнов) |
This file was deleted.
Oops, something went wrong.
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
Binary file not shown.
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
Binary file not shown.
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
Binary file not shown.
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.