Skip to content

Commit

Permalink
admin: admins now can spawn cargo crates (ss220-space#6455)
Browse files Browse the repository at this point in the history
* admin: admins now can spawn cargo crates

* fix

* move button to secrets
  • Loading branch information
dageavtobusnick authored Jan 28, 2025
1 parent 89bd4d5 commit 18e64d3
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion code/game/machinery/computer/syndie_cargo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GLOBAL_LIST_INIT(data_storages, list()) //list of all cargo console data storage
slip.ordernumber = ordernum

var/stationName = "Syndicate RaMSS 'Taipan' Supply Mannifest"
var/packagesAmt = data_storage.shoppinglist.len + ((errors & MANIFEST_ERROR_COUNT) ? rand(1,2) : 0)
var/packagesAmt = data_storage?.shoppinglist?.len + ((errors & MANIFEST_ERROR_COUNT) ? rand(1,2) : 0)

slip.name = "Shipping Manifest - '[object.name]' for [orderedby]"

Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ GLOBAL_VAR_INIT(nologevent, 0)
if(marked_datum && istype(marked_datum, /atom))
dat += "<A href='byond://?src=[cached_UID];dupe_marked_datum=1'>Duplicate Marked Datum</A><br>"

var/datum/browser/popup = new(usr, "game_panel", "<div align='center'>Game Panel</div>", 210, 280)
var/datum/browser/popup = new(usr, "game_panel", "<div align='center'>Game Panel</div>", 220, 300)
popup.set_content(dat.Join(""))
popup.set_window_options("can_close=1;can_minimize=0;can_maximize=0;can_resize=0;titlebar=1;")
popup.open()
Expand Down
17 changes: 17 additions & 0 deletions code/modules/admin/create_cargo_crate.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/datum/admins/proc/create_cargo_crate()

if(!check_rights(R_SPAWN))
return

var/path = tgui_input_list(usr, "Выберите тип для спавна", "Карго ящики", (typecacheof(/datum/supply_packs) + typecacheof(/datum/syndie_supply_packs)))
if(!path || !ispath(path))
return
var/datum/supply_order/order = (path in typecacheof(/datum/supply_packs))? new /datum/supply_packs : new /datum/syndie_supply_order
order.ordernum = 0
order.object = new path
order.orderedby = "ОШИБКА"
order.orderedbyRank = "ОШИБКА"
order.crates = 1
order.createObject(get_turf(usr))

log_and_message_admins("spawned cargo pack [order.object.name] at ([usr.x],[usr.y],[usr.z])")
3 changes: 3 additions & 0 deletions code/modules/admin/secrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
<A href='byond://?src=[UID()];secretsfun=set_station_name'>Rename Station Name</A><BR>
<A href='byond://?src=[UID()];secretsfun=reset_station_name'>Reset Station Name</A><BR>
<A href='byond://?src=[UID()];secretsfun=set_centcomm_name'>Rename Central Comand</A><BR>
<BR>
<b>Spawns</b><BR>
<A href='byond://?src=[UID()];secretsfun=spawn_cargo_crate'>Spawn Cargo Crate</A><BR>
</center>"}
if(2)
if(check_rights((R_SERVER|R_EVENT),0))
Expand Down
5 changes: 5 additions & 0 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3587,6 +3587,11 @@
log_admin("[key_name(usr)] moved the gamma armory")
GLOB.gamma_ship_location = !GLOB.gamma_ship_location

if("spawn_cargo_crate")
if(!you_realy_want_do_this())
return
create_cargo_crate()

if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
if(ok)
Expand Down
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,7 @@
#include "code\modules\admin\banappearance.dm"
#include "code\modules\admin\banjob.dm"
#include "code\modules\admin\centcom_ban_db.dm"
#include "code\modules\admin\create_cargo_crate.dm"
#include "code\modules\admin\create_mob.dm"
#include "code\modules\admin\create_object.dm"
#include "code\modules\admin\create_turf.dm"
Expand Down

0 comments on commit 18e64d3

Please sign in to comment.