forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AutoWiki module & autowiki emoji (#1052)
## Что этот 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
Showing
4 changed files
with
39 additions
and
0 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 |
---|---|---|
@@ -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() | ||
. = ..() |
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 "_autowiki.dm" | ||
|
||
#include "code/autowiki_emoji.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,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)) |
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