From b46c4917d4eff7cc64faef52b916e8a56f4b772c Mon Sep 17 00:00:00 2001 From: KreitinnSoftware Date: Fri, 30 Aug 2024 21:48:49 -0300 Subject: [PATCH] ObbExtractor: Close ZipFile After Use, Add Debug Info on Screen Like MiceWine Commit, and Selected DXVK/WineD3D, Small Changes on Floating File Manager (Avoid close it), Small Changes That I don't remember --- .../java/com/micewine/emu/activities/MainActivity.kt | 9 ++++++++- .../main/java/com/micewine/emu/adapters/AdapterFiles.kt | 7 +++++-- app/src/main/java/com/micewine/emu/core/ObbExtractor.kt | 2 ++ .../micewine/emu/fragments/DisplaySettingsFragment.kt | 6 +++++- .../emu/fragments/FloatingFileManagerFragment.kt | 2 ++ .../main/java/com/micewine/emu/views/OnScreenInfoView.kt | 2 +- app/src/main/res/layout/activity_emulation.xml | 4 ++-- app/src/main/res/values-pt-rBR/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 9 files changed, 29 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/micewine/emu/activities/MainActivity.kt b/app/src/main/java/com/micewine/emu/activities/MainActivity.kt index 9f5ca22..1c667bd 100644 --- a/app/src/main/java/com/micewine/emu/activities/MainActivity.kt +++ b/app/src/main/java/com/micewine/emu/activities/MainActivity.kt @@ -24,6 +24,7 @@ import androidx.fragment.app.Fragment import androidx.lifecycle.lifecycleScope import androidx.preference.PreferenceManager import com.google.android.material.bottomnavigation.BottomNavigationView +import com.micewine.emu.BuildConfig import com.micewine.emu.R import com.micewine.emu.activities.GeneralSettings.Companion.BOX64_DYNAREC_ALIGNED_ATOMICS_KEY import com.micewine.emu.activities.GeneralSettings.Companion.BOX64_DYNAREC_BIGBLOCK_KEY @@ -453,6 +454,8 @@ class MainActivity : AppCompatActivity() { setupWinePrefix(File("$homeDir/.wine")) + fileManagerCwd = fileManagerDefaultDir + setupDone = true } } @@ -469,6 +472,7 @@ class MainActivity : AppCompatActivity() { var setupDone: Boolean = false var enableRamCounter: Boolean = false var enableCpuCounter: Boolean = false + var enableDebugInfo: Boolean = false var appLang: String? = null var box64DynarecBigblock: String? = null var box64DynarecStrongmem: String? = null @@ -494,6 +498,7 @@ class MainActivity : AppCompatActivity() { var fileManagerDefaultDir: String = "$homeDir/.wine/dosdevices" var fileManagerCwd: String = fileManagerDefaultDir var selectedFile: String = "" + var miceWineVersion: String = "MiceWine (git-${BuildConfig.GIT_SHORT_SHA})" private var selectedResolution: String? = "" var selectedFragment = "HomeFragment" @@ -503,6 +508,7 @@ class MainActivity : AppCompatActivity() { const val ACTION_SELECT_FILE_MANAGER = "com.micewine.emu.ACTION_SELECT_FILE_MANAGER" const val RAM_COUNTER_KEY = "ramCounter" const val CPU_COUNTER_KEY = "cpuCounter" + const val ENABLE_DEBUG_INFO_KEY = "debugInfo" fun setupWinePrefix(winePrefix: File) { if (!winePrefix.exists()) { @@ -573,8 +579,9 @@ class MainActivity : AppCompatActivity() { selectedMesaVkWsiPresentMode = preferences.getString(SELECTED_MESA_VK_WSI_PRESENT_MODE_KEY, "mailbox") selectedTuDebugPreset = preferences.getString(SELECTED_TU_DEBUG_PRESET_KEY, "noconform") selectedResolution = preferences.getString(DISPLAY_RESOLUTION_KEY, "1280x720") - enableRamCounter = preferences.getBoolean(RAM_COUNTER_KEY, false) + enableRamCounter = preferences.getBoolean(RAM_COUNTER_KEY, true) enableCpuCounter = preferences.getBoolean(CPU_COUNTER_KEY, false) + enableDebugInfo = preferences.getBoolean(ENABLE_DEBUG_INFO_KEY, true) } fun copyAssets(activity: Activity, filename: String, outputPath: String) { diff --git a/app/src/main/java/com/micewine/emu/adapters/AdapterFiles.kt b/app/src/main/java/com/micewine/emu/adapters/AdapterFiles.kt index 32e35e0..655fe77 100644 --- a/app/src/main/java/com/micewine/emu/adapters/AdapterFiles.kt +++ b/app/src/main/java/com/micewine/emu/adapters/AdapterFiles.kt @@ -9,7 +9,6 @@ import android.view.View import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView -import android.widget.Toast import androidx.recyclerview.widget.RecyclerView import com.micewine.emu.R import com.micewine.emu.activities.MainActivity.Companion.ACTION_SELECT_FILE_MANAGER @@ -31,7 +30,11 @@ class AdapterFiles(private val fileList: List, private val context: Co override fun onBindViewHolder(holder: ViewHolder, position: Int) { val sList = fileList[position] - holder.fileName.text = sList.file.name + if (fileManagerCwd == fileManagerDefaultDir) { + holder.fileName.text = sList.file.name.uppercase() + } else { + holder.fileName.text = sList.file.name + } if (sList.file.isDirectory) { holder.icon.setImageResource(R.drawable.ic_folder) diff --git a/app/src/main/java/com/micewine/emu/core/ObbExtractor.kt b/app/src/main/java/com/micewine/emu/core/ObbExtractor.kt index f79e7c8..1f2e7ab 100644 --- a/app/src/main/java/com/micewine/emu/core/ObbExtractor.kt +++ b/app/src/main/java/com/micewine/emu/core/ObbExtractor.kt @@ -26,6 +26,8 @@ object ObbExtractor { Thread.sleep(100) } + zipFile.close() + progressBarValue = 0 } catch (e: IOException) { e.printStackTrace() diff --git a/app/src/main/java/com/micewine/emu/fragments/DisplaySettingsFragment.kt b/app/src/main/java/com/micewine/emu/fragments/DisplaySettingsFragment.kt index 886e54f..7499b93 100644 --- a/app/src/main/java/com/micewine/emu/fragments/DisplaySettingsFragment.kt +++ b/app/src/main/java/com/micewine/emu/fragments/DisplaySettingsFragment.kt @@ -12,6 +12,7 @@ import com.micewine.emu.activities.GeneralSettings.Companion.DISPLAY_RESOLUTION_ import com.micewine.emu.activities.GeneralSettings.Companion.SPINNER import com.micewine.emu.activities.GeneralSettings.Companion.SWITCH import com.micewine.emu.activities.MainActivity.Companion.CPU_COUNTER_KEY +import com.micewine.emu.activities.MainActivity.Companion.ENABLE_DEBUG_INFO_KEY import com.micewine.emu.activities.MainActivity.Companion.RAM_COUNTER_KEY import com.micewine.emu.adapters.AdapterSettingsPreferences import com.micewine.emu.adapters.AdapterSettingsPreferences.SettingsListSpinner @@ -53,10 +54,13 @@ class DisplaySettingsFragment : Fragment() { SPINNER, "1280x720", DISPLAY_RESOLUTION_KEY) addToAdapter(R.string.enableRamCounter, R.string.enableRamCounterDescription, arrayOf(""), - SWITCH, "false", RAM_COUNTER_KEY) + SWITCH, "true", RAM_COUNTER_KEY) addToAdapter(R.string.enableCPUCounter, R.string.enableCPUCounterDescription, arrayOf(""), SWITCH, "false", CPU_COUNTER_KEY) + + addToAdapter(R.string.enableDebugInfo, R.string.enableDebugInfoDescription, arrayOf(""), + SWITCH, "true", ENABLE_DEBUG_INFO_KEY) } private fun addToAdapter(titleId: Int, descriptionId: Int, valuesArray: Array, type: Int, defaultValue: String, keyId: String) { diff --git a/app/src/main/java/com/micewine/emu/fragments/FloatingFileManagerFragment.kt b/app/src/main/java/com/micewine/emu/fragments/FloatingFileManagerFragment.kt index 9229b51..e400920 100644 --- a/app/src/main/java/com/micewine/emu/fragments/FloatingFileManagerFragment.kt +++ b/app/src/main/java/com/micewine/emu/fragments/FloatingFileManagerFragment.kt @@ -32,6 +32,8 @@ class FloatingFileManagerFragment: DialogFragment() { .setView(view) .create() + isCancelable = false + Thread { while (customRootFSPath == null) { Thread.sleep(16) diff --git a/app/src/main/java/com/micewine/emu/views/OnScreenInfoView.kt b/app/src/main/java/com/micewine/emu/views/OnScreenInfoView.kt index 51f3a94..84b9cd3 100644 --- a/app/src/main/java/com/micewine/emu/views/OnScreenInfoView.kt +++ b/app/src/main/java/com/micewine/emu/views/OnScreenInfoView.kt @@ -16,7 +16,7 @@ import com.micewine.emu.activities.MainActivity.Companion.selectedDXVK import com.micewine.emu.activities.MainActivity.Companion.selectedWineD3D import com.micewine.emu.activities.MainActivity.Companion.totalCpuUsage -class HWInfoView @JvmOverloads constructor (context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0): View(context, attrs, defStyleAttr) { +class OnScreenInfoView @JvmOverloads constructor (context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0): View(context, attrs, defStyleAttr) { private val paint: Paint = Paint().apply { textSize = 30F strokeWidth = 8F diff --git a/app/src/main/res/layout/activity_emulation.xml b/app/src/main/res/layout/activity_emulation.xml index 8b087ed..42a2c9e 100644 --- a/app/src/main/res/layout/activity_emulation.xml +++ b/app/src/main/res/layout/activity_emulation.xml @@ -21,13 +21,13 @@ android:visibility="visible"> - - + Executar Criando Prefixo Wine… Selecione arquivo da RootFS + Ativa/Desativa Info de Debug + Ativa ou Desativa Info de Debug na Tela \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a4e247d..48bf278 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -102,4 +102,6 @@ Execute Creating Wine Prefix… Select RootFS File + Enable/Disable Debug Info + Enable or Disable Debug Info on Screen