Difference between revisions of "Text Formatting"

From Paradise Station Wiki
Jump to navigation Jump to search
(Stole the 'Text Formatting' page from the /tg/ wiki with a few changes, since it's pretty useful to have.)
 
(added github sidevar)
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{SidebarGithub}}
So you're making some code to do something, and you'd like to use a chat-pane text message to inform the players about it. Good for you! Now, there's a few things to know when doing this.
So you're making some code to do something, and you'd like to use a chat-pane text message to inform the players about it. Good for you! Now, there's a few things to know when doing this.


Line 4: Line 5:
Span classes allow for '''consistent''' and informative text formatting.
Span classes allow for '''consistent''' and informative text formatting.


You may be familiar with span classes if you have previous experience with HTML. There are various types of classes, which can all be found in interface/stylesheet.dm. Make sure to use the appropriate one for the situation!
You may be familiar with span classes if you have previous experience with HTML. There are various types of classes, which can all be found in [https://github.com/ParadiseSS13/Paradise/blob/master/goon/browserassets/css/browserOutput.css#L241 <code>\goon\browserassets\css\browserOutput.css</code>].
Make sure to use the appropriate one for the situation!




==== When you observe someone else doing something ====
=== None ===
'''''When you observe someone else doing something'''''
<pre>user.visible_message("[user] begins welding [src]...")</pre>
<pre>user.visible_message("[user] begins welding [src]...")</pre>


Line 15: Line 18:




==== When you observe yourself doing something ====
=== Notice ===
'''''When you observe yourself doing something'''''
<pre>to_chat(user, "<span class='notice'>You begin welding the vent...</span>")</pre>
<pre>to_chat(user, "<span class='notice'>You begin welding the vent...</span>")</pre>


Line 23: Line 27:




==== When you can't do something ====
=== Warning ===
'''''When you can't do something'''''
<pre>to_chat(user, "<span class='warning'>You can't vent crawl while you're stunned!</span>")</pre>
<pre>to_chat(user, "<span class='warning'>You can't vent crawl while you're stunned!</span>")</pre>


Line 31: Line 36:




==== When you see someone getting hurt or something else alarming ====
=== Danger ===
'''''When you see someone getting hurt or something else alarming'''''
<pre>user.visible_message("<span class='danger'>[user] was shocked by \the [src]!</span>")</pre>
<pre>user.visible_message("<span class='danger'>[user] was shocked by \the [src]!</span>")</pre>


<span style="color:red">'''John Smith''' was shocked by the door!</span>
<span style="color:red">'''John Smith was shocked by the door!'''</span>


:This is '''danger'''! This is heavier red text, used in situations where someone other than yourself is being harmed or having some other potentionally harmful action taken against them, such as cuffing.
:This is '''danger'''! This is heavier red text, used in situations where someone other than yourself is being harmed or having some other potentionally harmful action taken against them, such as cuffing.


 
=== Userdanger ===
==== When you're hurt directly ====
'''''When you're hurt directly'''''
<pre>to_chat(target, "<span class='userdanger'>You are absorbed by the changeling!</span>")</pre>
<pre>to_chat(target, "<span class='userdanger'>You are absorbed by the changeling!</span>")</pre>



Latest revision as of 05:13, 12 August 2022

Github

So you're making some code to do something, and you'd like to use a chat-pane text message to inform the players about it. Good for you! Now, there's a few things to know when doing this.

Span Classes

Span classes allow for consistent and informative text formatting.

You may be familiar with span classes if you have previous experience with HTML. There are various types of classes, which can all be found in \goon\browserassets\css\browserOutput.css. Make sure to use the appropriate one for the situation!


None

When you observe someone else doing something

user.visible_message("[user] begins welding [src]...")

John Smith begins welding the vent.

This one has no span class. It's when you see something mundane and boring.


Notice

When you observe yourself doing something

to_chat(user, "<span class='notice'>You begin welding the vent...</span>")

You begin welding the vent...

This is a notice. Notices show up in simple blue text, and are used for benign informational messages. This notice ends with "...", which implies that the action will take a period of time to complete.


Warning

When you can't do something

to_chat(user, "<span class='warning'>You can't vent crawl while you're stunned!</span>")

You can't vent crawl while you're stunned!

This is a warning! It shows up as simple red text, and are used for things like restriction notifications and machines malfunctioning.


Danger

When you see someone getting hurt or something else alarming

user.visible_message("<span class='danger'>[user] was shocked by \the [src]!</span>")

John Smith was shocked by the door!

This is danger! This is heavier red text, used in situations where someone other than yourself is being harmed or having some other potentionally harmful action taken against them, such as cuffing.

Userdanger

When you're hurt directly

to_chat(target, "<span class='userdanger'>You are absorbed by the changeling!</span>")

You are absorbed by the changeling!

This is userdanger! Userdanger is used in only one situation: when the person receiving the text message is being directly harmed, such as from attacks or antagonist abilities.


Contribution Guides
General Guide to Contributing, Game Resources category, Github Glossary
Setting up a server Setting up the Database, Creating your own paracode server
Coding Understanding SS13 Code, SS13 for experienced programmers, Text Formatting
Mapping Guide to Mapping,
Spriting Guide to Spriting,
Wiki Guide to Editing the Wiki