Skip to content

Commit

Permalink
[READY] tgui-next: Initial PR, speedy new Air Alarm interface. (#46764)
Browse files Browse the repository at this point in the history
* Initial tgui-next commit

* Improve dev server, slight changes to layout.

* Add more components, fix dragging, finalize scrubber list

* Complete an air alarm interface.

* Multiple improvements based on feedback

- LabeledList now has a "buttons" prop, where you can put buttons.
- Improved Box and Flex components
- Whole UI is now dimmable if non-interactive
- Basic documentation of components (Box and Flex so far).
- Icon and Box now accept a "color" prop.
- Routing improved in "Layout" component, you can now specify whether an interface is scrollable.

* Less harsh dimming

* Redux, Toasts

- Fixed inconsistent backend updates with Redux.
- Added Toasts which are currently unused, but are functional.

* acclimator + ai airlock ui

* Add a progress bar component, implement resizing

* Fix a zero in title bar

* Add a linter to keep shit tidy, fix danger level mapping, add some more docs

* better ai door interact ui

* final ai airlock interface

* Fix issues with code, enforce hard 120 line length cap, automerge binaries

* Implement hot module reloading

* Fix progress bar, add color support

* Fix ProgressBar baseline alignment issues

* Remove unwanted padding on the bottom of the LabeledList.

* Component improvements

- Fix baseline issues with Button and ProgressBar components
- Box how inherits props from Box
- Atomic colors and Button colors are now auto-generated, all range of colors supported

* Chem Dispenser UI, animated numbers, more style fixes

* Add an IE8 polyfill

* Intermediate state of fixing IE8

* Lots of shimming and general misery

* Fully working old TGUI chainloader for IE8, more pipeline improvements

* Support title-less Sections

* Delete Yarn, use Lerna for workspace management

* Improve maths and animated numbers

* Fix loss of focus for scrollable content, activate buttons with keyboard

* Attempt to bust the cache, grab focus on keyboard presses too

* Fix hot module replacement by manually pulling replaced modules.

* backend logging

 un-nuke line endings

changes without insane line endings

* helper procs + href support

* slight optimization

* compiles

* Redux, Hotkeys, Kitchen Sink (for UI testing), Tabs component

* Push logs to backend, small kitchen sink changes, tab fixes

* Update component reference in README

* Small fixes

* Next bunch of IE8 fixes, PureComponent optimization for Inferno

* Delete old tgui html

* Log the event of loading the old tgui

* Enable tgui logging on server by default

* Final solution

* Extract routes into a separate file, fix ChemDispenser bug

- Chem dispenser was needlessly disabling transfer amount buttons

* Disable baseline alignment for vertical tabs

* Fix tabs and box units

- Tab content was not taking full page width
- Box can now accepts strings as units, which will be treated as raw style values.

* Fix tgui on Terry

* Fix sending all logs with an "error" flag

* Some macro UI component changes and improvements

- Refer to README.md diff to see what's new

* Tooltip component

* Add support for themes, nanotrasen logo is back

* Clockwork theme hotfix

* Slight adjustment to logo positioning

* Actually proper solution for logo positioning

* Fix color maps

* tgui-next thermomachine interface

* tgui-next canister interface

* Add icon_class_name proc to asset cache

* Lots of stuff backported from actioninja's repo

* Cleanup oopsies

* Cargo UI adjustments

* Nuke lodash

* Minor fixes and cleanup

- Remove local Inferno package in favor of upstream Inferno
- Fix "initial" prop on AnimatedNumber
- Force fancy=0 for IE8
- Click-through dimmer

* Add a bat file for dummies

* podlauncher interface fix

* Update README, assert code dominance

* Clarify usage of event handlers in Inferno

* Document LabeledList.Divider

* Fukken grammar

* fixes cellular emporium readapt button not working

* fixes incorrect action on button in atmos control interface

* remove unneeded data from airlock electronics ui

* Set +x mode on bin/tgui

* Fix filename cases

- They were untracked by git on windows

* Ignore package lock, make batch more robust

- package-lock.json is very random and unreliable as fuck. Yarn was better.

* Build tgui-next in travis

* bruh

- fixes tgui error reporting

* logging cleanup + always log
  • Loading branch information
stylemistake authored and AnturK committed Oct 15, 2019
1 parent c451d37 commit 5521c8e
Showing 134 changed files with 10,275 additions and 217 deletions.
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -71,6 +71,11 @@
/icons/ @ShizCalev
/sound/ @ShizCalev

# stylemistake

/tgui @stylemistake
/tgui-next @stylemistake

# Qustinnus
/code/datums/components/mood.dm @Qustinnus
/code/datums/mood_events/ @Qustinnus
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
"recommendations": [
"gbasood.byond-dm-language-support",
"platymuus.dm-langclient",
"EditorConfig.EditorConfig"
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint"
]
}
5 changes: 5 additions & 0 deletions code/__HELPERS/_logging.dm
Original file line number Diff line number Diff line change
@@ -187,6 +187,11 @@
/proc/log_mapping(text)
WRITE_LOG(GLOB.world_map_error_log, text)

/* ui logging */

/proc/log_tgui(text)
WRITE_LOG(GLOB.tgui_log, text)

/* For logging round startup. */
/proc/start_log(log)
WRITE_LOG(log, "Starting up round ID [GLOB.round_id].\n-------------------------")
2 changes: 2 additions & 0 deletions code/_globalvars/logging.dm
Original file line number Diff line number Diff line change
@@ -38,6 +38,8 @@ GLOBAL_VAR(world_map_error_log)
GLOBAL_PROTECT(world_map_error_log)
GLOBAL_VAR(world_paper_log)
GLOBAL_PROTECT(world_paper_log)
GLOBAL_VAR(tgui_log)
GLOBAL_PROTECT(tgui_log)

GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)
10 changes: 2 additions & 8 deletions code/_onclick/ai.dm
Original file line number Diff line number Diff line change
@@ -137,10 +137,7 @@
if(obj_flags & EMAGGED)
return

if(locked)
bolt_raise(usr)
else
bolt_drop(usr)
toggle_bolt(usr)
add_hiddenprint(usr)

/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
@@ -163,10 +160,7 @@
if(obj_flags & EMAGGED)
return

if(!emergency)
emergency_on(usr)
else
emergency_off(usr)
toggle_emergency(usr)
add_hiddenprint(usr)

/* APC */
3 changes: 1 addition & 2 deletions code/controllers/subsystem/tgui.dm
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(tgui)
var/basehtml // The HTML base used for all UIs.

/datum/controller/subsystem/tgui/PreInit()
basehtml = file2text('tgui/tgui.html')
basehtml = file2text('tgui-next/packages/tgui/public/tgui-main.html')

/datum/controller/subsystem/tgui/Shutdown()
close_all_uis()
@@ -34,4 +34,3 @@ SUBSYSTEM_DEF(tgui)
processing_uis.Remove(ui)
if (MC_TICK_CHECK)
return

2 changes: 1 addition & 1 deletion code/datums/wires/_wires.dm
Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if (!ui)
ui = new(user, src, ui_key, "wires", "[holder.name] wires", 350, 150 + wires.len * 30, master_ui, state)
ui = new(user, src, ui_key, "wires", "[holder.name] Wires", 350, 150 + wires.len * 30, master_ui, state)
ui.open()

/datum/wires/ui_data(mob/user)
131 changes: 26 additions & 105 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
@@ -1365,7 +1365,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "ai_airlock", name, 550, 456, master_ui, state)
ui = new(user, src, ui_key, "ai_airlock", name, 500, 390, master_ui, state)
ui.open()
return TRUE

@@ -1434,84 +1434,24 @@
if("shock-perm")
shock_perm(usr)
. = TRUE
if("idscan-on")
if(wires.is_cut(WIRE_IDSCAN))
to_chat(usr, "You can't enable IdScan - The IdScan wire has been cut.")
else if(aiDisabledIdScanner)
aiDisabledIdScanner = FALSE
else
to_chat(usr, "The IdScan feature is not disabled.")
. = TRUE
if("idscan-off")
if(wires.is_cut(WIRE_IDSCAN))
to_chat(usr, "The IdScan wire has been cut - So, you can't disable it, but it is already disabled anyways.")
else if(aiDisabledIdScanner)
to_chat(usr, "You've already disabled the IdScan feature.")
else
aiDisabledIdScanner = TRUE
. = TRUE
if("emergency-on")
emergency_on(usr)
. = TRUE
if("emergency-off")
emergency_off(usr)
. = TRUE
if("bolt-raise")
bolt_raise(usr)
. = TRUE
if("bolt-drop")
bolt_drop(usr)
. = TRUE
if("light-on")
if(wires.is_cut(WIRE_LIGHT))
to_chat(usr, "Control to door bolt lights has been severed.")
else if (!lights)
lights = TRUE
update_icon()
else
to_chat(usr, text("Door bolt lights are already enabled!"))
if("idscan-toggle")
aiDisabledIdScanner = !aiDisabledIdScanner
. = TRUE
if("light-off")
if(wires.is_cut(WIRE_LIGHT))
to_chat(usr, "Control to door bolt lights has been severed.")
else if (lights)
lights = FALSE
update_icon()
else
to_chat(usr, "Door bolt lights are already disabled!")
if("emergency-toggle")
toggle_emergency(usr)
. = TRUE
if("safe-on")
if(wires.is_cut(WIRE_SAFETY))
to_chat(usr, "Control to door sensors is disabled.")
else if (!safe)
safe = TRUE
else
to_chat(usr, "Firmware reports safeties already in place.")
if("bolt-toggle")
toggle_bolt(usr)
. = TRUE
if("safe-off")
if(wires.is_cut(WIRE_SAFETY))
to_chat(usr, "Control to door sensors is disabled.")
else if (safe)
safe = FALSE
else
to_chat(usr, "Firmware reports safeties already overridden.")
if("light-toggle")
lights = !lights
update_icon()
. = TRUE
if("speed-on")
if(wires.is_cut(WIRE_TIMING))
to_chat(usr, "Control to door timing circuitry has been severed.")
else if (!normalspeed)
normalspeed = 1
else
to_chat(usr,"Door timing circuitry currently operating normally.")
if("safe-toggle")
safe = !safe
. = TRUE
if("speed-off")
if(wires.is_cut(WIRE_TIMING))
to_chat(usr, "Control to door timing circuitry has been severed.")
else if (normalspeed)
normalspeed = 0
else
to_chat(usr, "Door timing circuitry already accelerated.")

if("speed-toggle")
normalspeed = !normalspeed
. = TRUE
if("open-close")
user_toggle_open(usr)
@@ -1544,44 +1484,25 @@
else
set_electrified(MACHINE_ELECTRIFIED_PERMANENT, user)

/obj/machinery/door/airlock/proc/emergency_on(mob/user)
if(!user_allowed(user))
return
if (!emergency)
emergency = TRUE
update_icon()
else
to_chat(user, "Emergency access is already enabled!")

/obj/machinery/door/airlock/proc/emergency_off(mob/user)
if(!user_allowed(user))
return
if (emergency)
emergency = FALSE
update_icon()
else
to_chat(user, "Emergency access is already disabled!")

/obj/machinery/door/airlock/proc/bolt_raise(mob/user)
/obj/machinery/door/airlock/proc/toggle_bolt(mob/user)
if(!user_allowed(user))
return
if(wires.is_cut(WIRE_BOLTS))
to_chat(user, "The door bolt drop wire is cut - you can't raise the door bolts")
else if(!locked)
to_chat(user, "The door bolts are already up")
else
if(hasPower())
unbolt()
to_chat(user, "<span class='warning'>The door bolt drop wire is cut - you can't toggle the door bolts.</span>")
return
if(locked)
if(!hasPower())
to_chat(user, "<span class='warning'>The door has no power - you can't raise the door bolts.</span>")
else
to_chat(user, "Cannot raise door bolts due to power failure")
unbolt()
else
bolt()

/obj/machinery/door/airlock/proc/bolt_drop(mob/user)
/obj/machinery/door/airlock/proc/toggle_emergency(mob/user)
if(!user_allowed(user))
return
if(wires.is_cut(WIRE_BOLTS))
to_chat(user, "You can't drop the door bolts - The door bolt dropping wire has been cut.")
else
bolt()
emergency = !emergency
update_icon()

/obj/machinery/door/airlock/proc/user_toggle_open(mob/user)
if(!user_allowed(user))
7 changes: 5 additions & 2 deletions code/game/machinery/doors/airlock_electronics.dm
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "airlock_electronics", name, 975, 420, master_ui, state)
ui = new(user, src, ui_key, "airlock_electronics", name, 420, 485, master_ui, state)
ui.open()

/obj/item/electronics/airlock/ui_data()
@@ -44,10 +44,13 @@
if(..())
return
switch(action)
if("clear")
if("clear_all")
accesses = list()
one_access = 0
. = TRUE
if("grant_all")
accesses = get_all_accesses()
. = TRUE
if("one_access")
one_access = !one_access
. = TRUE
2 changes: 1 addition & 1 deletion code/game/machinery/doors/brigdoors.dm
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@
maptext_width = 32
maptext_y = -1
ui_x = 300
ui_y = 200
ui_y = 138

/obj/machinery/door_timer/Initialize()
. = ..()
2 changes: 2 additions & 0 deletions code/game/world.dm
Original file line number Diff line number Diff line change
@@ -130,6 +130,7 @@ GLOBAL_VAR(restart_counter)
GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
GLOB.world_paper_log = "[GLOB.log_directory]/paper.log"
GLOB.tgui_log = "[GLOB.log_directory]/tgui.log"

#ifdef UNIT_TESTS
GLOB.test_log = file("[GLOB.log_directory]/tests.log")
@@ -144,6 +145,7 @@ GLOBAL_VAR(restart_counter)
start_log(GLOB.world_qdel_log)
start_log(GLOB.world_runtime_log)
start_log(GLOB.world_job_debug_log)
start_log(GLOB.tgui_log)

GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
if(fexists(GLOB.config_error_log))
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
pipe_state = "filter"

ui_x = 475
ui_y = 195
ui_y = 185

/obj/machinery/atmospherics/components/trinary/filter/CtrlClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
6 changes: 2 additions & 4 deletions code/modules/cargo/console.dm
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
desc = "Used to order supplies, approve requests, and control the shuttle."
icon_screen = "supply"
circuit = /obj/item/circuitboard/computer/cargo
ui_x = 750
ui_y = 850
ui_x = 780
ui_y = 750

var/requestonly = FALSE
var/contraband = FALSE
@@ -131,8 +131,6 @@
/obj/machinery/computer/cargo/ui_act(action, params, datum/tgui/ui)
if(..())
return
if(action != "add" && requestonly)
return
switch(action)
if("send")
if(!SSshuttle.supply.canMove())
22 changes: 20 additions & 2 deletions code/modules/client/asset_cache.dm
Original file line number Diff line number Diff line change
@@ -325,6 +325,13 @@ GLOBAL_LIST_EMPTY(asset_datums)
var/size_id = sprite[SPR_SIZE]
return {"<span class="[name][size_id] [sprite_name]"></span>"}

/datum/asset/spritesheet/proc/icon_class_name(sprite_name)
var/sprite = sprites[sprite_name]
if (!sprite)
return null
var/size_id = sprite[SPR_SIZE]
return {"[name][size_id] [sprite_name]"}

#undef SPR_SIZE
#undef SPR_IDX
#undef SPRSZ_COUNT
@@ -381,8 +388,19 @@ GLOBAL_LIST_EMPTY(asset_datums)

/datum/asset/simple/tgui
assets = list(
"tgui.css" = 'tgui/assets/tgui.css',
"tgui.js" = 'tgui/assets/tgui.js',
// tgui
"tgui.css" = 'tgui/assets/tgui.css',
"tgui.js" = 'tgui/assets/tgui.js',
// tgui-next
"tgui-main.html" = 'tgui-next/packages/tgui/public/tgui-main.html',
"tgui-fallback.html" = 'tgui-next/packages/tgui/public/tgui-fallback.html',
"tgui.bundle.js" = 'tgui-next/packages/tgui/public/bundles/tgui.bundle.js',
"tgui.bundle.css" = 'tgui-next/packages/tgui/public/bundles/tgui.bundle.css',
"shim-console.js" = 'tgui-next/packages/tgui/public/shim-console.js',
"shim-html5shiv.js" = 'tgui-next/packages/tgui/public/shim-html5shiv.js',
"shim-ie8.js" = 'tgui-next/packages/tgui/public/shim-ie8.js',
"shim-dom4.js" = 'tgui-next/packages/tgui/public/shim-dom4.js',
"shim-css-om.js" = 'tgui-next/packages/tgui/public/shim-css-om.js',
)

/datum/asset/group/tgui
8 changes: 3 additions & 5 deletions code/modules/plumbing/plumbers/acclimator.dm
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
///COOLING, HEATING or NEUTRAL. We track this for change, so we dont needlessly update our icon
var/acclimate_state

ui_x = 300
ui_x = 320
ui_y = 260

/obj/machinery/plumbing/acclimator/Initialize()
@@ -86,10 +86,8 @@
if("set_allowed_temperature_difference")
var/target = input("New acceptable difference:", name, allowed_temperature_difference) as num|null
allowed_temperature_difference = CLAMP(target, 0, 1000)
if("turn_on")
enabled = TRUE
if("turn_off")
enabled = FALSE
if("toggle_power")
enabled = !enabled
#undef COOLING
#undef HEATING
#undef NEUTRAL
4 changes: 2 additions & 2 deletions code/modules/power/apc.dm
Original file line number Diff line number Diff line change
@@ -57,8 +57,8 @@
damage_deflection = 10
resistance_flags = FIRE_PROOF
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON
ui_x = 535
ui_y = 515
ui_x = 450
ui_y = 460

var/lon_range = 1.5
var/area/area
Loading

0 comments on commit 5521c8e

Please sign in to comment.