Skip to content

Commit

Permalink
Fluff paper tweaks (#19894)
Browse files Browse the repository at this point in the history
Fluff papers now update the free space on the paper correctly on
initialization.
Moved all the fluff paper in code, from the maps.
Added maplinting for fluff papers.
Added DMDoc for fluff papers.
  • Loading branch information
FluffyGhoster committed Sep 21, 2024
1 parent 6572cf3 commit 530fbf1
Show file tree
Hide file tree
Showing 9 changed files with 206 additions and 315 deletions.
47 changes: 33 additions & 14 deletions code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@
else
icon_state = "[base_state]"

/obj/item/paper/proc/update_space(var/new_text)
/**
* Updates the amount of free space in the paper
*
* * new_text - The new text the paper contains (supposedly), text
*/
/obj/item/paper/proc/update_space(new_text)
if(new_text)
free_space -= length(strip_html_properly(new_text))

Expand Down Expand Up @@ -756,29 +761,43 @@
. = ..()
scan_target = WEAKREF(set_scan_target)

//
// Fluff Papers
// Fluff papers that you can map in, for lore or whatever.
//

/// Parent item for fluff papers. Used for lore or something I guess
/obj/item/paper/fluff
name = "fluff paper"
desc = "You aren't supposed to see this."
/// The language to translate the paper into. Set to the name of the language.

/*#############################################
FLUFF PAPERS SUBTYPE
#############################################*/

/**
* # Fluff papers
*
* Fluff papers that you can map in, used in mapping
*
* You **have** to create a subtype for the map you're using it in, and have the info/name variables set in code, **not in map** ie:
*
* ```
* /obj/item/paper/fluff/<mapname>/(<paper_name>(/)?)+
* ```
*
* This subtype will take care of updating the free space on the paper on initialization, and can be written in different languages
*/
ABSTRACT_TYPE(/obj/item/paper/fluff)
/// The language to translate the paper into, one of the `LANGUAGE_*` in `code\__DEFINES\species_languages.dm`
var/language

/obj/item/paper/fluff/Initialize()
/obj/item/paper/fluff/Initialize(mapload, text, title)
. = ..()
if(language)
var/datum/language/L = GLOB.all_languages[language]

if(src.language)
var/datum/language/L = GLOB.all_languages[src.language]
if(istype(L) && L.written_style) //Don't want to try and write in Hivenet or something
var/key = L.key
var/languagetext = "\[lang=[key]]"
languagetext += "[info]\[/lang]"
info = parsepencode(languagetext)
src.info = parsepencode(languagetext)
update_icon()

update_space(src.info)

// Used in the deck 3 cafe on the SCCV Horizon.
/obj/item/paper/fluff/microwave
name = "\improper RE: Where are our microwaves?"
Expand Down
61 changes: 61 additions & 0 deletions html/changelogs/fluffyghost-fluffpapertweak.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################

# Your name.
author: FluffyGhost

# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True

# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "Fluff papers now update the free space on the paper correctly on initialization."
- refactor: "Moved all the fluff paper in code, from the maps."
- rscadd: "Added maplinting for fluff papers."
- rscadd: "Added DMDoc for fluff papers."
4 changes: 4 additions & 0 deletions maps/away/ships/freebooter/freebooter_ship_.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,7 @@
fuel_consumption = 2
logging_home_tag = "nav_hangar_freebooter"
defer_initialisation = TRUE

/obj/item/paper/fluff/freeboter_ship/captain_note
name = "old captain's note"
info = "Don't forget - all of the crew's clothing is now in the cargo pod!"
15 changes: 3 additions & 12 deletions maps/away/ships/freebooter/freebooter_ship_submaps.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@
/area/ship/freebooter_ship/pod2)
"avE" = (
/obj/structure/closet/cabinet,
/obj/item/paper{
name = "old captain's note";
info = "Don't forget - all of the crew's clothing is now in the cargo pod!"
},
/obj/item/paper/fluff/freeboter_ship/captain_note,
/turf/simulated/floor/tiled/dark,
/area/ship/freebooter_ship/pod1)
"awG" = (
Expand Down Expand Up @@ -440,10 +437,7 @@
name = "lattice"
},
/obj/structure/closet/cabinet,
/obj/item/paper{
name = "old captain's note";
info = "Don't forget - all of the crew's clothing is now in the cargo pod!"
},
/obj/item/paper/fluff/freeboter_ship/captain_note,
/turf/simulated/floor,
/area/ship/freebooter_ship/pod6)
"bxM" = (
Expand Down Expand Up @@ -3021,10 +3015,7 @@
name = "lattice"
},
/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers,
/obj/item/paper{
name = "old captain's note";
info = "Don't forget - all of the crew's clothing is now in the cargo pod!"
},
/obj/item/paper/fluff/freeboter_ship/captain_note,
/turf/simulated/floor,
/area/ship/freebooter_ship/pod1)
"qEc" = (
Expand Down
12 changes: 12 additions & 0 deletions maps/event/idris_cruise/code/idris_cruise.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
allowed_spawns = list("Living Quarters Lift", "Cryogenic Storage")
spawn_types = list(/datum/spawnpoint/living_quarters_lift, /datum/spawnpoint/cryo)
default_spawn = "Living Quarters Lift"

/obj/item/paper/fluff/idris_cruise/vr_prep
name = "VR Introduction Slip"
info = "Welcome to your very own VR preparation room! You can customize your virtual reality avatar here. Once ready, head out to the Game Selection Hall, where you can head out on your customized adventure! Have fun!"

/obj/item/paper/fluff/idris_cruise/medal_of_valor
name = "medal of valor intro sheet"
info = "This stage is for the MEDAL OF VALOR 2 alpha gameplay demo! Please enter your respective team's chair for balance reasons. Do not use the enemy team's base ingame! Remember, sharing is caring!"

/obj/item/paper/fluff/idris_cruise/medal_of_valor_nopush
name = "Medal of Valor 2 Introduction Slip"
info = "Welcome to MEDAL OF VALOR 2 gameplay demo. You've entered your teams respective base. Proceed to the fighting! Do not push into the enemy's base under any circumstances! Remember, have fun!"
Loading

0 comments on commit 530fbf1

Please sign in to comment.