This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
forked from Aurorastation/Aurora.3
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some text manipulation refactor and fixes (Aurorastation#17683)
* sdfsad * sdfsda * fourspaces begone
- Loading branch information
1 parent
2f355a1
commit 605b104
Showing
9 changed files
with
120 additions
and
19 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
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,19 @@ | ||
/// Macro from Lummox used to get height from a MeasureText proc | ||
#define WXH_TO_HEIGHT(x) text2num(copytext(x, findtextEx(x, "x") + 1)) | ||
|
||
#define SMALL_FONTS(FONTSIZE, MSG) "<span style=\"font-family: 'Small Fonts'; -dm-text-outline: 1 black; font-size: [FONTSIZE]px;\">[MSG]</span>" | ||
|
||
|
||
//Since we do not have GLOB (yet), this will have to do | ||
var/regex/html_tags = regex(@"<.*?>", "g") | ||
var/regex/angular_brackets = regex(@"[<>]", "g") | ||
var/regex/filename_forbidden_chars = regex(@{""|[\\\n\t/?%*:|<>]|\.\."}, "g") | ||
|
||
/// Removes characters incompatible with file names. | ||
#define SANITIZE_FILENAME(text) (filename_forbidden_chars.Replace(text, "")) | ||
|
||
/// Simply removes the < and > characters, and limits the length of the message. | ||
#define STRIP_HTML_SIMPLE(text, limit) (angular_brackets.Replace(copytext(text, 1, limit), "")) | ||
|
||
/// Removes everything enclose in < and > inclusive of the bracket, and limits the length of the message. | ||
#define STRIP_HTML_FULL(text, limit) (html_tags.Replace(copytext(text, 1, limit), "")) |
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,45 @@ | ||
################################ | ||
# Example Changelog File | ||
# | ||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. | ||
# | ||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) | ||
# When it is, any changes listed below will disappear. | ||
# | ||
# Valid Prefixes: | ||
# bugfix | ||
# wip (For works in progress) | ||
# tweak | ||
# soundadd | ||
# sounddel | ||
# rscadd (general adding of nice things) | ||
# rscdel (general deleting of nice things) | ||
# imageadd | ||
# imagedel | ||
# maptweak | ||
# spellcheck (typo fixes) | ||
# experiment | ||
# balance | ||
# admin | ||
# backend | ||
# security | ||
# refactor | ||
################################# | ||
|
||
# Your name. | ||
author: FluffyGhost | ||
|
||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. | ||
delete-after: True | ||
|
||
# Any changes you've made. See valid prefix list above. | ||
# INDENT WITH TWO SPACES. NOT TABS. SPACES. | ||
# SCREW THIS UP AND IT WON'T WORK. | ||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. | ||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. | ||
changes: | ||
- rscadd: "Added text manipulation macros from TG, and a new one to have newlines working." | ||
- refactor: "Moved around some macros in the appropriate files." | ||
- bugfix: "Antag uplink announcements now shows apostrophes correctly, and can have newlines in them." | ||
- refactor: "Antag uplink announcements now uses tgui inputs." | ||
- bugfix: "PDA STT now respects the apostrophes and other characters too." |