Skip to content

Commit

Permalink
examine
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Oct 12, 2024
1 parent 0fe0ed5 commit ede1794
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 12 deletions.
11 changes: 5 additions & 6 deletions code/modules/dynamic_missions/mission.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var/weight = 0 /// The relative probability of this mission being selected. 0-weight missions are never selected.

///Only needed if you have multipe missiosn that use the same poi's on the map
var/mission_name
var/mission_index

var/location_specific = TRUE
/// The outpost that issued this mission. Passed in New().
Expand Down Expand Up @@ -230,9 +230,9 @@
icon_state = "side_thing"
///Assume the item we want is included in the map and we simple have to return it
var/already_spawned = FALSE
///Only needed if you have multipe missiosn that use the same poi's on the map
var/mission_name
///Only used if we dont pass a type in the mission.
///Only needed if you have multipe missiosn that would otherwise use the same poi's
var/mission_index = null
///Prefered over the passed one, used for varediting primarly.
var/type_to_spawn

/obj/effect/landmark/mission_poi/Initialize()
Expand All @@ -245,8 +245,7 @@

/obj/effect/landmark/mission_poi/proc/use_poi(_type_to_spawn)
var/atom/item_of_intrest
//Only use the type_to_spawn we have if a type is not passed
if(ispath(_type_to_spawn))
if(!ispath(type_to_spawn))
type_to_spawn = _type_to_spawn
if(already_spawned) //Search for the item
for(var/atom/movable/item_in_poi as anything in get_turf(src))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/dynamic_missions/missions/guarded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/datum/mission/dynamic/guarded/spawn_mission_setpiece(datum/overmap/dynamic/planet)
for(var/obj/effect/landmark/mission_poi/mission_poi in planet.spawned_mission_pois)
if(mission_name && (mission_name != mission_poi.mission_name))
if(!isnull(mission_poi.mission_index) && (mission_index != mission_poi.mission_index))
continue
if((!required_item) && mission_poi.type == setpiece_poi)
//Spawns the item or gets it via use_poi then sets it as bound so the mission fails if its deleted
Expand Down
27 changes: 27 additions & 0 deletions code/modules/overmap/_overmap_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,3 +414,30 @@
dock_to_adjust.forceMove(locate(new_dock_location[1], new_dock_location[2], dock_to_adjust.z))
dock_to_adjust.dheight = new_dheight
dock_to_adjust.dwidth = new_dwidth

/obj/overmap/ui_status(mob/user, datum/ui_state/state)
return (ismob(user)) ? UI_INTERACTIVE : UI_CLOSE

/obj/overmap/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if (!ui)
ui = new(user, src, "OvermapExamine")
ui.open()

/obj/overmap/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return

/datum/overmap/ui_data(mob/user)
var/list/data = list()
data["ref"] = REF(src)
data["name"] = name
data["ascii"] = char_rep
data["dockedTo"] = docked_to
data["docked"] = list()
for(var/datum/overmap/docked in contents)
var/list/this = list()
this["ref"] = REF(src)
this["name"] = name
return data
4 changes: 4 additions & 0 deletions code/modules/overmap/overmap_token.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@
cam_background.icon_state = "clear"
cam_background.fill_rect(1, 1, size_x, size_y)
return TRUE

/obj/overmap/examine(mob/user)
. = ..()
parent.ui_interact(user)
4 changes: 2 additions & 2 deletions code/modules/tgui/external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* optional ui datum/tgui The UI to be updated, if it exists.
*/
/datum/proc/ui_interact(mob/user, datum/tgui/ui)
return FALSE // Not implemented.
return FALSE

/**
* public
Expand All @@ -28,7 +28,7 @@
* return list Data to be sent to the UI.
*/
/datum/proc/ui_data(mob/user)
return list() // Not implemented.
return list()

/**
* public
Expand Down
6 changes: 3 additions & 3 deletions config/game_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,12 +566,12 @@ ECONOMY
## Overmap Settings ##

## Put max amount of different event clusters you want to spawn here
MAX_OVERMAP_EVENT_CLUSTERS 6
MAX_OVERMAP_EVENT_CLUSTERS 10

## Put the maximum amount of overmap events here
MAX_OVERMAP_EVENTS 50
MAX_OVERMAP_EVENTS 250

## Put the maximum amount of dynamic overmap locations here
## Put the maximum amount of dynamic (runtime loaded) overmap locations here
MAX_OVERMAP_DYNAMIC_EVENTS 30

## Size of the overmap squared
Expand Down
18 changes: 18 additions & 0 deletions tgui/packages/tgui/interfaces/OvermapExamine/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { useBackend, useLocalState } from '../../backend';

import { Window } from '../../layouts';

export type OvermapData = {
name: string;
ascii: string;
};

export const OvermapExamine = (props, context) => {
const { act, data } = useBackend<OvermapData>(context);
const { name, ascii } = data;
return (
<Window title={name} width={350} height={700}>
<Window.Content scrollable>{ascii}</Window.Content>
</Window>
);
};

0 comments on commit ede1794

Please sign in to comment.