feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -90,6 +90,8 @@
<!-- Enable passthrough background during the splash screen -->
<meta-data android:name="com.oculus.ossplash.background" android:value="passthrough-contextual"/>
<meta-data android:name="com.oculus.handtracking.version" android:value="V2.0" />
</application>
</manifest>

View file

@ -41,7 +41,7 @@
<activity
android:name=".GodotEditor"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:exported="true"
android:icon="@mipmap/themed_icon"
android:launchMode="singleTask"
@ -59,7 +59,7 @@
</activity>
<activity
android:name=".GodotGame"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:exported="false"
android:icon="@mipmap/ic_play_window"
android:label="@string/godot_game_activity_name"
@ -74,7 +74,7 @@
</activity>
<activity
android:name=".embed.EmbeddedGodotGame"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:exported="false"
android:icon="@mipmap/ic_play_window"
android:label="@string/godot_game_activity_name"
@ -87,7 +87,7 @@
android:screenOrientation="userLandscape" />
<activity
android:name=".GodotXRGame"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:configChanges="layoutDirection|locale|orientation|keyboardHidden|screenSize|smallestScreenSize|density|keyboard|navigation|screenLayout|uiMode"
android:process=":GodotXRGame"
android:launchMode="singleTask"
android:icon="@mipmap/ic_play_window"

View file

@ -37,7 +37,11 @@ import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.os.*
import android.os.Build
import android.os.Bundle
import android.os.Debug
import android.os.Environment
import android.os.Process
import android.preference.PreferenceManager
import android.util.Log
import android.view.View
@ -138,6 +142,7 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
internal const val GAME_MENU_ACTION_RESET_CAMERA_2D_POSITION = "resetCamera2DPosition"
internal const val GAME_MENU_ACTION_RESET_CAMERA_3D_POSITION = "resetCamera3DPosition"
internal const val GAME_MENU_ACTION_EMBED_GAME_ON_PLAY = "embedGameOnPlay"
internal const val GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO = "setDebugMuteAudio"
private const val GAME_WORKSPACE = "Game"
@ -258,12 +263,14 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
super.onGodotSetupCompleted()
val longPressEnabled = enableLongPressGestures()
val panScaleEnabled = enablePanAndScaleGestures()
val overrideVolumeButtonsEnabled = overrideVolumeButtons()
runOnUiThread {
// Enable long press, panning and scaling gestures
godotFragment?.godot?.renderView?.inputHandler?.apply {
enableLongPress(longPressEnabled)
enablePanningAndScalingGestures(panScaleEnabled)
setOverrideVolumeButtons(overrideVolumeButtonsEnabled)
}
}
}
@ -482,12 +489,19 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
*/
protected open fun overrideOrientationRequest() = true
protected open fun overrideVolumeButtons() = false
/**
* Enable long press gestures for the Godot Android editor.
*/
protected open fun enableLongPressGestures() =
java.lang.Boolean.parseBoolean(GodotLib.getEditorSetting("interface/touchscreen/enable_long_press_as_right_click"))
/**
* Disable scroll deadzone for the Godot Android editor.
*/
protected open fun disableScrollDeadzone() = true
/**
* Enable pan and scale gestures for the Godot Android editor.
*/
@ -749,6 +763,10 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
val embedded = actionData.getBoolean(KEY_GAME_MENU_ACTION_PARAM1)
embedGameOnPlay(embedded)
}
GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO -> {
val enabled = actionData.getBoolean(KEY_GAME_MENU_ACTION_PARAM1)
muteAudio(enabled)
}
}
}
@ -812,6 +830,13 @@ abstract class BaseGodotEditor : GodotActivity(), GameMenuFragment.GameMenuListe
}
}
override fun muteAudio(enabled: Boolean) {
gameMenuState.putBoolean(GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO, enabled)
godot?.runOnRenderThread {
GameMenuUtils.setDebugMuteAudio(enabled)
}
}
override fun embedGameOnPlay(embedded: Boolean) {
gameMenuState.putBoolean(GAME_MENU_ACTION_EMBED_GAME_ON_PLAY, embedded)
godot?.runOnRenderThread {

View file

@ -46,10 +46,14 @@ abstract class BaseGodotGame: GodotEditor() {
private val TAG = BaseGodotGame::class.java.simpleName
}
override fun overrideVolumeButtons() = java.lang.Boolean.parseBoolean(GodotLib.getGlobal("input_devices/pointing/android/override_volume_buttons"))
override fun enableLongPressGestures() = java.lang.Boolean.parseBoolean(GodotLib.getGlobal("input_devices/pointing/android/enable_long_press_as_right_click"))
override fun enablePanAndScaleGestures() = java.lang.Boolean.parseBoolean(GodotLib.getGlobal("input_devices/pointing/android/enable_pan_and_scale_gestures"))
override fun disableScrollDeadzone() = java.lang.Boolean.parseBoolean(GodotLib.getGlobal("input_devices/pointing/android/disable_scroll_deadzone"))
override fun onGodotSetupCompleted() {
super.onGodotSetupCompleted()
Log.v(TAG, "OnGodotSetupCompleted")

View file

@ -206,6 +206,14 @@ open class GodotGame : BaseGodotGame() {
editorMessageDispatcher.dispatchGameMenuAction(EDITOR_MAIN_INFO, actionBundle)
}
override fun muteAudio(enabled: Boolean) {
val actionBundle = Bundle().apply {
putString(KEY_GAME_MENU_ACTION, GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO)
putBoolean(KEY_GAME_MENU_ACTION_PARAM1, enabled)
}
editorMessageDispatcher.dispatchGameMenuAction(EDITOR_MAIN_INFO, actionBundle)
}
override fun embedGameOnPlay(embedded: Boolean) {
val actionBundle = Bundle().apply {
putString(KEY_GAME_MENU_ACTION, GAME_MENU_ACTION_EMBED_GAME_ON_PLAY)

View file

@ -101,6 +101,7 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
fun reset2DCamera()
fun reset3DCamera()
fun manipulateCamera(mode: CameraMode)
fun muteAudio(enabled: Boolean)
fun isGameEmbeddingSupported(): Boolean
fun embedGameOnPlay(embedded: Boolean)
@ -148,6 +149,9 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
private val listSelectButton: RadioButton? by lazy {
view?.findViewById(R.id.game_menu_list_select_button)
}
private val audioMuteButton: View? by lazy {
view?.findViewById(R.id.game_menu_audio_mute_button)
}
private val optionsButton: View? by lazy {
view?.findViewById(R.id.game_menu_options_button)
}
@ -319,6 +323,13 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
}
}
}
audioMuteButton?.apply{
setOnClickListener {
val isActivated = !it.isActivated
menuListener?.muteAudio(isActivated)
it.isActivated = isActivated
}
}
optionsButton?.setOnClickListener {
popupMenu.show()
}
@ -351,6 +362,8 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
toolSelectButton?.isChecked = selectMode == GameMenuListener.SelectMode.SINGLE
listSelectButton?.isChecked = selectMode == GameMenuListener.SelectMode.LIST
audioMuteButton?.isActivated = gameMenuState.getBoolean(BaseGodotEditor.GAME_MENU_ACTION_SET_DEBUG_MUTE_AUDIO, false)
popupMenu.menu.apply {
if (menuListener?.isGameEmbeddingSupported() == false) {
setGroupEnabled(R.id.group_menu_embed_options, false)

View file

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="2.4"
android:viewportHeight="2.4">
<path
android:pathData="M1.252 0.15 a0.1 0.1 0 0 0-0.082 0.03 L0.6 0.75 H0.318C0.225 0.75 0.15 0.817 0.15 0.9 v0.6c0 0.083 0.075 0.15 0.168 0.15H0.6l0.57 0.57 c0.066 0.067 0.18 0.02 0.18-0.074V0.256A0.106 0.106 0 0 0 1.252 0.15"
android:fillColor="@color/game_menu_icons_color_state"/>
<path
android:strokeWidth=".165"
android:strokeLineCap="round"
android:pathData="M1.575 0.675 c0.45 0.525 0 1.05 0 1.05m0.3-1.35c0.675 0.825 0 1.65 0 1.65"
android:strokeColor="@color/game_menu_icons_color_state"/>
</vector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/audio_player_muted" android:state_activated="true" />
<item android:drawable="@drawable/audio_player" />
</selector>

View file

@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportWidth="2.4"
android:viewportHeight="2.4">
<path
android:pathData="M 1.2518555 0.15 A 0.1 0.1 0 0 0 1.1701172 0.17988281 L 0.6 0.75 L 0.31787109 0.75 C 0.22487119 0.75 0.15 0.81700008 0.15 0.9 L 0.15 1.5 C 0.15 1.5424221 0.16969512 1.5805593 0.20126953 1.6078125 L 1.35 0.45527344 L 1.35 0.25605469 A 0.106 0.106 0 0 0 1.2518555 0.15 z M 1.35 1.6438477 L 0.97236328 2.0223633 L 1.1701172 2.2201172 C 1.2361171 2.2871171 1.35 2.239996 1.35 2.1459961 L 1.35 1.6438477 z"
android:fillColor="@color/game_menu_icons_color_state"/>
<path
android:pathData="M 2.1984375 0.79306641 L 2.0660156 0.92578125 C 2.1142629 1.1320246 2.0935608 1.3239034 2.0487305 1.4882812 C 1.9692536 1.7796963 1.8105469 1.9725586 1.8105469 1.9725586 A 0.0825 0.0825 0 0 0 1.8222656 2.0879883 A 0.0825 0.0825 0 0 0 1.9394531 2.0780273 C 1.9394531 2.0780273 2.1176607 1.8586814 2.2069336 1.5313477 C 2.2638362 1.3227069 2.2834498 1.0648044 2.1984375 0.79306641 z M 1.8539062 1.1384766 L 1.6790039 1.3136719 C 1.6747238 1.3346601 1.6697313 1.3550615 1.6640625 1.3749023 C 1.6131343 1.5531513 1.5117188 1.6719727 1.5117187 1.6719727 A 0.0825 0.0825 0 0 0 1.5213867 1.7871094 A 0.0825 0.0825 0 0 0 1.6368164 1.7791992 C 1.6368164 1.7791992 1.7606941 1.6355198 1.8222656 1.4200195 C 1.8460259 1.3368593 1.8597024 1.2410136 1.8539062 1.1384766 z"
android:fillColor="@color/game_menu_icons_color_state"/>
<path
android:pathData="M0.08295 2.0529 2.0502 0.07965 2.31705 0.34725 0.34965 2.32035ZM-1.2804596 3.0939027 3.0879072-1.2877874Z"
android:fillColor="#fc7f7f"/>
</vector>

View file

@ -128,6 +128,15 @@
android:drawableStart="@drawable/list_select"
android:padding="15dp" />
</RadioGroup>
<ImageButton
android:id="@+id/game_menu_audio_mute_button"
style="?android:attr/borderlessButtonStyle"
android:layout_width="48dp"
android:layout_height="48dp"
android:background="@drawable/game_menu_button_bg"
android:src="@drawable/audio_player_icon_selector" />
</LinearLayout>
</HorizontalScrollView>