Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You can now have custom overmap icons for your ship #6

Merged
merged 5 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions _maps/configs/nanotrasen_cheyenne.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"map_id": "nanotrasen_cheyenne",
"description": "The Cheyenne-Class is a state-of-the-art Flotilla style vessel, designed and constructed by NanoTrasen to serve as a central hub for frontier operations. Built with versatility and durability in mind, the Frontier Voyager combines the functionality of a large, stationary space station with the mobility of a capital-class starship. Its vast interior is equipped with all the necessary facilities to support a variety of operations, from scientific research and mineral extraction to security and medical response.",
"limit": 1,
"ship_icon": "cheyenne",
"empty_space_icon": "cheyenne_space",
"tags": [
"RP Focus",
"Generalist",
Expand Down
5 changes: 4 additions & 1 deletion code/controllers/subsystem/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ SUBSYSTEM_DEF(mapping)
CHECK_LIST_EXISTS("job_slots")
var/datum/map_template/shuttle/S = new(data["map_path"], data["map_name"], TRUE)
S.file_name = data["map_path"]

if(istext(data["ship_icon"]))
S.ship_icon = data["ship_icon"]
if(istext(data["empty_space_icon"]))
S.empty_space_icon = data["empty_space_icon"]
if(istext(data["map_short_name"]))
S.short_name = data["map_short_name"]
else
Expand Down
5 changes: 4 additions & 1 deletion code/datums/shuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
var/port_y_offset
var/port_dir

var/ship_icon
var/empty_space_icon

var/limit = 2
var/enabled
var/short_name
Expand Down Expand Up @@ -219,7 +222,6 @@
.["templateSpawnCoeff"] = spawn_time_coeff
.["templateOfficerCoeff"] = officer_time_coeff
.["templateEnabled"] = enabled

.["templateJobs"] = list()
for(var/datum/job/job as anything in job_slots)
var/list/jobdetails = list()
Expand Down Expand Up @@ -328,6 +330,7 @@

/datum/map_template/shuttle/subshuttles
category = "subshuttles"
ship_icon = "shuttle"
starting_funds = 0

/datum/map_template/shuttle/subshuttles/pill
Expand Down
1 change: 1 addition & 0 deletions code/modules/overmap/_overmap_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
var/token_type = /obj/overmap
/// The icon state the token will be set to on init.
var/token_icon_state = "object"
var/base_token_icon_state

/// The current docking ticket of this object, if any
var/datum/docking_ticket/current_docking_ticket
Expand Down
11 changes: 11 additions & 0 deletions code/modules/overmap/ships/controlled_ship_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@
/// Lazylist of /datum/ship_applications for this ship. Only used if join_mode == SHIP_JOIN_MODE_APPLY
var/list/datum/ship_application/applications

///The icon of the empty space we dock at
var/space_dock_icon

/// Short memo of the ship shown to new joins
var/memo = null
///Assoc list of remaining open job slots (job = remaining slots)
Expand Down Expand Up @@ -96,6 +99,11 @@
source_template = creation_template
unique_ship_access = source_template.unique_ship_access
job_slots = source_template.job_slots?.Copy()
if(source_template.ship_icon)
token_icon_state = source_template.ship_icon
base_token_icon_state = source_template.ship_icon
if(source_template.empty_space_icon)
space_dock_icon = source_template.empty_space_icon
if(create_shuttle)
shuttle_port = SSshuttle.load_template(creation_template, src)
if(!shuttle_port) //Loading failed, if the shuttle is supposed to be created, we need to delete ourselves.
Expand Down Expand Up @@ -203,6 +211,9 @@
if(!E)
E = new(list("x" = x, "y" = y))
if(E) //Don't make this an else
var/obj/overmap/token = E.token
if(space_dock_icon)
token.icon_state = space_dock_icon
Dock(E)

/datum/overmap/ship/controlled/burn_engines(percentage = 100, deltatime)
Expand Down
5 changes: 3 additions & 2 deletions code/modules/overmap/ships/ship_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
name = "overmap vessel"
char_rep = ">"
token_icon_state = "ship"
base_token_icon_state = "ship"
///Timer ID of the looping movement timer
var/movement_callback_id
///Max possible speed (1 tile per tick / 600 tiles per minute)
Expand Down Expand Up @@ -230,7 +231,7 @@
else if(direction & SOUTH)
char_rep = "v"
if(direction)
token.icon_state = "ship_moving"
token.icon_state = base_token_icon_state +"_moving"
token.dir = direction
else
token.icon_state = "ship"
token.icon_state = base_token_icon_state
Binary file modified icons/misc/overmap.dmi
Binary file not shown.
Loading