Git Product home page Git Product logo

ss13paperworksimulator's Introduction

Build Status codebeat badge License: CC BY-NC-SA 3.0

SS13PaperworkSimulator

Renders SS13 (Baystation12) pencode into HTML.

It aims to replicate the same process the game uses to render pencode, so whatever you see in the output will look similar to the same pencode rendered on paper ingame.

Hosted on GitHub Pages at ps.ss13.net
Baystation12 Forums thread: Paperwork Simulator 2307
Baystation12 Wiki resources: Guide to Paperwork, Example Paperwork

Contribution

Please feel free to submit your own work if you are willing to have it available under CC BY-NC-SA 3.0.

To add a template, place it in a .txt file in a directory inside templates/, then add its name and path to templates/index.json. Submit via pull request and check here for requested changes until it is merged. When submitting your work, you may add your name or ckey to credits.json.

Attribution

All included images have been sourced from the Baystation12/Baystation12 repository and are attributed to their respective original authors. All included templates, whether sourced from the Baystation12 Wiki or committed by or on behalf of their original authors, are attributed to their respective original authors. Any characters, settings, and events referred to as part of the Baystation12 story and lore are attributed to their respective original authors.

ss13paperworksimulator's People

Contributors

bluenexus avatar boznar avatar cakeq avatar dibasic avatar green-00ff00 avatar sierrakomodo avatar soryy708 avatar watermelonseverywhere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ss13paperworksimulator's Issues

Angle brackets appear as < and > in output.

Describe the bug
Angle brackets show up as unrendered < or > in the output.

To Reproduce
Steps to reproduce the behavior:

  1. Type the '<' or '>' symbols into the input.

Expected behavior
The angle brackets should appear correctly in the output, but html tags such as <script> should not be interpreted.

Web Browser (please complete the following information):

  • Chrome, Edge
  • Latest versions

Screenshots
image

Pen Code
><

Additional context
Introduced in 9e14ed1 to fix #1 . We replace < and > with < and > to avoid html from being interpreted when output is displayed. The fix for this issue needs to make sure that it doesn't reintroduce that problem.

Feature Request: #anchor to link a specific template

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
User 1 asks for the 'example' template.
User 2 sends them this: http://ps.ss13.net/#example
User 1 clicks the link. The page loads and brings up the 'example' template.

Describe alternatives you've considered
Option 1: The anchor is to '#department/example' and opens the template at templates/department/example.txt
Option 2: The anchor is to '#example' and there exists some way to map that to the correct path.

Additional context

Adjust format of settings menu to line up text and inputs, prevent word wrap

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
Line up all labels, inputs, and info icons with each other.

Describe alternatives you've considered
A flexbox with empty cells on the left where there are no checkboxes might work, but that's a bit of a hack. Moving controls to the right side and info icons to the left side might look more intuitive, involve a simpler solution and would force future commits to add an info icon but that's a good thing, actually.

Additional context
Add any other context or screenshots about the feature request here.

Template Request: Psych Eval

As someone who plays a lot of Medical, those two are by far the most requested pieces of Paperwork from my department, and can be crucial for Antag Intensive rounds.
While the Autopsy Scanner does give a basic report, it's quite spartan in terms of presenting a narrative for a death, and can be difficult to understand for those without the Medical know how. As such, an Autopsy Form is essential for organizing the information resulting from an Autopsy.
The Psych Eval has a great number of uses, especially during a Cult or Deity round. It can be presented to a CMO for declaring certain people unfit for duty or to be sectioned, it can be presented to a CoS for understanding the Psychology of certain criminals, it can be presented to a Court Martial to prevent a hard punishment as the person wasn't aware of their actions, etc.

Changing pen color and using a theme can cause text to be unreadable

Describe the bug
The only unintended behavior here is that changing your pen color back to 'black' locks it at black and isn't overwritten by color schemes.

To Reproduce
Steps to reproduce the behavior:

  1. Set pen color to "Blue"
  2. Set theme to "Solarized (Dark)"
  3. Realize that looks bad, set pen color to "Black" to reset it
  4. You now have black on teal instead of the default solarized color.

Expected behavior
Combining these features should do one of two things:

  1. Lock out the pen color feature entirely while the theme is not default white.
  2. Have the 'Black' pen color instead default to the theme's default text color. Rename 'Black' to 'Black (Default)' or similar.

Web Browser (please complete the following information):

  • Firefox 65.0.2

Screenshots
image

Pen Code

Additional context

Feature Request: Make formatting actions work on selected text

Is your feature request related to a problem? Please describe.
Currently formatting actions (buttons & hotkeys) work by adding a block to the caret position. That's the beginning of text selection.
Users are used to UX, like in MS-Word, where selecting text and pressing the "Bold" button makes the selected text bold. This is not the case for us right now.

Describe the solution you'd like
If user selected text, and performs a formatting action, make it apply on the entire selection.

Describe alternatives you've considered
Or don't

Additional context
N/A

No limit on field quantity.

Describe the bug
The simulator does not limit the amount of fields a document can have, and atleast one document, the Pre-Flight Checklist, is unusable in-game because of this,
To Reproduce
Steps to reproduce the behavior:

  1. Paste the Pre-Flight Checklist onto an in-game piece of paper, and try to edit a field.
  2. Recieve error.

Expected behavior
For the template to work in-game as well as it did in the simulator.

Web Browser (please complete the following information):

  • Chrome
  • Version 72.0.3626.121 (Official Build) (64-bit)

Screenshots

Pen Code

[center][eclogo][/center][hr][hr][h3]SCGEC FORM UF301a: PREFLIGHT CHECKLIST - SINGLE-SEAT CRAFT, SMALL SPACECRAFT OR OTHER BOAT[/h3][/center][hr][hr][grid][row][cell][b]DATE[/b][cell]: [date]
[row][cell][b]LOCAL TIME[/b][cell]: [time]
[row][cell][b]CRAFT[/b][cell]: [field]
[row][cell][b]SHIP[/b][cell]: SEV TORCH
[row][cell]
[row][cell][b]DESTINATION[/b][cell]: [field]
[row][cell][b]PURPOSE[/b][cell]: [field]
[row][/grid][hr][hr][h3]CHECKLIST[/h3][hr][hr]
[small][table][row][cell][b]#[/b][cell][b]INSTRUCTION OR CHECK[/b][cell][b]PASS/FAIL[/b][cell][b]AMT/QTY/NOTE[/b]
[row][cell]1a[cell]Port side of hull shows no signs of damage or fatigue[cell][field][cell][field]
[row][cell]1b[cell]Starboard side of hull shows no signs of damage or fatigue[cell][field][cell][field]
[row][cell]1c[cell]Windows and glass panels have no visible cracks, loose
or missing fastening screws, or loose or missing brackets[cell][field][cell][field]
[row][cell]2a[cell]Engine nozzles show no damage or fatigue, debris, loose
objects, or objects blocking nozzle exhaust[cell][field][cell][field]
[row][cell]2b[cell]Area behind and below engine nozzles is free of spilled or
leaking fluid, loose fastening screws, and other debris[cell][field][cell][field]
[row][cell]3a[cell]Short-range or chemical fuel tank above 300 kPa*
[i]for 70L H2 at 293K; 8.62 mol H2 for other calculations[/i][cell][field][cell][field]
[row][cell]3b[cell]Short-range fuel tank connected with no sign of leak[cell][field][cell][field]
[row][cell]3c[cell]Short-range fuel access panel closed and latched[cell][field][cell][field]
[row][cell]4a[cell]Long-range fuel pump or regulator state is ON or OPEN[cell][field][cell][field]
[row][cell]4b[cell]Long-range fuel pump or regulator target pressure set to
15MPa or applicable maximum[cell][field][cell][field]
[row][cell]4c[cell]Long-range fuel pump or regulator flow rate set to 500L/s
or applicable maximum[cell][field][cell][field]
[row][cell]4d[cell]Long-range fuel tank connected to long-range fuel port[cell][field][cell][field]
[row][cell]5a[cell]All area power controllers show GREEN (100% charge) or
BLUE (<100% charge, increasing) status[cell][field][cell][field]
[row][cell]5b[cell]SMES or PSU total charge is at or above 80% of maximum[cell][field][cell][field]
[row][cell]5c[cell]SMES or PSU connected to terminal; no wires are missing,
damaged, or disconnected[cell][field][cell][field]
[row][cell]5d[cell]Visible power cables show no signs of damage[cell][field][cell][field]
[row][cell]6a[cell]PACMAN, MRSPACMAN, SUPERPACMAN, or other electrical
generator is fixed in place and connected to power cable[cell][field][cell][field]
[row][cell]6b[cell]Generator power cable leads directly to SMES or PSU
terminal and not to any other power draw[cell][field][cell][field]
[row][cell]6c[cell]Generator solid fuel is present and loaded into generator
unit or stored in fireproof locker or crate[cell][field][cell][field]
[row][cell]6d[cell]Generator power setting is equal to or less than the
maximum safe output listed on bottom or rear of unit[cell][field][cell][field]
[row][cell]6e[cell]Generator setting is OFF if connected to ship powernet[cell][field][cell][field]
[row][cell]7a[cell]All internal atmospheric vents and scrubbers are enabled
and all environmental controls are set to 'Filtering' mode[cell][field][cell][field]
[row][cell]7b[cell]Air distribution tank is full or above 4MPa and air scrubber
tank is empty or below 100kPa[cell][field][cell][field]
[row][cell]7c[cell]Airlock buffer tank is between 200kPa and 600kPa, or
airlock pressure regulator or pump is ON or OPEN and set
between 100 and 120kPa with 500L/s or maximum flow[cell][field][cell][field]
[row][cell]8a[cell]Enough O2 or airmix tanks for mission and crew are on
board and all are set to safe
distribution pressure
[i]see manufacturer for safe distribution pressures[cell][field][cell][field]
[row][cell]8b[cell]Enough breath masks are on board for mission[cell][field][cell][field]
[row][cell]8c[cell]Enough voidsuits or protective equipment for mission and
crew are on board, all equipment is attached, and no suits
show signs of punctures, melting, or tearing[cell][field][cell][field]
[row][cell]8d[cell]Other mission-related cargo matches mission manifest

[i]see form UF311[cell][field][cell][field]
[row][cell]9a[cell]Sensors console shows status "VACUUM SEAL BROKEN"
(if atmospheric) or "OK" (if in vacuum)[cell][field][cell][field]
[row][cell]9b[cell]Engine control console shows all nozzles present and
power is equal for all engines on the same line[cell][field][cell][field]
[row][cell]9c[cell]Engines are all turned ON and throttled to ideal limit

*[i]see manual UF3-04-1134 for discussion of ideal limits[cell][field][cell][field]
[row][cell]9d[cell]Helm console shows acceleration above 0.0 and within
expected range[cell][field][cell][field]
[row][cell]10a[cell]All mission crew are on board and match mission manifest
*[i]see form UF312 or forms UF322a or UF322b[cell][field][cell][field]
[row][cell]10b[cell]All external airlocks are sealed[cell][field][cell][field]
[row][cell]10c[cell]Relevant manifests submitted and departure authorization
received from hangar control or command if required[cell][field][cell][field][/table]
[b]IMPORTANT: YOU MUST WRITE "PASS", "FAIL", OR "N/A" FOR EVERY CHECK. DO NOT IGNORE OR SKIP ANY APPLICABLE CHECKS. DO NOT COMPLETE THIS CHECKLIST OUT OF ORDER. DO NOT MEMORIZE THIS CHECKLIST. DO NOT COMPLETE THIS CHECKLIST AT ANY TIME OTHER THAN WHILE PERFORMING YOUR PREFLIGHT CHECK. NEGLIGENT OPERATION OF SPACECRAFT IS PUNISHABLE BY CRIMINAL LAW AND THE SCUJ.[/b][/small]

[hr][hr][h3]VERIFICATION[/h3][hr][hr]
[b]PREPARING[/b] pilot, technician or flight officer

[small][i]I take responsibility for any negligent preparation of the craft listed above. I verify to the best of my knowledge that I have completed all checks listed above, that I have completed them fully and in their listed order, and that I am trained and authorized to operate this craft and its equipment.[/i][/small]
[grid]
[row][cell][b]RANK / RATE[/b][cell]: [field]
[row][cell][b]FULL NAME[/b][cell]: [field]
[row][cell][b]ASSIGNMENT[/b][cell]: [field]
[row][cell][b]SIGN[/b][cell]: [field]
[row][cell][b]DATE[/b][cell]: [field][/grid]
[hr]

Additional context
Add any other context about the problem here.

Feature Request: Set up linter rules

Is your feature request related to a problem? Please describe.
JS, due to its dynamic nature, tends to fail in production. Currently there's no way to know if the JS code is problemantic other than running it manually.

Describe the solution you'd like
Set up linter rules. Linting is a form of static code analysis that allows you to see potential issues with your code before it's run.

Describe alternatives you've considered
Or dont.

Additional context
https://eslint.org/

Sometimes template loads but preview not updated

Describe the bug
Sometimes, but not all times, loading a template will result in the left side getting updated but the right side not. Usually happens with templates with a lot of content.

To Reproduce
Steps to reproduce the behavior:

  1. Pick a template
  2. Press load

Expected behavior
Both left and right side get updated

Web Browser (please complete the following information):

  • Firefox v65.0.2 (64-bit)
  • Chrome 72.0.3626.121 (64-bit)

Screenshots
image

Pen Code
N/A

Additional context
N/A

[small] and [large] tags stack with and negate each other

Describe the bug
Each nested [small] or [large] tag continues to decrease or increase the size of text. This can result in very small or very large text or nested opposite tags cancelling each other out.

To Reproduce
Steps to reproduce the behavior:

  1. Enter the example code below into the input textarea.

Expected behavior

  • Only one level of [small] and [large] should be possible. There should be no difference between [small]X[/small] and [small][small]X[/small][/small].
  • [small] and [large] tags should not negate each other. Instead, text should be the size set by the first tag it's in (text in a large tag should be large, even if that large tag is inside a small tag)

Web Browser (please complete the following information):

  • Firefox, Edge
  • Latest versions

Screenshots
Ingame:
image
image
Simulator:
image
image

Pen Code
TEST1[small]TEST2[small]TEST3[small]TEST4[/small][/small][/small]
TEST1[small]TEST2[large]TEST3[/large]TEST4[/small]TEST5

Additional context
We are using <small> and <large> tags, while the game uses <font>. Fixing this may require some snowflakey checks.

Feature Request: Preview setting for pen colors, crayon colors, fancy pen

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
A control added to the Preview Settings menu with two additional select menus:

  1. Pen type (pen or crayon)
  2. Pen style (see additional context)

These default to a black pen setting.

When changed, the style of the output adjusts based on setting.

Describe alternatives you've considered

Instead of offering all ingame colors, we could offer

  • just the preset black/red/green/blue, or
  • a color picker

The ingame colors may be better to offer, if more restrictive and theoretically a source of maintenance if pencode is ever touched. WYSIWYG, and unless adminbus is involved (or antag pens with a few extra colors), you only get the common colors. There's the rainbow crayon, however, which gets a color picker.

Additional context
Pen styles: clerical kit pins have any of these colors, color changing pens have black/red/blue/green, and the fancy pen only has their one color.

  • Black (default): 000000
  • Red (red pens): FF0000
  • Blue (blue pens): 0000FF
  • Green (color changing pens): 00FF00
  • Pink (clerical kit pen): FF00FF
  • Orange (clerical kit pen): FF9900
  • Cyan (clerical kit pen): 00FFFF
  • Invisible (clerical kit pen): FFFFFF
  • Fancy (afaik this only spawns on the Unishi/Verne): 1c1713, Segoe Script font

Crayon styles: Comic Sans MS font; as far as I know, all the same colors as clerical kit pens. The rainbow crayon can pick any color and defaults to FFF000

Feature Request: Set up a transpiler (babel)

Is your feature request related to a problem? Please describe.
Writing backwards-compatible JavaScript is a pain, especially when considering how old browsers can get. ES6 is very fun.

Describe the solution you'd like
Set up a transpiler like Babel to turn valid modern JS in to backwards compatible old-style JS automatically.

Describe alternatives you've considered
Or not.

Additional context
https://babeljs.io/

Feature Request: Night Mode

Is your feature request related to a problem? Please describe.
Sometimes I want to prepare a template late at night, or I want to use the site to preview something I'm writing and not have to do corrections in-game, but the full-white color scheme really hurts my eyes.
Describe the solution you'd like
A button or setting that can turn the color scheme more night-friendly, so my eyes don't hurt.

Describe alternatives you've considered
None.

Additional context
Just open the site at night, and you'll see what I mean.

[small] does not affect text placed within a [grid][row][cell]

[small] should affect all text in all elements before the first occurrence of [/small]. This may not work correctly because text in a grid cell has no element around it for nextUntil to select.

Possible fix: add

or to [cell] and a closing tag to [/cell]

Move credits markup to another file

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
Some external markup file, or just an .html file, that contains everything currently in #credits-dialog

Describe alternatives you've considered

  • JSON file holding names and shill links/icon classes of developer credits, names of authors, other text
  • Straight up copying the whole thing into another .html file
  • Straight up copying the whole thing into an .xml file

Additional context
The developer credits are half of index.html in terms of LOC and I'd like to keep index.html as clean as possible.

Color is not applied recursively

Describe the bug
Only part of the text color is changed when switching themes

To Reproduce
Steps to reproduce the behavior:

  1. Open the instructions template
  2. Switch theme
  3. Change pen color

Expected behavior
All the text is the same color

Web Browser (please complete the following information):
Firefox 66.0 (64-bit)

Screenshots
image

Pen Code

Additional context

Arrest report format is missing a line

Describe the bug
Pen code format for security arrest report is missing a line

To Reproduce

Load the security arrest report, scroll down to the BRIG CHIEF MUST STAMP line

Expected behavior

https://i.gyazo.com/13a5068b153bac16a713166064a8a034.png

Web Browser (please complete the following information):

  • Firefox
  • 68.0.1

Screenshots

https://i.gyazo.com/8554c0c55573af7d19ea66f7ef9f7b60.png

Pen Code

[center][solcrest][h1]Arrest Report[/h1][field][/center]
[i]Revision [date] - [time][/i]
[b]Offense/Incident Type: [/b][field]
[b]Location: [/b][field]
[hr][h3]Arrestee Information[/h3]
[small][i](B##-Brigged, ## time, H-Indefinite Hold, C-Court Martial, P-Parole/Probation, V-Verbal Warning)
[table][row][cell][b]Rank[/b][cell][b]Name[/b][cell][b]Position[/b][cell][b]Charge(s)[/b][cell][b]Disposition[/b]
[row][cell][b][field][/b][cell][field][cell][field][cell][field][cell][field]
[/table][/i][/small][br][br][hr][h3]Personnel Involved in Incident[/h3]
[b]Arresting Officer(s): [/b][field][br]
[b]Other Personnel[/b]
[small][i](V-Victim, S-Suspect, W-Witness, M-Missing, A-Arrested, RP-Reporting Person, D-Deceased)[/i][/small][br]
[table][row][cell][b]Rank[/b][cell][b]Name[/b][cell][b]Position[/b][cell][b]Relation[/b]
[row][cell][b][field][/b][cell][field][cell][field][cell][field]
[row][cell][b][field][/b][cell][field][cell][field][cell][field]
[row][cell][b][field][/b][cell][field][cell][field][cell][field]
[row][cell][b][field][/b][cell][field][cell][field][cell][field]
[row][cell][b][field][/b][cell][field][cell][field][cell][field]
[/table][br][br][hr][h3]Booking Checklist[/h3]
[b]Booking Officer: [/b][field][br]
[table][row][cell][b]Escape Risk[/b][cell][field]
[row][cell][b]Suicide Risk[/b][cell][field]
[row][cell][b]Combative[/b][cell][field]
[row][cell][b]Provided Required Medical Treatment[/b][cell][field]
[row][cell][b]Warrant Presented[/b][cell][field]
[row][cell][b]Advised of Rights[/b][cell][field]
[row][cell][b]Prisoner Searched[/b][cell][field]
[row][cell][b]Provided an Opportunity for Statement[/b][cell][field]
[hr][small]BRIG OFFICER MUST STAMP OR SIGN THIS DOCUMENT
ATTACH ALL RELEVANT DOCUMENTS TO THIS ARREST REPORT[/small][hr]

Additional context

Add any other context about the problem here.

[Write...] prompt behaves weirdly

Describe the bug

  • It looks like a hyperlink. It makes me want to click it, but that does nothing.
  • It does not go away if I start typing

To Reproduce
Steps to reproduce the behavior:

  1. Go to http://ps.ss13.net/
  2. Click on input box (left)
  3. Ctrl+A, Delete
  4. Start typing

Expected behavior

  • The prompt should not look like a link (blue/purple text with underline by default on most browsers)
  • When input is not empty, do not show the prompt

Web Browser (please complete the following information):

  • Firefox 65.0.2

Screenshots
image

Pen Code
N/A

Additional context
I understand the prompt is there to mimic the way the editor looks/works in-game. That UX is broken, there's no need to mimic it.

Loading templates does not update the preview

Tested in Firefox and Chrome on Windows 10.

Steps to reproduce:

  • Select a template
  • Click 'Load' button
  • Note the preview window does not update until you type something into the edit window

Feature Request: Insert basic pencode blocks

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
The user has access to a new control in the top fieldset, a selectmenu which when an item is chosen from its menu will insert a commonly used block of pencode at the cursor. Commonly used blocks might be: [grid] (prompt for rows/columns), [table] (same), paperwork header with centered title and logo, etc.

Describe alternatives you've considered
These blocks could be stored in a global JS list, stored in a .json file and accessed when needed, loaded after startup and then available as a global list, or stored as an element somewhere.

Additional context
Adding this control as a inside the top fieldset will apply jQuery UI selectmenu styling with our color scheme already applied.

Feature Request: Make formatting actions toggle instead of only adding

Is your feature request related to a problem? Please describe.
Currently, every time you do a formatting action (use a hotkey, or press a button), it adds a new tag.
This is not intuitive, because users are used to UX like in MS-Word, where for example pressing Bold on already bold text makes it not bold.

Describe the solution you'd like
Make formatting actions toggle instead of only adding

Describe alternatives you've considered
Or don't.

Additional context
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.