Skip to content

Commit

Permalink
Persistency - clothing saving and loading
Browse files Browse the repository at this point in the history
funny object in container moment, hat to derive location for coords.
  • Loading branch information
silencer-pl committed May 28, 2024
1 parent fa2539f commit e318c41
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 47 deletions.
1 change: 1 addition & 0 deletions code/game/objects/items/sectorpatrol/crafting_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
icon_state = "default"
desc = "Brown packaging in the shape of a box. If just looked at, seems like cardboard, but when touched, one would see that it seems way more rigid and seems to be in fact some sort of resin. Seems like it would be easy to break open, but the process would clearly be one way. A label is visible on one of its corners."
desc_lore = "The Northern Republic Production Standard not only dictates screw hole sizes and tube lengths, but also regulates both packaging and labeling of anything adhering to the standard when it is produced. Essentially this means that every NRPS standard complaint wrapping is made of the same brownish artificial resin, meant to be a combination of cardboard and Styrofoam, and always comes with a label oriented towards the bottom-right hand corner of the package. Essentially this means that if you can read the letters, the package is likely upright."
PersistantObject = TRUE

/obj/item/crafting/packages/chair
icon_state = "package_l"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
desc_lore = "The Northern Republic Production Standard not only dictates screw hole sizes and tube lengths, but also regulates both packaging and labeling of anything adhering to the standard when it is produced. Essentially this means that every NRPS standard complaint wrapping is made of the same brownish artificial resin, meant to be a combination of cardboard and Styrofoam, and always comes with a label oriented towards the bottom-right hand corner of the package. Essentially this means that if you can read the letters, the package is likely upright."
opacity = FALSE
density = TRUE
PersistantObject = TRUE

/obj/structure/crafting/packages/table
icon_state = "package_xl"
Expand Down
27 changes: 14 additions & 13 deletions code/modules/admin/verbs/sectorpatrol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
sleep(5)
GLOB.savefile_number += 1
//Savefile number reference
var/savefile/G = new("data/persistance/globals.sav")
var/savefile/G = new("data/persistance/turf_obj_globals.sav")
G["current_save"] << GLOB.savefile_number
//Turfs
to_chat(world, SPAN_BOLDWARNING("Saving modular turf data..."))
Expand All @@ -110,16 +110,17 @@
var/item_index = 0
for(var/obj/obj in GLOB.objects_saved)
item_index += 1
var/turf/groundloc = get_turf(obj)
I.cd = "/[item_index]"
I["objtype"] << obj.type
I["name"] << obj.name
I["desc"] << obj.desc
I["desc_lore"] << obj.desc_lore
I["x"] << obj.x
I["x"] << groundloc.x
I["pixel_x"] << obj.pixel_x
I["y"] << obj.y
I["y"] << groundloc.y
I["pixel_y"] << obj.pixel_y
I["z"] << obj.z
I["z"] << groundloc.z
I["customizable"] << obj.customizable
I["customizable_desc"] << obj.customizable_desc
I["customizable_desc_lore"] << obj.customizable_desc_lore
Expand All @@ -139,7 +140,7 @@

to_chat(world, SPAN_BOLDWARNING("Performing persistant data load. The game may stop responidng..."))
sleep(5)
var/savefile/G = new("data/persistance/globals.sav")
var/savefile/G = new("data/persistance/turf_obj_globals.sav")
G["current_save"] >> GLOB.savefile_number
to_chat(world, SPAN_BOLDWARNING("Loading turfs..."))
var/savefile/S = new("data/persistance/turf_ovpst_[GLOB.savefile_number].sav")
Expand Down Expand Up @@ -172,14 +173,14 @@
I["y"] >> item_y
I["z"] >> item_z
var/obj/newitem = new item_type(locate(item_x, item_y, item_z))
I["name"] << newitem.name
I["desc"] << newitem.desc
I["desc_lore"] << newitem.desc_lore
I["pixel_x"] << newitem.pixel_x
I["pixel_y"] << newitem.pixel_y
I["customizable"] << newitem.customizable
I["customizable_desc"] << newitem.customizable_desc
I["customizable_desc_lore"] << newitem.customizable_desc_lore
I["name"] >> newitem.name
I["desc"] >> newitem.desc
I["desc_lore"] >> newitem.desc_lore
I["pixel_x"] >> newitem.pixel_x
I["pixel_y"] >> newitem.pixel_y
I["customizable"] >> newitem.customizable
I["customizable_desc"] >> newitem.customizable_desc
I["customizable_desc_lore"] >> newitem.customizable_desc_lore
newitem.update_icon()
newitem.update_custom_descriptions()
to_chat(world, SPAN_BOLDWARNING("Object data loaded."))
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/head/head_sp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
var/flippable
var/flippable_flipped
var/flippable_returns
PersistantObject = TRUE


//flippable caps, add icon with _flipped to both sets
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/shoes/shoes_sp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
item_icons = list(
WEAR_FEET = 'icons/obj/sp_clothes/shoes/onmob/shoes.dmi'
)
PersistantObject = TRUE

///obj/item/clothing/shoes/sp_personal/baseshoe/marine
// name = "marine boots"
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/socks/socks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
WEAR_SOCKS = 'icons/obj/sp_clothes/socks/onmob/socks.dmi'
)
layer = SOCKS_LAYER
PersistantObject = TRUE

/obj/item/clothing/socks/update_clothing_icon()
if(ismob(loc))
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/suits/civilian_sp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
var/openable
var/openable_open
PersistantObject = TRUE


/obj/item/clothing/suit/sp_personal/verb/open_jacket()
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/under/under_sp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
var/openable
var/openable_open
PersistantObject = TRUE

// Objects with rollable sleeves

Expand Down
Loading

0 comments on commit e318c41

Please sign in to comment.