-
Notifications
You must be signed in to change notification settings - Fork 44
Add godots cli open command. #28
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
Conversation
64b8243 to
42e8052
Compare
src/main/cli_main.gd
Outdated
|
|
||
| if (parsed_args.size() >= 1): | ||
| if "open" in parsed_args: | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
src/main/main.gd
Outdated
| _exit() | ||
| else: | ||
| print("Run window mode") | ||
| add_child.call_deferred(windowMainScene.instantiate()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we don't need to preload it
add_child.call_deferred(load("res://src/main/window_main.tscn").instantiate())and remove line::3
const windowMainScene: PackedScene = preload("res://src/main/window_main.tscn")
src/services/local_editors.gd
Outdated
| for e in all(): | ||
| if (e.name.contains(name)): | ||
| return e; | ||
| return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove ;
src/services/local_editors.gd
Outdated
| func retrieve_by_name_pattern(name: String) -> LocalEditor: | ||
| for e in all(): | ||
| if (e.name.contains(name)): | ||
| return e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
;
src/services/local_editors.gd
Outdated
|
|
||
| func retrieve_by_name_pattern(name: String) -> LocalEditor: | ||
| for e in all(): | ||
| if (e.name.contains(name)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.name.findn(name) > -1should be better
src/services/local_editors.gd
Outdated
| tags_edited.emit() | ||
|
|
||
| func open(args: PackedStringArray): | ||
| print("Run editor with arguments: ", args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use
Output.push("Run editor with arguments: %s" % args)da0f241 to
3795cab
Compare
src/services/local_editors.gd
Outdated
|
|
||
| const dir = preload("res://src/extensions/dir.gd") | ||
|
|
||
| const mac_os_editor_path_postfix = "/Contents/MacOS/Godot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var mac_os_editor_path_postfix:
get: return _section.get_value("mac_os_editor_path_postfix", "/Contents/MacOS/Godot")
src/services/local_editors.gd
Outdated
| var pid = OS.create_process(process_args.path, process_args.args) | ||
|
|
||
| if (pid == -1): | ||
| Output.push('An array occured when create editor process') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'An array...' looks like a typo
e098469 to
09cc361
Compare
5de7a7f to
9296e87
Compare
|
@JillyMan, can you consider adding Godots cli argument Am not sure this proposal is in the scope of your commit ,however, any response will be appreciated |
Hi @SeremTitus I'm fine with this cli argument. Will do it in separate PR. |
Example of usage
Godots.exe --headless -open=4.1.1 -- --path "C:/Users/cli-godot-example" "C:/cli-godot-example/main.tscn" -- -game_arg true