Skip to content

Commit

Permalink
NanoUI is now 'tgui'
Browse files Browse the repository at this point in the history
  • Loading branch information
neersighted committed Jan 1, 2016
1 parent f5e42db commit a2bb279
Show file tree
Hide file tree
Showing 146 changed files with 548 additions and 1,709 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ env:

cache:
directories:
- nano/node_modules
- tgui/node_modules
- $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}


Expand All @@ -39,7 +39,7 @@ install:
- pip install --user beautifulsoup4 -q

before_script:
- cd nano && npm install && cd ..
- cd tgui && npm install && cd ..
- chmod +x ./install-byond.sh
- ./install-byond.sh

Expand All @@ -48,7 +48,7 @@ script:
- (! grep 'step_[xy]' _maps/**/*.dmm)
- md5sum -c - <<< "49bc6b1b9ed56c83cceb6674bd97cb34 *html/changelogs/example.yml"
- tools/check_filedirs.sh tgstation.dme
- cd nano && gulp && gulp --min && cd ..
- cd tgui && gulp && cd ..
- python tools/ss13_genchangelog.py html/changelog.html html/changelogs
- source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup
- bash dm.sh -M${DM_MAPFILE} tgstation.dme
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/components/binary_devices/passive_gate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ Passive gate is similar to the regular pump except:
if(stat & (BROKEN|NOPOWER)) return
ui_interact(user)

/obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "atmos_pump", name, 400, 115)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/components/binary_devices/pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Thus, the two variables affect pump operation are set in New():
return
ui_interact(user)

/obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "atmos_pump", name, 400, 115)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/components/binary_devices/volume_pump.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ Thus, the two variables affect pump operation are set in New():
return
ui_interact(user)

/obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "atmos_pump", name, 400, 115)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/components/trinary_devices/filter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ Filter types:
return
ui_interact(user)

/obj/machinery/atmospherics/components/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/atmospherics/components/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "atmos_filter", name, 450, 145)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/components/trinary_devices/mixer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
return
ui_interact(user)

/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "atmos_mixer", name, 450, 175)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/ATMOSPHERICS/components/unary_devices/cryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@
return
ui_interact(user)

/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "cryo", name, 410, 550, state = notcontained_state)
ui.open()
Expand Down
15 changes: 0 additions & 15 deletions code/__DEFINES/nano.dm

This file was deleted.

4 changes: 4 additions & 0 deletions code/__DEFINES/tgui.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#define UI_INTERACTIVE 2 // Green/Interactive
#define UI_UPDATE 1 // Orange/Updates Only
#define UI_DISABLED 0 // Red/Disabled
#define UI_CLOSE -1 // Closed
30 changes: 0 additions & 30 deletions code/controllers/subsystem/nano.dm

This file was deleted.

30 changes: 30 additions & 0 deletions code/controllers/subsystem/tgui.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
var/datum/subsystem/tgui/SStgui

/datum/subsystem/tgui
name = "tgui"
wait = 10
priority = 16
display = 6

can_fire = 1 // This needs to fire before round start.

var/list/open_uis = list() // A list of open UIs, grouped by src_object and ui_key.
var/list/processing_uis = list() // A list of processing UIs, not grouped.
var/html // The HTML template used by new UIs; minus initial data.


/datum/subsystem/tgui/New()
html = file2text('tgui/tgui.html') // Read the HTML from disk.

NEW_SS_GLOBAL(SStgui)

/datum/subsystem/tgui/stat_entry()
..("O:[open_uis.len]|P:[processing_uis.len]") // Show how many interfaces we have open/are processing.

/datum/subsystem/tgui/fire() // Process UIs.
for(var/thing in processing_uis)
var/datum/tgui/ui = thing
if(ui && ui.user && ui.src_object)
ui.process()
continue
processing_uis.Remove(ui)
5 changes: 2 additions & 3 deletions code/datums/mind.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/datum/mind/proc/transfer_to(mob/new_character)
if(current) // remove ourself from our old body's mind variable
current.mind = null
SSnano.on_transfer(current, new_character)
SStgui.on_transfer(current, new_character)

if(key)
if(new_character.key != key) //if we're transfering into a body with a key associated which is not ours
Expand Down Expand Up @@ -1576,5 +1576,4 @@
/mob/living/simple_animal/hostile/construct/mind_initialize()
..()
mind.assigned_role = "[initial(name)]"
mind.special_role = "Cultist"

mind.special_role = "Cultist"
4 changes: 2 additions & 2 deletions code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
else if (!shorted)
ui_interact(user)

/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/alarm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "air_alarm", name, 480, 660)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/atmoalter/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ update_flag
return
ui_interact(user)

/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "canister", name, 480, 420, state = physical_state)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/airlock_electronics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
add_fingerprint(user)
ui_interact(user)

/obj/item/weapon/electronics/airlock/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0)
SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/item/weapon/electronics/airlock/ui_interact(mob/user, ui_key = "main", var/datum/tgui/ui = null, force_open = 0)
SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "airlock_electronics", name, 975, 415, state = hands_state)
ui.open()
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/spaceheater.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
C.add_fingerprint(usr)

user.visible_message("\The [user] inserts a power cell into \the [src].", "<span class='notice'>You insert the power cell into \the [src].</span>")
SSnano.update_uis(src)
SStgui.update_uis(src)
else
user << "<span class='warning'>The hatch must be open to insert a power cell!</span>"
return
Expand All @@ -153,8 +153,8 @@
/obj/machinery/space_heater/interact(mob/user)
ui_interact(user)

/obj/machinery/space_heater/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/machinery/space_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "space_heater", name, 490, 340, state = physical_state)
ui.open()
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/tanks/tanks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@
add_fingerprint(user)
ui_interact(user)

/obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, force_open = 0)
ui = SSnano.try_update_ui(user, src, ui_key, ui, force_open = force_open)
/obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", var/datum/tgui/ui = null, force_open = 0)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open = force_open)
if (!ui)
ui = new(user, src, ui_key, "tanks", name, 530, 220, state = inventory_state)
ui.open()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/client/asset_cache.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ You can set verify to TRUE if you want send() to sleep until the client has the
//DEFINITIONS FOR ASSET DATUMS START HERE.


/datum/asset/simple/nanoui
/datum/asset/simple/tgui
assets = list(
"nanoui.css" = 'nano/assets/nanoui.css',
"nanoui.js" = 'nano/assets/nanoui.js'
"tgui.css" = 'tgui/assets/tgui.css',
"tgui.js" = 'tgui/assets/tgui.js'
)

/datum/asset/simple/pda
Expand Down
8 changes: 4 additions & 4 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var/list/preferences_datums = list()


var/UI_style = "Midnight"
var/nanoui_fancy = TRUE
var/tgui_fancy = TRUE
var/toggles = TOGGLES_DEFAULT
var/chat_toggles = TOGGLES_DEFAULT_CHAT
var/ghost_form = "ghost"
Expand Down Expand Up @@ -325,7 +325,7 @@ var/list/preferences_datums = list()
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
dat += "<h2>General Settings</h2>"
dat += "<b>UI Style:</b> <a href='?_src_=prefs;preference=ui'>[UI_style]</a><br>"
dat += "<b>Fancy NanoUI:</b> <a href='?_src_=prefs;preference=nanoui'>[(nanoui_fancy) ? "Yes" : "No"]</a><br>"
dat += "<b>tgui Style:</b> <a href='?_src_=prefs;preference=tgui_fancy'>[(tgui_fancy) ? "Fancy" : "No Frills"]</a><br>"
dat += "<b>Play admin midis:</b> <a href='?_src_=prefs;preference=hear_midis'>[(toggles & SOUND_MIDI) ? "Yes" : "No"]</a><br>"
dat += "<b>Play lobby music:</b> <a href='?_src_=prefs;preference=lobby_music'>[(toggles & SOUND_LOBBY) ? "Yes" : "No"]</a><br>"
dat += "<b>Ghost ears:</b> <a href='?_src_=prefs;preference=ghost_ears'>[(chat_toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]</a><br>"
Expand Down Expand Up @@ -1011,8 +1011,8 @@ var/list/preferences_datums = list()
else
UI_style = "Midnight"

if("nanoui")
nanoui_fancy = !nanoui_fancy
if("tgui_fancy")
tgui_fancy = !tgui_fancy

if("hear_adminhelps")
toggles ^= SOUND_ADMINHELP
Expand Down
6 changes: 3 additions & 3 deletions code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["ooccolor"] >> ooccolor
S["lastchangelog"] >> lastchangelog
S["UI_style"] >> UI_style
S["nanoui_fancy"] >> nanoui_fancy
S["nanoui_fancy"] >> tgui_fancy
S["be_special"] >> be_special

if(islist(S["be_special"]))
Expand Down Expand Up @@ -193,7 +193,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
ooccolor = sanitize_ooccolor(sanitize_hexcolor(ooccolor, 6, 1, initial(ooccolor)))
lastchangelog = sanitize_text(lastchangelog, initial(lastchangelog))
UI_style = sanitize_inlist(UI_style, list("Midnight", "Plasmafire", "Retro"), initial(UI_style))
nanoui_fancy = sanitize_integer(nanoui_fancy, 0, 1, initial(nanoui_fancy))
tgui_fancy = sanitize_integer(tgui_fancy, 0, 1, initial(tgui_fancy))
default_slot = sanitize_integer(default_slot, 1, max_save_slots, initial(default_slot))
toggles = sanitize_integer(toggles, 0, 65535, initial(toggles))
ghost_form = sanitize_inlist(ghost_form, ghost_forms, initial(ghost_form))
Expand All @@ -213,7 +213,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["ooccolor"] << ooccolor
S["lastchangelog"] << lastchangelog
S["UI_style"] << UI_style
S["nanoui_fancy"] << nanoui_fancy
S["nanoui_fancy"] << tgui_fancy
S["be_special"] << be_special
S["default_slot"] << default_slot
S["toggles"] << toggles
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/dead/observer/observer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Works together with spawning an observer, noted above.
if(key)
if(!cmptext(copytext(key,1,2),"@")) // Skip aghosts.
var/mob/dead/observer/ghost = new(src) // Transfer safety to observer spawning proc.
SSnano.on_transfer(src, ghost) // Transfer NanoUIs.
SStgui.on_transfer(src, ghost) // Transfer NanoUIs.
ghost.can_reenter_corpse = can_reenter_corpse
ghost.key = key
return ghost
Expand Down Expand Up @@ -156,7 +156,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(mind.current.key && copytext(mind.current.key,1,2)!="@") //makes sure we don't accidentally kick any clients
usr << "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>"
return
SSnano.on_transfer(src, mind.current) // Transfer NanoUIs.
SStgui.on_transfer(src, mind.current) // Transfer NanoUIs.
mind.current.key = key
return 1

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/logout.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/mob/Logout()
SSnano.on_logout(src)
SStgui.on_logout(src)
player_list -= src
log_access("Logout: [key_name(src)]")
if(admin_datums[src.ckey])
Expand Down
12 changes: 0 additions & 12 deletions code/modules/nano/states/admin.dm

This file was deleted.

12 changes: 0 additions & 12 deletions code/modules/nano/states/conscious.dm

This file was deleted.

12 changes: 0 additions & 12 deletions code/modules/nano/states/contained.dm

This file was deleted.

Loading

0 comments on commit a2bb279

Please sign in to comment.