Przeglądaj źródła

Merge pull request #111204 from syntaxerror247/suspend-btn

Android Editor: Update suspend button icon in GameMenuBar
Thaddeus Crews 2 miesięcy temu
rodzic
commit
fa1c53bb8e

+ 4 - 4
platform/android/java/editor/src/main/java/org/godotengine/editor/embed/GameMenuFragment.kt

@@ -125,8 +125,8 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
 	private val collapseMenuButton: View? by lazy {
 		view?.findViewById(R.id.game_menu_collapse_button)
 	}
-	private val pauseButton: View? by lazy {
-		view?.findViewById(R.id.game_menu_pause_button)
+	private val suspendButton: View? by lazy {
+		view?.findViewById(R.id.game_menu_suspend_button)
 	}
 	private val nextFrameButton: View? by lazy {
 		view?.findViewById(R.id.game_menu_next_frame_button)
@@ -267,7 +267,7 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
 				menuListener?.closeGameWindow()
 			}
 		}
-		pauseButton?.apply {
+		suspendButton?.apply {
 			setOnClickListener {
 				val isActivated = !it.isActivated
 				menuListener?.suspendGame(isActivated)
@@ -348,7 +348,7 @@ class GameMenuFragment : Fragment(), PopupMenu.OnMenuItemClickListener {
 		isGameEmbedded = gameMenuState.getBoolean(BaseGodotEditor.EXTRA_IS_GAME_EMBEDDED, false)
 		isGameRunning = gameMenuState.getBoolean(BaseGodotEditor.EXTRA_IS_GAME_RUNNING, false)
 
-		pauseButton?.isEnabled = isGameRunning
+		suspendButton?.isEnabled = isGameRunning
 		nextFrameButton?.isEnabled = isGameRunning
 
 		val nodeType = gameMenuState.getSerializable(BaseGodotEditor.GAME_MENU_ACTION_SET_NODE_TYPE) as GameMenuListener.NodeType? ?: GameMenuListener.NodeType.NONE

+ 18 - 0
platform/android/java/editor/src/main/res/drawable/suspend.xml

@@ -0,0 +1,18 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="16dp"
+    android:height="16dp"
+    android:viewportWidth="16"
+    android:viewportHeight="16">
+  <path
+      android:pathData="m8,4h2v2h2V8H8Z"
+      android:fillColor="@color/game_menu_icons_color_state"/>
+  <path
+      android:pathData="M2.289,9L4.703,9A0.289,0.289 0,0 1,4.992 9.289L4.992,14.711A0.289,0.289 0,0 1,4.703 15L2.289,15A0.289,0.289 0,0 1,2 14.711L2,9.289A0.289,0.289 0,0 1,2.289 9z"
+      android:fillColor="@color/game_menu_icons_color_state"/>
+  <path
+      android:pathData="M6.289,9L8.711,9A0.289,0.289 0,0 1,9 9.289L9,14.711A0.289,0.289 0,0 1,8.711 15L6.289,15A0.289,0.289 0,0 1,6 14.711L6,9.289A0.289,0.289 0,0 1,6.289 9z"
+      android:fillColor="@color/game_menu_icons_color_state"/>
+  <path
+      android:pathData="M9,1A6,6 0,0 0,3 7A6,6 0,0 0,3.084 8L5.127,8A4,4 0,0 1,5 7A4,4 0,0 1,9 3A4,4 0,0 1,13 7A4,4 0,0 1,10 10.873L10,12.916A6,6 0,0 0,15 7A6,6 0,0 0,9 1z"
+      android:fillColor="@color/game_menu_icons_color_state"/>
+</vector>

+ 2 - 2
platform/android/java/editor/src/main/res/layout/game_menu_fragment_layout.xml

@@ -18,12 +18,12 @@
 			android:orientation="horizontal">
 
 			<ImageButton
-				android:id="@+id/game_menu_pause_button"
+				android:id="@+id/game_menu_suspend_button"
 				style="?android:attr/borderlessButtonStyle"
 				android:layout_width="48dp"
 				android:layout_height="48dp"
 				android:background="@drawable/game_menu_button_bg"
-				android:src="@drawable/pause_play_selector" />
+				android:src="@drawable/suspend" />
 
 			<ImageButton
 				android:id="@+id/game_menu_next_frame_button"