mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
14 lines
14 KiB
HTML
14 lines
14 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>/obj/item/book - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="obj/item/book.html#var">Var Details</a> - <a href="obj/item/book.html#proc">Proc Details</a></header><main><h1>Standard Book <aside>/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/book.html">book</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L14"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 14"></a></h1><p>Game Object which stores pages of text usually written by players, has other editable information such as the book's
|
||
title, author, summary, and categories. Has other values that are generated when books are acquired through the library
|
||
computer.</p>
|
||
<p>Like other User Interfaces that heavily rely on player input, using newer tools such as TGUI presents sanitization issues
|
||
so books will remain using BrowserUI until further notice.</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/item/book.html#var/author">author</a></th><td>Who wrote the book, can be changed by pen or PC</td></tr><tr><th><a href="obj/item/book.html#var/book_bgcolor">book_bgcolor</a></th><td>The background color of the book, useful for themed programmatic books, must be in #FFFFFF hex color format</td></tr><tr><th><a href="obj/item/book.html#var/book_height">book_height</a></th><td>Book UI Popup Height</td></tr><tr><th><a href="obj/item/book.html#var/book_width">book_width</a></th><td>Book UI Popup Width</td></tr><tr><th><a href="obj/item/book.html#var/brain_damage_cooldown">brain_damage_cooldown</a></th><td>Cooldown for brain damage loss when reading</td></tr><tr><th><a href="obj/item/book.html#var/carved">carved</a></th><td>Indicates whether or not a books pages have been carved out</td></tr><tr><th><a href="obj/item/book.html#var/categories">categories</a></th><td>Book Categories - used for differentiating types of books, set by players upon upload, viewable upon examining book</td></tr><tr><th><a href="obj/item/book.html#var/copyright">copyright</a></th><td>Prevents book from being uploaded - For all printed books</td></tr><tr><th><a href="obj/item/book.html#var/current_page">current_page</a></th><td>What page is the book currently opened to? Page 0 - Intro Page | Page 1-5 - Content Pages</td></tr><tr><th><a href="obj/item/book.html#var/imaginary">imaginary</a></th><td>Is this item imaginary and not able to interact with anything else?</td></tr><tr><th><a href="obj/item/book.html#var/libraryid">libraryid</a></th><td>Book's id within the library system, unique to each book object, should not be declared manually</td></tr><tr><th><a href="obj/item/book.html#var/pages">pages</a></th><td>Content Pages of the books, this variable is a list of strings containting the HTML + Text of each page</td></tr><tr><th><a href="obj/item/book.html#var/protected">protected</a></th><td>Prevents book contents from being edited</td></tr><tr><th><a href="obj/item/book.html#var/rating">rating</a></th><td>Book Rating - Assigned by library computer based on how many/how players have rated this book</td></tr><tr><th><a href="obj/item/book.html#var/store">store</a></th><td>Item that is stored inside the book</td></tr><tr><th><a href="obj/item/book.html#var/summary">summary</a></th><td>Short summary of the contents of the book, can be changed by pen or PC</td></tr><tr><th><a href="obj/item/book.html#var/title">title</a></th><td>Title & Real name of the book</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/item/book.html#proc/can_read">can_read</a></th><td>Internal Checker Proc</td></tr><tr><th><a href="obj/item/book.html#proc/clear_stored_item">clear_stored_item</a></th><td>needed for proper GC'ing</td></tr><tr><th><a href="obj/item/book.html#proc/edit_book">edit_book</a></th><td>Edit Book Proc</td></tr><tr><th><a href="obj/item/book.html#proc/read_book">read_book</a></th><td>Read Book Proc</td></tr><tr><th><a href="obj/item/book.html#proc/show_content">show_content</a></th><td>Show Content Proc</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/author"><aside class="declaration">var </aside>author <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L30"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 30"></a></h3><p>Who wrote the book, can be changed by pen or PC</p><h3 id="var/book_bgcolor"><aside class="declaration">var </aside>book_bgcolor <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L38"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 38"></a></h3><p>The background color of the book, useful for themed programmatic books, must be in #FFFFFF hex color format</p><h3 id="var/book_height"><aside class="declaration">var </aside>book_height <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L47"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 47"></a></h3><p>Book UI Popup Height</p><h3 id="var/book_width"><aside class="declaration">var </aside>book_width <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L49"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 49"></a></h3><p>Book UI Popup Width</p><h3 id="var/brain_damage_cooldown"><aside class="declaration">var </aside>brain_damage_cooldown <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L61"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 61"></a></h3><p>Cooldown for brain damage loss when reading</p><h3 id="var/carved"><aside class="declaration">var </aside>carved <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L57"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 57"></a></h3><p>Indicates whether or not a books pages have been carved out</p><h3 id="var/categories"><aside class="declaration">var </aside>categories <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L36"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 36"></a></h3><p>Book Categories - used for differentiating types of books, set by players upon upload, viewable upon examining book</p><h3 id="var/copyright"><aside class="declaration">var </aside>copyright <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L51"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 51"></a></h3><p>Prevents book from being uploaded - For all printed books</p><h3 id="var/current_page"><aside class="declaration">var </aside>current_page <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L42"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 42"></a></h3><p>What page is the book currently opened to? Page 0 - Intro Page | Page 1-5 - Content Pages</p><h3 id="var/imaginary"><aside class="declaration">var </aside>imaginary <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L44"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 44"></a></h3><p>Is this item imaginary and not able to interact with anything else?</p><h3 id="var/libraryid"><aside class="declaration">var </aside>libraryid <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L55"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 55"></a></h3><p>Book's id within the library system, unique to each book object, should not be declared manually</p><h3 id="var/pages"><aside class="declaration">var </aside>pages <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L40"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 40"></a></h3><p>Content Pages of the books, this variable is a list of strings containting the HTML + Text of each page</p><h3 id="var/protected"><aside class="declaration">var </aside>protected <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L53"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 53"></a></h3><p>Prevents book contents from being edited</p><h3 id="var/rating"><aside class="declaration">var </aside>rating <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L34"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 34"></a></h3><p>Book Rating - Assigned by library computer based on how many/how players have rated this book</p><h3 id="var/store"><aside class="declaration">var </aside>store <aside>– /<a href="obj.html">obj</a>/<a href="obj/item.html">item</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L59"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 59"></a></h3><p>Item that is stored inside the book</p><h3 id="var/summary"><aside class="declaration">var </aside>summary <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L32"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 32"></a></h3><p>Short summary of the contents of the book, can be changed by pen or PC</p><h3 id="var/title"><aside class="declaration">var </aside>title <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L28"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 28"></a></h3><p>Title & Real name of the book</p><h2 id="proc">Proc Details</h2><h3 id="proc/can_read"><aside class="declaration">proc </aside>can_read<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L133"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 133"></a></aside></h3><p>Internal Checker Proc</p>
|
||
<p>Gives free pass to observers to read, ensures that all other mobs attempting to read book are A) literated and
|
||
B) are within range to actually read the book.</p><h3 id="proc/clear_stored_item"><aside class="declaration">proc </aside>clear_stored_item<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L364"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 364"></a></aside></h3><p>needed for proper GC'ing</p><h3 id="proc/edit_book"><aside class="declaration">proc </aside>edit_book<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L232"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 232"></a></aside></h3><p>Edit Book Proc</p>
|
||
<p>This is where a lot of the magic happens, upon interacting with the book with a pen, this proc will open up options
|
||
for the player to edit the book. Most importantly, this is where we account for player stupidity and maliciousness
|
||
any input must strip/reject bad text and HTML from user input, additionally we account for players trying to screw
|
||
with the Database. This will also limit the max characters players can upload at one time to prevent spamming.</p><h3 id="proc/read_book"><aside class="declaration">proc </aside>read_book<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L148"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 148"></a></aside></h3><p>Read Book Proc</p>
|
||
<p>Checks if players is able to read book and that book is readable before calling the neccesary procs to open up UI</p><h3 id="proc/show_content"><aside class="declaration">proc </aside>show_content<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/776b9861f70566b1e6a0763a465ef22f7920a3d6/code/modules/library/book.dm#L174"><img src="git.png" width="16" height="16" title="code/modules/library/book.dm 174"></a></aside></h3><p>Show Content Proc</p>
|
||
<p>Builds the browserUI html to show to the player then open up the User interface. It first build the header navigation
|
||
buttons and then builds the rest of the UI based on what page the player is turned to.</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/776b9861f70566b1e6a0763a465ef22f7920a3d6">776b986</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html> |