Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Makes lua file upload work with bigger files and standardizes a few file|null #2579

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions code/modules/admin/verbs/lua/lua_editor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@
return
if(!check_rights_for(usr.client, R_DEBUG))
return
if(action == "runCodeFile")
params["code"] = file2text(input(usr, "Input File") as null|file)
if(isnull(params["code"]))
return
action = "runCode"
switch(action)
if("newState")
var/state_name = params["name"]
Expand Down
2 changes: 1 addition & 1 deletion code/modules/wiremod/core/duplicator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ GLOBAL_LIST_INIT(circuit_dupe_whitelisted_types, list(
var/txt
switch(option)
if("File")
txt = file2text(input(usr, "Input File") as file|null)
txt = file2text(input(usr, "Input File") as null|file)
if("Direct Input")
txt = input(usr, "Input JSON", "Input JSON") as text|null

Expand Down
9 changes: 1 addition & 8 deletions tgui/packages/tgui/interfaces/LuaEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,7 @@ export class LuaEditor extends Component {
title="Input"
buttons={
<>
<Button.File
onSelectFiles={(file) =>
this.setState({ scriptInput: file })
}
accept=".lua,.luau"
>
Import
</Button.File>
<Button onClick={() => act('runCodeFile')}>Import</Button>
<Button onClick={() => setModal('documentation')}>
Help
</Button>
Expand Down
Loading