-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13274 from dpeukert/master
Clean up CRLF line endings
- Loading branch information
Showing
4 changed files
with
293 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
# RZDK01 - The Legend of Zelda: Twilight Princess [Wii] | ||
|
||
[OnFrame] | ||
# Add memory patches to be applied every frame here. | ||
$Hyrule Field Speed Hack | ||
0x80047DEC:dword:0x60000000 | ||
0x80047E08:dword:0x60000000 | ||
0x80047E20:dword:0x60000000 | ||
0x80047E3C:dword:0x60000000 | ||
|
||
0x80047E40:dword:0x60000000 | ||
0x80047E44:dword:0x60000000 | ||
0x80047E48:dword:0x60000000 | ||
0x80047E4C:dword:0x60000000 | ||
0x80047E50:dword:0x60000000 | ||
0x80047E54:dword:0x60000000 | ||
0x80047E58:dword:0x60000000 | ||
0x80047E5C:dword:0x60000000 | ||
0x80047E60:dword:0x60000000 | ||
0x80047E64:dword:0x60000000 | ||
0x80047E68:dword:0x60000000 | ||
0x80047E6C:dword:0x60000000 | ||
0x80047E70:dword:0x60000000 | ||
0x80047E74:dword:0x60000000 | ||
0x80047E78:dword:0x60000000 | ||
0x80047E7C:dword:0x60000000 | ||
0x80047E80:dword:0x60000000 | ||
0x80047E84:dword:0x60000000 | ||
0x80047E88:dword:0x60000000 | ||
0x80047E8C:dword:0x60000000 | ||
|
||
0x80047E94:dword:0x60000000 | ||
0x80047EB0:dword:0x60000000 | ||
0x80047EC8:dword:0x60000000 | ||
0x80047EE4:dword:0x60000000 | ||
|
||
[Patches_RetroAchievements_Verified] | ||
$Hyrule Field Speed Hack | ||
|
||
[ActionReplay] | ||
# Add action replay cheats here. | ||
# RZDK01 - The Legend of Zelda: Twilight Princess [Wii] | ||
|
||
[OnFrame] | ||
# Add memory patches to be applied every frame here. | ||
$Hyrule Field Speed Hack | ||
0x80047DEC:dword:0x60000000 | ||
0x80047E08:dword:0x60000000 | ||
0x80047E20:dword:0x60000000 | ||
0x80047E3C:dword:0x60000000 | ||
|
||
0x80047E40:dword:0x60000000 | ||
0x80047E44:dword:0x60000000 | ||
0x80047E48:dword:0x60000000 | ||
0x80047E4C:dword:0x60000000 | ||
0x80047E50:dword:0x60000000 | ||
0x80047E54:dword:0x60000000 | ||
0x80047E58:dword:0x60000000 | ||
0x80047E5C:dword:0x60000000 | ||
0x80047E60:dword:0x60000000 | ||
0x80047E64:dword:0x60000000 | ||
0x80047E68:dword:0x60000000 | ||
0x80047E6C:dword:0x60000000 | ||
0x80047E70:dword:0x60000000 | ||
0x80047E74:dword:0x60000000 | ||
0x80047E78:dword:0x60000000 | ||
0x80047E7C:dword:0x60000000 | ||
0x80047E80:dword:0x60000000 | ||
0x80047E84:dword:0x60000000 | ||
0x80047E88:dword:0x60000000 | ||
0x80047E8C:dword:0x60000000 | ||
|
||
0x80047E94:dword:0x60000000 | ||
0x80047EB0:dword:0x60000000 | ||
0x80047EC8:dword:0x60000000 | ||
0x80047EE4:dword:0x60000000 | ||
|
||
[Patches_RetroAchievements_Verified] | ||
$Hyrule Field Speed Hack | ||
|
||
[ActionReplay] | ||
# Add action replay cheats here. |
264 changes: 132 additions & 132 deletions
264
...pp/src/main/java/org/dolphinemu/dolphinemu/features/skylanders/ui/SkylanderSlotAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,132 +1,132 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
package org.dolphinemu.dolphinemu.features.skylanders.ui | ||
|
||
import android.app.AlertDialog | ||
import android.content.Intent | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.AdapterView | ||
import android.widget.AdapterView.OnItemClickListener | ||
import android.widget.ArrayAdapter | ||
import android.widget.Toast | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.google.android.material.dialog.MaterialAlertDialogBuilder | ||
import org.dolphinemu.dolphinemu.R | ||
import org.dolphinemu.dolphinemu.activities.EmulationActivity | ||
import org.dolphinemu.dolphinemu.databinding.DialogCreateSkylanderBinding | ||
import org.dolphinemu.dolphinemu.databinding.ListItemNfcFigureSlotBinding | ||
import org.dolphinemu.dolphinemu.features.skylanders.SkylanderConfig | ||
import org.dolphinemu.dolphinemu.features.skylanders.SkylanderConfig.removeSkylander | ||
import org.dolphinemu.dolphinemu.features.skylanders.model.SkylanderPair | ||
|
||
class SkylanderSlotAdapter( | ||
private val slots: List<SkylanderSlot>, | ||
private val activity: EmulationActivity | ||
) : RecyclerView.Adapter<SkylanderSlotAdapter.ViewHolder>(), OnItemClickListener { | ||
class ViewHolder(var binding: ListItemNfcFigureSlotBinding) : | ||
RecyclerView.ViewHolder(binding.getRoot()) | ||
|
||
private lateinit var binding: DialogCreateSkylanderBinding | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val inflater = LayoutInflater.from(parent.context) | ||
val binding = ListItemNfcFigureSlotBinding.inflate(inflater, parent, false) | ||
return ViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
val slot = slots[position] | ||
holder.binding.textFigureName.text = slot.label | ||
|
||
holder.binding.buttonClearFigure.setOnClickListener { | ||
removeSkylander(slot.portalSlot) | ||
activity.clearSkylander(slot.slotNum) | ||
} | ||
|
||
holder.binding.buttonLoadFigure.setOnClickListener { | ||
val loadSkylander = Intent(Intent.ACTION_OPEN_DOCUMENT) | ||
loadSkylander.addCategory(Intent.CATEGORY_OPENABLE) | ||
loadSkylander.type = "*/*" | ||
activity.setSkylanderData(0, 0, "", position) | ||
activity.startActivityForResult( | ||
loadSkylander, | ||
EmulationActivity.REQUEST_SKYLANDER_FILE | ||
) | ||
} | ||
|
||
val inflater = LayoutInflater.from(activity) | ||
binding = DialogCreateSkylanderBinding.inflate(inflater) | ||
|
||
val nameList = SkylanderConfig.REVERSE_LIST_SKYLANDERS.keys.toMutableList() | ||
nameList.sort() | ||
val skylanderNames: ArrayList<String> = ArrayList(nameList) | ||
|
||
binding.skylanderDropdown.setAdapter( | ||
ArrayAdapter( | ||
activity, R.layout.support_simple_spinner_dropdown_item, | ||
skylanderNames | ||
) | ||
) | ||
binding.skylanderDropdown.onItemClickListener = this | ||
|
||
holder.binding.buttonCreateFigure.setOnClickListener { | ||
if (binding.getRoot().parent != null) { | ||
(binding.getRoot().parent as ViewGroup).removeAllViews() | ||
} | ||
val createDialog = MaterialAlertDialogBuilder(activity) | ||
.setTitle(R.string.create_skylander_title) | ||
.setView(binding.getRoot()) | ||
.setPositiveButton(R.string.create_figure, null) | ||
.setNegativeButton(R.string.cancel, null) | ||
.show() | ||
createDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { | ||
if (binding.skylanderId.text.toString().isNotBlank() && | ||
binding.skylanderVar.text.toString().isNotBlank() | ||
) { | ||
val createSkylander = Intent(Intent.ACTION_CREATE_DOCUMENT) | ||
createSkylander.addCategory(Intent.CATEGORY_OPENABLE) | ||
createSkylander.type = "*/*" | ||
val id = binding.skylanderId.text.toString().toInt() | ||
val variant = binding.skylanderVar.text.toString().toInt() | ||
val name = SkylanderConfig.LIST_SKYLANDERS[SkylanderPair(id, variant)] | ||
if (name != null) { | ||
createSkylander.putExtra( | ||
Intent.EXTRA_TITLE, | ||
"$name.sky" | ||
) | ||
activity.setSkylanderData(id, variant, name, position) | ||
} else { | ||
createSkylander.putExtra( | ||
Intent.EXTRA_TITLE, | ||
"Unknown(ID: " + id + "Variant: " + variant + ").sky" | ||
) | ||
activity.setSkylanderData(id, variant, "Unknown", position) | ||
} | ||
activity.startActivityForResult( | ||
createSkylander, | ||
EmulationActivity.REQUEST_CREATE_SKYLANDER | ||
) | ||
createDialog.dismiss() | ||
} else { | ||
Toast.makeText( | ||
activity, R.string.invalid_skylander, | ||
Toast.LENGTH_SHORT | ||
).show() | ||
} | ||
} | ||
} | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return slots.size | ||
} | ||
|
||
override fun onItemClick(parent: AdapterView<*>, view: View, position: Int, id: Long) { | ||
val skylanderIdVar = | ||
SkylanderConfig.REVERSE_LIST_SKYLANDERS[parent.getItemAtPosition(position)] | ||
binding.skylanderId.setText(skylanderIdVar!!.id.toString()) | ||
binding.skylanderVar.setText(skylanderIdVar.variant.toString()) | ||
} | ||
} | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
package org.dolphinemu.dolphinemu.features.skylanders.ui | ||
|
||
import android.app.AlertDialog | ||
import android.content.Intent | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.AdapterView | ||
import android.widget.AdapterView.OnItemClickListener | ||
import android.widget.ArrayAdapter | ||
import android.widget.Toast | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.google.android.material.dialog.MaterialAlertDialogBuilder | ||
import org.dolphinemu.dolphinemu.R | ||
import org.dolphinemu.dolphinemu.activities.EmulationActivity | ||
import org.dolphinemu.dolphinemu.databinding.DialogCreateSkylanderBinding | ||
import org.dolphinemu.dolphinemu.databinding.ListItemNfcFigureSlotBinding | ||
import org.dolphinemu.dolphinemu.features.skylanders.SkylanderConfig | ||
import org.dolphinemu.dolphinemu.features.skylanders.SkylanderConfig.removeSkylander | ||
import org.dolphinemu.dolphinemu.features.skylanders.model.SkylanderPair | ||
|
||
class SkylanderSlotAdapter( | ||
private val slots: List<SkylanderSlot>, | ||
private val activity: EmulationActivity | ||
) : RecyclerView.Adapter<SkylanderSlotAdapter.ViewHolder>(), OnItemClickListener { | ||
class ViewHolder(var binding: ListItemNfcFigureSlotBinding) : | ||
RecyclerView.ViewHolder(binding.getRoot()) | ||
|
||
private lateinit var binding: DialogCreateSkylanderBinding | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val inflater = LayoutInflater.from(parent.context) | ||
val binding = ListItemNfcFigureSlotBinding.inflate(inflater, parent, false) | ||
return ViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
val slot = slots[position] | ||
holder.binding.textFigureName.text = slot.label | ||
|
||
holder.binding.buttonClearFigure.setOnClickListener { | ||
removeSkylander(slot.portalSlot) | ||
activity.clearSkylander(slot.slotNum) | ||
} | ||
|
||
holder.binding.buttonLoadFigure.setOnClickListener { | ||
val loadSkylander = Intent(Intent.ACTION_OPEN_DOCUMENT) | ||
loadSkylander.addCategory(Intent.CATEGORY_OPENABLE) | ||
loadSkylander.type = "*/*" | ||
activity.setSkylanderData(0, 0, "", position) | ||
activity.startActivityForResult( | ||
loadSkylander, | ||
EmulationActivity.REQUEST_SKYLANDER_FILE | ||
) | ||
} | ||
|
||
val inflater = LayoutInflater.from(activity) | ||
binding = DialogCreateSkylanderBinding.inflate(inflater) | ||
|
||
val nameList = SkylanderConfig.REVERSE_LIST_SKYLANDERS.keys.toMutableList() | ||
nameList.sort() | ||
val skylanderNames: ArrayList<String> = ArrayList(nameList) | ||
|
||
binding.skylanderDropdown.setAdapter( | ||
ArrayAdapter( | ||
activity, R.layout.support_simple_spinner_dropdown_item, | ||
skylanderNames | ||
) | ||
) | ||
binding.skylanderDropdown.onItemClickListener = this | ||
|
||
holder.binding.buttonCreateFigure.setOnClickListener { | ||
if (binding.getRoot().parent != null) { | ||
(binding.getRoot().parent as ViewGroup).removeAllViews() | ||
} | ||
val createDialog = MaterialAlertDialogBuilder(activity) | ||
.setTitle(R.string.create_skylander_title) | ||
.setView(binding.getRoot()) | ||
.setPositiveButton(R.string.create_figure, null) | ||
.setNegativeButton(R.string.cancel, null) | ||
.show() | ||
createDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener { | ||
if (binding.skylanderId.text.toString().isNotBlank() && | ||
binding.skylanderVar.text.toString().isNotBlank() | ||
) { | ||
val createSkylander = Intent(Intent.ACTION_CREATE_DOCUMENT) | ||
createSkylander.addCategory(Intent.CATEGORY_OPENABLE) | ||
createSkylander.type = "*/*" | ||
val id = binding.skylanderId.text.toString().toInt() | ||
val variant = binding.skylanderVar.text.toString().toInt() | ||
val name = SkylanderConfig.LIST_SKYLANDERS[SkylanderPair(id, variant)] | ||
if (name != null) { | ||
createSkylander.putExtra( | ||
Intent.EXTRA_TITLE, | ||
"$name.sky" | ||
) | ||
activity.setSkylanderData(id, variant, name, position) | ||
} else { | ||
createSkylander.putExtra( | ||
Intent.EXTRA_TITLE, | ||
"Unknown(ID: " + id + "Variant: " + variant + ").sky" | ||
) | ||
activity.setSkylanderData(id, variant, "Unknown", position) | ||
} | ||
activity.startActivityForResult( | ||
createSkylander, | ||
EmulationActivity.REQUEST_CREATE_SKYLANDER | ||
) | ||
createDialog.dismiss() | ||
} else { | ||
Toast.makeText( | ||
activity, R.string.invalid_skylander, | ||
Toast.LENGTH_SHORT | ||
).show() | ||
} | ||
} | ||
} | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return slots.size | ||
} | ||
|
||
override fun onItemClick(parent: AdapterView<*>, view: View, position: Int, id: Long) { | ||
val skylanderIdVar = | ||
SkylanderConfig.REVERSE_LIST_SKYLANDERS[parent.getItemAtPosition(position)] | ||
binding.skylanderId.setText(skylanderIdVar!!.id.toString()) | ||
binding.skylanderVar.setText(skylanderIdVar.variant.toString()) | ||
} | ||
} |
Oops, something went wrong.