Skip to content

Commit

Permalink
Add AutoWiki module & autowiki emoji (#1052)
Browse files Browse the repository at this point in the history
## Что этот PR делает
Добавляет автовики для эмодзи, на вики будет всегда актуальный список
всех эмодзи
Из минусов - насрано файлами

## Changelog

:cl:
add: На вики появился актуальный список всех эмодзи для чата/мессенджера
/:cl:

## Summary by Sourcery

New Features:
- Automatically generate a wiki page containing an always up-to-date
list of all available emojis.
  • Loading branch information
AyIong authored Jan 23, 2025
1 parent fd62992 commit 6509581
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modular_bandastation/autowiki/_autowiki.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/datum/modpack/autowiki
/// A string name for the modpack. Used for looking up other modpacks in init.
name = "Автовики"
/// A string desc for the modpack. Can be used for modpack verb list as description.
desc = "Заменяем редакторов вики кодом."
/// A string with authors of this modpack.
author = "Aylong"

/datum/modpack/autowiki/pre_initialize()
. = ..()

/datum/modpack/autowiki/initialize()
. = ..()

/datum/modpack/autowiki/post_initialize()
. = ..()
3 changes: 3 additions & 0 deletions modular_bandastation/autowiki/_autowiki.dme
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "_autowiki.dm"

#include "code/autowiki_emoji.dm"
19 changes: 19 additions & 0 deletions modular_bandastation/autowiki/code/autowiki_emoji.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/datum/autowiki/emoji
page = "Template:Autowiki/Content/Emojis"

/datum/autowiki/emoji/generate()
var/output = ""
var/list/icon_states = icon_states(EMOJI_SET)

for(var/icon_state in icon_states)
var/filename = SANITIZE_FILENAME(escape_value("[icon_state]_wiki_emoji"))

output += include_template("Autowiki/Emoji", list(
"name" = ":[escape_value(icon_state)]:",
"icon" = filename,
))

// It would be cool to make this support gifs someday, but not now
upload_icon(icon(EMOJI_SET, icon_state, frame = 1), filename)

return include_template("Autowiki/EmojiTable", list("content" = output))
1 change: 1 addition & 0 deletions modular_bandastation/modular_bandastation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "autohiss/_autohiss.dme"
#include "automapper/_automapper.dme"
#include "automatic_crew_transfer/_automatic_crew_transfer.dme"
#include "autowiki/_autowiki.dme"
#include "balance/_balance.dme"
#include "barsigns/_barsigns.dme"
#include "changelog/_changelog.dme"
Expand Down

0 comments on commit 6509581

Please sign in to comment.