forked from Sandstorm-Station/Sandstorm-Station-13
-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
26 changed files
with
1,428 additions
and
203 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,7 @@ | ||
// Font metrics bitfield | ||
/// Include leading A width and trailing C width in GetWidth() or in DrawText() | ||
#define INCLUDE_AC (1<<0) | ||
|
||
DEFINE_BITFIELD(font_flags, list( | ||
"INCLUDE_AC" = INCLUDE_AC, | ||
)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#define HINT_ICON_FILE 'icons/UI_Icons/screentips/cursor_hints.dmi' | ||
|
||
/// Stores the cursor hint icons for screentip context. | ||
GLOBAL_LIST_INIT_TYPED(screentip_context_icons, /image, prepare_screentip_context_icons()) | ||
|
||
/proc/prepare_screentip_context_icons() | ||
var/list/output = list() | ||
for(var/state in icon_states(HINT_ICON_FILE)) | ||
output[state] = image(HINT_ICON_FILE, icon_state = state) | ||
return output | ||
|
||
/* | ||
* # Builds context with each intent for this key | ||
* Args: | ||
* - context = list (REQUIRED) | ||
* - context[key] = list (REQUIRED) | ||
* - key = string (REQUIRED) | ||
* - allow_image = boolean (not required) | ||
*/ | ||
/proc/build_context(list/context, key, allow_image) | ||
if(!(length(context) && length(context[key]) && key)) | ||
return "" | ||
var/list/to_add | ||
for(var/intent in context[key]) | ||
// Splits key combinations from mouse buttons. e.g. `Ctrl-Shift-LMB` goes in, `Ctrl-Shift-` goes out. Will be empty for single button actions. | ||
var/key_combo = length(key) > 3 ? "[copytext(key, 1, -3)]" : "" | ||
// Grab the mouse button, LMB/RMB+intent | ||
var/button = "[copytext(key, -3)]-[intent]" | ||
if(allow_image) | ||
// Compile into image, if allowed | ||
button = "\icon[GLOB.screentip_context_icons[button]]" | ||
LAZYADD(to_add, "[key_combo][button][allow_image ? "" : ":"] [context[key][intent]]") | ||
|
||
// Prepare separator for same button but different intent | ||
var/separator = "[allow_image ? " " : " / "]" | ||
|
||
// Voilá, final result | ||
return to_add.Join(separator) | ||
|
||
#undef HINT_ICON_FILE |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.