Skip to content

Commit

Permalink
Updates TGUI and adds bin folder for .bat scripts (shiptest-ss13#2011)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Updates TGUI and build tools and .vscode files to what TG has.
Does not actually update UI's, but does have fixes for a couple
including the join game UI's tabs not working.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
Not needing to have a local installation of yarn to run dev-mode is
nice.
Updating TGUI is a annoying chore that helps in the future when porting
more interfaces
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
code: Adds a bin folder with dev scripts, updates TGUI, .vscode folder
to what TG has.
fix: Fixes the input in the bottom right being white in darkmode, no
more unreadable text
fix: You can now use the tab buttons in the join ship menu.
qol: The outpost mission menu now looks a whole lot better
fix: The input bar no longer randomly becomes white and unreadable on
darkmode
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Co-authored-by: Mark Suckerberg <[email protected]>
  • Loading branch information
Arturlang and MarkSuckerberg authored Jun 19, 2023
1 parent dd1f554 commit 8744738
Show file tree
Hide file tree
Showing 214 changed files with 10,198 additions and 9,357 deletions.
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"EditorConfig.EditorConfig",
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"stylemistake.auto-comment-blocks",
"Donkie.vscode-tgstation-test-adapter",
"anturk.dmi-editor",
"esbenp.prettier-vscode"
]
Expand Down
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
"preLaunchTask": "Build All",
"dmb": "${workspaceFolder}/${command:CurrentDMB}",
"dreamDaemon": true
},
{
"name": "Debug External Libraries",
"type": "cppvsdbg",
"request": "launch",
"program": "${command:dreammaker.returnDreamDaemonPath}",
"cwd": "${workspaceRoot}",
"args": [
"${command:dreammaker.getFilenameDmb}",
"-trusted"
],
"preLaunchTask": "Build All"
}
]
}
84 changes: 75 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
"windows": {
"command": ".\\tools\\build\\build.bat"
},
"problemMatcher": ["$dreammaker", "$eslint-stylish"],
"options": {
"env": {
"DM_EXE": "${config:dreammaker.byondPath}"
}
},
"problemMatcher": [
"$dreammaker",
"$tsc",
"$eslint-stylish"
],
"group": {
"kind": "build",
"isDefault": true
Expand All @@ -17,25 +26,82 @@
},
{
"type": "dreammaker",
"dme": "shiptest.dme",
"problemMatcher": ["$dreammaker"],
"dme": "tgstation.dme",
"problemMatcher": [
"$dreammaker"
],
"group": "build",
"label": "dm: build - tgstation.dme"
},
{
"command": "${command:dreammaker.reparse}",
"group": "build",
"label": "dm: build - shiptest.dme"
"label": "dm: reparse"
},
{
"type": "shell",
"command": "tgui/bin/tgui",
"command": "bin/tgui-build",
"windows": {
"command": ".\\tgui\\bin\\tgui.bat"
"command": ".\\bin\\tgui-build.cmd"
},
"problemMatcher": ["$eslint-stylish"],
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: build"
},
{
"command": "${command:dreammaker.reparse}",
"type": "shell",
"command": "bin/tgui-dev",
"windows": {
"command": ".\\bin\\tgui-dev.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "dm: reparse"
"label": "tgui: dev server"
},
{
"type": "shell",
"command": "bin/tgui-bench",
"windows": {
"command": ".\\bin\\tgui-bench.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: bench"
},
{
"type": "shell",
"command": "bin/tgui-sonar",
"windows": {
"command": ".\\bin\\tgui-sonar.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: sonar"
},
{
"type": "shell",
"command": "bin/tgfont",
"windows": {
"command": ".\\bin\\tgfont.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: rebuild tgfont"
}
]
}
2 changes: 2 additions & 0 deletions bin/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error build %*
2 changes: 2 additions & 0 deletions bin/clean.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error clean-all %*
2 changes: 2 additions & 0 deletions bin/server.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error server %*
2 changes: 2 additions & 0 deletions bin/test.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error dm-test %*
2 changes: 2 additions & 0 deletions bin/tgfont.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tg-font %*
3 changes: 3 additions & 0 deletions bin/tgui-bench.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tgui-bench %*
pause
2 changes: 2 additions & 0 deletions bin/tgui-build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tgui tgui-lint tgui-test %*
2 changes: 2 additions & 0 deletions bin/tgui-dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tgui-dev %*
2 changes: 2 additions & 0 deletions bin/tgui-sonar.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tgui-sonar %*
6 changes: 3 additions & 3 deletions code/controllers/subsystem/input.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ SUBSYSTEM_DEF(input)

default_macro_sets = list(
"default" = list( //Locked Any. Reduced tab support. [Hotkey]
"Tab" = "\".winset \\\"input.focus=true?map.focus=true input.background-color=[COLOR_INPUT_DISABLED]:input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"Tab" = "\".winset \\\"input.focus=true ? map.focus=true : input.focus=true\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
"Escape" = "Reset-Held-Keys",
),
"old_default" = list( //Unlocked Bar. Respects oldmode_keys whitelist. Full tab support. [Default]
"Tab" = "\".winset \\\"mainwindow.macro=old_hotkeys map.focus=true input.background-color=[COLOR_INPUT_DISABLED]\\\"\"",
"Tab" = "\".winset \\\"mainwindow.macro=old_hotkeys map.focus=true\\\"\"",
"Ctrl+Escape" = "Reset-Held-Keys", //Small concession for the safety net.
),
"old_hotkeys" = list( //Unlocked Any. Supports clean switch back to unlocked. [Default]
"Tab" = "\".winset \\\"mainwindow.macro=old_default input.focus=true input.background-color=[COLOR_INPUT_ENABLED]\\\"\"",
"Tab" = "\".winset \\\"mainwindow.macro=old_default input.focus=true\\\"\"",
"Back" = "\".winset \\\"input.text=\\\"\\\"\\\"\"", // This makes it so backspace can remove default inputs
"Any" = "\"KeyDown \[\[*\]\]\"",
"Any+UP" = "\"KeyUp \[\[*\]\]\"",
Expand Down
18 changes: 11 additions & 7 deletions code/modules/admin/verbs/selectequipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,7 @@

/datum/select_equipment/ui_data(mob/user)
var/list/data = list()
if(!dummy_key)
init_dummy()

var/icon/dummysprite = get_flat_human_icon(null,
dummy_key = dummy_key,
outfit_override = selected_outfit)
data["icon64"] = icon2base64(dummysprite)
data["name"] = target_mob

var/datum/preferences/prefs = user?.client?.prefs
Expand All @@ -129,6 +123,15 @@

/datum/select_equipment/ui_static_data(mob/user)
var/list/data = list()
if(!dummy_key)
init_dummy()
var/icon/dummysprite = get_flat_human_icon(
null,
dummy_key = dummy_key,
outfit_override = selected_outfit
)
data["icon64"] = icon2base64(dummysprite)

if(!cached_outfits)
cached_outfits = list()
cached_outfits += list(outfit_entry("General", /datum/outfit, "Naked", priority=TRUE))
Expand All @@ -152,7 +155,7 @@
return custom_outfit


/datum/select_equipment/ui_act(action, params)
/datum/select_equipment/ui_act(action, params, ui)
if(..())
return
. = TRUE
Expand All @@ -171,6 +174,7 @@
return

selected_outfit = new_outfit
update_static_data(user, ui)

if("applyoutfit")
var/datum/outfit/new_outfit = resolve_outfit(params["path"])
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cargo/expressconsole.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
/obj/machinery/computer/cargo/express/ui_interact(mob/living/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "OutpostComms", name)
ui = new(user, src, "OutpostCommunications", name)
ui.open()
if(!charge_account)
reconnect()
Expand All @@ -127,7 +127,7 @@
data["outpostDocked"] = outpost_docked
data["points"] = charge_account ? charge_account.account_balance : 0
data["siliconUser"] = user.has_unlimited_silicon_privilege && check_ship_ai_access(user)
data["beaconzone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui
data["beaconZone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui
data["usingBeacon"] = use_beacon //is the mode set to deliver to the beacon or the cargobay?
data["canBeacon"] = !use_beacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location?
data["canBuyBeacon"] = charge_account ? (cooldown <= 0 && charge_account.account_balance >= BEACON_COST) : FALSE
Expand Down
8 changes: 3 additions & 5 deletions code/modules/client/client_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
return

if (prefs.hotkeys)
// If hotkey mode is enabled, then clicking the map will automatically
// unfocus the text bar. This removes the red color from the text bar
// so that the visual focus indicator matches reality.
winset(src, null, "input.background-color=[COLOR_INPUT_DISABLED]")

winset(src, null, "input.focus=false")
else
winset(src, null, "input.focus=true")
..()

/client/proc/add_verbs_from_config()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/keybindings/setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
window.set_mouse_macro()

if(prefs?.hotkeys)//tg put hotkeys at the client level, idk why, we still have it on prefs so I'm just gonna nullcheck this.
winset(src, null, "map.focus=true input.background-color=[COLOR_INPUT_DISABLED] mainwindow.macro=default")
winset(src, null, "map.focus=true mainwindow.macro=default")
else
winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=old_default")
winset(src, null, "input.focus=true mainwindow.macro=old_default")

update_special_keybinds()
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
for(var/id in environment.get_gases())
var/gas_level = environment.get_moles(id)/total_moles
if(gas_level > 0)
airlist += list(list("name" = "[GLOB.gas_data.names[id]]", "percentage" = round(gas_level*100, 0.01)))
airlist += list(list("name" = "[GLOB.gas_data.names[id]]", "percentage" = round(gas_level*100, 0.01), "id" = id))
data["AirData"] = airlist
return data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@
for(var/gasid in air.get_gases())
gasdata.Add(list(list(
"name"= GLOB.gas_data.names[gasid],
"amount" = round(100*air.get_moles(gasid)/air.total_moles(),0.01))))
"amount" = round(100*air.get_moles(gasid)/air.total_moles(),0.01),
"id" = gasid
)))

else
for(var/gasid in air.get_gases())
Expand Down
2 changes: 1 addition & 1 deletion code/modules/tgui/external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*
* required user mob The mob interacting with the UI.
*
* return list Statuic Data to be sent to the UI.
* return list Static Data to be sent to the UI.
*/
/datum/proc/ui_static_data(mob/user)
return list()
Expand Down
3 changes: 1 addition & 2 deletions interface/skin.dmf
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,8 @@ window "outputwindow"
size = 517x20
anchor1 = 0,100
anchor2 = 100,100
background-color = #d3b5b5
is-default = true
border = sunken
border = line
saved-params = "command"
elem "saybutton"
type = BUTTON
Expand Down
5 changes: 5 additions & 0 deletions tgui/.prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
arrowParens: always
endOfLine: lf
jsxBracketSameLine: true
jsxSingleQuote: false
printWidth: 80
proseWrap: preserve
Expand All @@ -9,3 +10,7 @@ singleQuote: true
tabWidth: 2
trailingComma: es5
useTabs: false
# PrettierX config, currently unused
# importFormatting: oneline
# offsetTernaryExpressions: true
# breakLongMethodChains: true
Loading

0 comments on commit 8744738

Please sign in to comment.