Skip to content

Commit

Permalink
Add endpoints for Mario Party 10 AppData
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Feb 8, 2024
1 parent fc14457 commit 8065d9d
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* ====================================================================
* amiibo-editing-suite Copyright (C) 2016 ngagne
* Copyright (C) 2024 AbandonedCart @ TagMo
* ====================================================================
*/
package com.hiddenramblings.tagmo.amiibo.tagdata

class AppDataMarioParty10(appData: ByteArray?) : AppData(appData!!)
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ object AppId {
const val MLPaperJam = 0x00132600
const val MLSuperstarSaga = 0x00194B00
const val MSSuperstars = 0x00188B00
const val MarioParty10 = 0x0000FFFF // Placeholder
const val MarioTennis = 0x10199000
const val Pikmin = 0x001A9200
const val Splatoon = 0x10162B00
Expand All @@ -28,6 +29,7 @@ object AppId {
apps[MLPaperJam] = getString(R.string.ml_paper_jam)
apps[MLSuperstarSaga] = getString(R.string.ml_superstar_saga)
apps[MSSuperstars] = getString(R.string.ms_superstars)
apps[MarioParty10] = getString(R.string.mario_party_ten)
apps[MarioTennis] = getString(R.string.mario_tennis)
apps[Pikmin] = getString(R.string.pikmin)
apps[Splatoon] = getString(R.string.splatoon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class TagDataEditor : AppCompatActivity() {
private lateinit var appDataViewMLPaperJam: LinearLayout
private lateinit var appDataViewMLSuperstarSaga: LinearLayout
private lateinit var appDataViewMSSuperstars: LinearLayout
private lateinit var appDataViewMarioParty10: LinearLayout
private lateinit var appDataViewMarioTennis: LinearLayout
private lateinit var appDataViewPikmin: LinearLayout
private lateinit var appDataViewSplatoon: LinearLayout
Expand Down Expand Up @@ -113,6 +114,7 @@ class TagDataEditor : AppCompatActivity() {
private var buttonUnlock: AppCompatButton? = null
private var appDataMLSuperstarSaga: AppDataMLSuperstarSaga? = null
private var appDataMSSuperstars: AppDataMSSuperstars? = null
private var appDataMarioParty10: AppDataMarioParty10? = null
private var appDataMarioTennis: AppDataMarioTennis? = null
private var appDataPikmin: AppDataPikmin? = null
private var appDataSplatoon: AppDataSplatoon? = null
Expand Down Expand Up @@ -177,6 +179,7 @@ class TagDataEditor : AppCompatActivity() {
appDataViewMLPaperJam = findViewById(R.id.appDataMLPaperJam)
appDataViewMLSuperstarSaga = findViewById(R.id.appDataMLSuperstarSaga)
appDataViewMSSuperstars = findViewById(R.id.appDataMSSuperstars)
appDataViewMarioParty10 = findViewById(R.id.appDataMarioParty10)
appDataViewMarioTennis = findViewById(R.id.appDataMarioTennis)
appDataViewPikmin = findViewById(R.id.appDataPikmin)
appDataViewSplatoon = findViewById(R.id.appDataSplatoon)
Expand Down Expand Up @@ -863,6 +866,8 @@ class TagDataEditor : AppCompatActivity() {
appDataMLSuperstarSaga = null
appDataViewMSSuperstars.isGone = true
appDataMSSuperstars = null
appDataViewMarioParty10.isGone = true
appDataMarioParty10 = null
appDataViewMarioTennis.isGone = true
appDataMarioTennis = null
appDataViewPikmin.isGone = true
Expand Down Expand Up @@ -897,6 +902,10 @@ class TagDataEditor : AppCompatActivity() {
appDataViewMSSuperstars.isVisible = true
enableAppDataMSSuperstars(amiiboData.appData)
}
AppId.MarioParty10 -> {
appDataViewMarioParty10.isVisible = true
enableAppDataMarioParty10(amiiboData.appData)
}
AppId.MarioTennis -> {
appDataViewMarioTennis.isVisible = true
enableAppDataMarioTennis(amiiboData.appData)
Expand Down Expand Up @@ -1211,6 +1220,16 @@ class TagDataEditor : AppCompatActivity() {
onAppDataMSSuperstarsChecked(isAppDataInitialized)
}

private fun enableAppDataMarioParty10(appData: ByteArray) {
try {
appDataMarioParty10 = AppDataMarioParty10(appData)
} catch (e: Exception) {
appDataViewMarioParty10.isGone = true
return
}
onAppDataMarioParty10Checked(isAppDataInitialized)
}

private fun enableAppDataMarioTennis(appData: ByteArray) {
try {
appDataMarioTennis = AppDataMarioTennis(appData)
Expand Down Expand Up @@ -1608,6 +1627,10 @@ class TagDataEditor : AppCompatActivity() {

}

private fun onAppDataMarioParty10Checked(enabled: Boolean) {

}

private fun onAppDataMarioTennisChecked(enabled: Boolean) {

}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/layout/app_data_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
layout="@layout/app_data_ms_superstars"
android:id="@+id/appDataMSSuperstars" />

<include
layout="@layout/app_data_mario_party_10"
android:id="@+id/appDataMarioParty10" />

<include
layout="@layout/app_data_mario_tennis"
android:id="@+id/appDataMarioTennis" />
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/layout/app_data_mario_party_10.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:id="@+id/appDataMarioParty10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone"
tools:visibility="visible">

</LinearLayout>
</merge>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
<string name="ml_paper_jam">Mario &#38; Luigi: Paper Jam</string>
<string name="ml_superstar_saga">Mario &#38; Luigi: Superstar Saga</string>
<string name="ms_superstars">Mario Sports Superstars</string>
<string name="mario_party_ten">Mario Party 10</string>
<string name="mario_tennis">Mario Tennis</string>
<string name="pikmin">Pikmin</string>
<string name="splatoon">Splatoon (1 &#38; 2)</string>
Expand Down

0 comments on commit 8065d9d

Please sign in to comment.