mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 12:07:27 +01:00
Convert most spans to defines (#31080)
* spanish? * aaaagain * keep maptext * Update robot_items.dm * Update span_defines.dm * compiles * Update silicon_mob.dm * compile
This commit is contained in:
@@ -211,7 +211,7 @@ for addressing all forms of pronouns. This is useful in a number of ways;
|
||||
|
||||
- BYOND's `\his` macro can be unpredictable on what object it references. Take
|
||||
this example: `"[user] waves \his [user.weapon] around, hitting \his
|
||||
opponents!"`. This will end up referencing the user's gender in the first
|
||||
opponents!"`. This will end up referencing the user's gender in the first
|
||||
occurrence, but what about the second? It'll actually print the gender set on
|
||||
the weapon he's carrying, which is unintended - and there's no way around
|
||||
this.
|
||||
@@ -510,7 +510,7 @@ do not simply omit the `SIGNAL_HANDLER`. Instead, call the sleeping code with
|
||||
### Use of operators
|
||||
|
||||
- Bitwise ANDs (`&`) should be written as `bitfield & bitflag` NEVER `bitflag &
|
||||
bitfield`. Both are valid, but the latter is confusing and nonstandard.
|
||||
bitfield`. Both are valid, but the latter is confusing and nonstandard.
|
||||
- Associated lists declarations must have their key value quoted if it's a string.
|
||||
|
||||
```dm
|
||||
@@ -561,22 +561,22 @@ of common legacy trends which are no longer acceptable:
|
||||
```dm
|
||||
//Bad
|
||||
for(var/mob/M in viewers(user))
|
||||
M.show_message("<span class='warning'>Arbitrary text</span>")
|
||||
M.show_message(SPAN_WARNING("Arbitrary text"))
|
||||
|
||||
//Good
|
||||
user.visible_message("<span class='warning'>Arbitrary text</span>")
|
||||
user.visible_message(SPAN_WARNING("Arbitrary text"))
|
||||
```
|
||||
|
||||
- You should not use color macros (`\red, \blue, \green, \black`) to color text,
|
||||
instead, you should use span classes. `<span class='warning'>Red text</span>`,
|
||||
`<span class='notice'>Blue text</span>`.
|
||||
instead, you should use span classes. `[SPAN_WARNING("Red text")]`,
|
||||
`[SPAN_NOTICE("Blue text")]`.
|
||||
|
||||
```dm
|
||||
//Bad
|
||||
to_chat(user, "\red Red text \black Black text")
|
||||
|
||||
//Good
|
||||
to_chat(user, "<span class='warning'>Red text</span>Black text")
|
||||
to_chat(user, "[SPAN_WARNING("Red text")]Black text")
|
||||
```
|
||||
|
||||
- To use variables in strings, you should **never** use the `text()` operator,
|
||||
@@ -817,10 +817,11 @@ example.) Why is this special?
|
||||
|
||||
With `.` being everpresent in every proc, can we use it as a temporary variable?
|
||||
Of course we can! However, the `.` operator cannot replace a typecasted variable
|
||||
|
||||
- it can hold data any other var in DM can, it just can't be accessed as one,
|
||||
although the `.` operator is compatible with a few operators that look weird but
|
||||
work perfectly fine, such as: `.++` for incrementing `.'s` value, or `.[1]` for
|
||||
accessing the first element of `.`, provided that it's a list.
|
||||
although the `.` operator is compatible with a few operators that look weird but
|
||||
work perfectly fine, such as: `.++` for incrementing `.'s` value, or `.[1]` for
|
||||
accessing the first element of `.`, provided that it's a list.
|
||||
|
||||
### Globals versus static
|
||||
|
||||
|
||||
Reference in New Issue
Block a user