Skip to content

Commit

Permalink
Фикс проблем с интерфейсами (#2476)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeudeyTF authored Jul 15, 2024
1 parent 1fdb92b commit 06abfcc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
17 changes: 10 additions & 7 deletions code/controllers/subsystems/initialization/modpacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,22 @@ SUBSYSTEM_DEF(modpacks)
return

if(length(SSmodpacks.loaded_modpacks))
var/datum/nano_module/modlist/modlist_panel = locate("modlist_[usr.ckey]")
if(!modlist_panel)
modlist_panel = new /datum/nano_module/modlist(usr)
modlist_panel.tag = "modlist_[usr.ckey]"
modlist_panel.ui_interact(usr)
var/datum/nano_module/modlist/modlist_panel = new /datum/nano_module/modlist(mob)
modlist_panel.ui_interact(mob)
else
to_chat(src, SPAN_WARNING("Этот сервер не использует какие-либо модификации."))

GLOBAL_DATUM_INIT(modlist_state, /datum/topic_state/modlist, new)

/datum/topic_state/modlist/can_use_topic(src_object, mob/user)
return STATUS_INTERACTIVE

/datum/nano_module/modlist

/datum/nano_module/modlist/CanUseTopic(mob/user, datum/topic_state/state = GLOB.xeno_state)
/datum/nano_module/manifest/CanUseTopic(mob/user, datum/topic_state/state = GLOB.modlist_state)
. = ..()

/datum/nano_module/modlist/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.xeno_state)
/datum/nano_module/modlist/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.modlist_state)
var/data[0]
var/list/mods = list()
for(var/modpack in SSmodpacks.loaded_modpacks)
Expand All @@ -79,3 +81,4 @@ SUBSYSTEM_DEF(modpacks)
/datum/nano_module/modlist/Topic(href, href_list, state)
if(..())
return TRUE
return TRUE
2 changes: 0 additions & 2 deletions mods/_master_files/code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

return ..()

/mob/new_player/

/mob/new_player/ViewManifest()
var/datum/nano_module/manifest/ui = new /datum/nano_module/manifest(usr)
ui.ui_interact(usr)
4 changes: 2 additions & 2 deletions mods/_master_files/code/modules/mob/observer/ghost/ghost.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
set name = "Show Crew Manifest"
set category = "Ghost"

var/datum/nano_module/manifest/ui = new /datum/nano_module/manifest(usr)
var/datum/nano_module/manifest/ui = new /datum/nano_module/manifest(src)
ui.ooc = TRUE
ui.ui_interact(usr)
ui.ui_interact(src)
11 changes: 8 additions & 3 deletions mods/newUI/code/manifest.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
GLOBAL_DATUM_INIT(manifest_state, /datum/topic_state/manifest, new)

/datum/topic_state/manifest/can_use_topic(src_object, mob/user)
return STATUS_INTERACTIVE

/datum/nano_module/manifest
var/ooc = FALSE

/datum/nano_module/manifest/CanUseTopic(mob/user, datum/topic_state/state = GLOB.xeno_state)
/datum/nano_module/manifest/CanUseTopic(mob/user, datum/topic_state/state = GLOB.manifest_state)
. = ..()

/datum/nano_module/manifest/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.xeno_state)
/datum/nano_module/manifest/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1, datum/topic_state/state = GLOB.manifest_state)
var/data[0]

var/list/dept_data = list(
Expand Down Expand Up @@ -81,6 +86,6 @@
ui.open()
ui.set_auto_update(1)

/datum/nano_module/xenopanel/Topic(href, href_list, state)
/datum/nano_module/manifest/Topic(href, href_list, state)
if(..())
return TRUE

0 comments on commit 06abfcc

Please sign in to comment.