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

Revert finalizing GodotHost#getCommandLine() public API #102669

Merged
merged 1 commit into from
Feb 11, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,12 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
}
}

@CallSuper
override fun updateCommandLineParams(args: Array<String>) {
val args = if (BuildConfig.BUILD_TYPE == "dev") {
args + "--benchmark"
} else {
args
override fun getCommandLine(): MutableList<String> {
val params = super.getCommandLine()
if (BuildConfig.BUILD_TYPE == "dev" && !params.contains("--benchmark")) {
params.add("--benchmark")
}
super.updateCommandLineParams(args);
return params
}

protected fun retrieveEditorWindowInfo(args: Array<String>, gameEmbedMode: GameEmbedMode): EditorWindowInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,16 @@ open class GodotXRGame: BaseGodotGame() {

override fun overrideOrientationRequest() = true

override fun updateCommandLineParams(args: Array<String>) {
val updatedArgs = ArrayList<String>()
if (!args.contains(XRMode.OPENXR.cmdLineArg)) {
override fun getCommandLine(): MutableList<String> {
val updatedArgs = super.getCommandLine()
if (!updatedArgs.contains(XRMode.OPENXR.cmdLineArg)) {
updatedArgs.add(XRMode.OPENXR.cmdLineArg)
}
if (!args.contains(XR_MODE_ARG)) {
if (!updatedArgs.contains(XR_MODE_ARG)) {
updatedArgs.add(XR_MODE_ARG)
updatedArgs.add("on")
}
updatedArgs.addAll(args)

super.updateCommandLineParams(updatedArgs.toTypedArray())
return updatedArgs
}

override fun getEditorWindowInfo() = XR_RUN_GAME_INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract class GodotActivity : FragmentActivity(), GodotHost {
override fun onCreate(savedInstanceState: Bundle?) {
val params = intent.getStringArrayExtra(EXTRA_COMMAND_LINE_PARAMS)
Log.d(TAG, "Starting intent $intent with parameters ${params.contentToString()}")
updateCommandLineParams(params ?: emptyArray())
commandLineParams.addAll(params ?: emptyArray())

super.onCreate(savedInstanceState)

Expand Down Expand Up @@ -215,14 +215,5 @@ abstract class GodotActivity : FragmentActivity(), GodotHost {
return GodotFragment()
}

@CallSuper
protected open fun updateCommandLineParams(args: Array<String>) {
// Update the list of command line params with the new args
commandLineParams.clear()
if (args.isNotEmpty()) {
commandLineParams.addAll(args)
}
}

final override fun getCommandLine() = commandLineParams
override fun getCommandLine(): MutableList<String> = commandLineParams
}