Android: Show patch code categories in list
This commit is contained in:
@ -581,7 +581,7 @@ public class EmulationActivity extends AppCompatActivity implements SurfaceHolde
|
||||
boolean[] itemsChecked = new boolean[codes.length];
|
||||
for (int i = 0; i < codes.length; i++) {
|
||||
final PatchCode cc = codes[i];
|
||||
items[i] = cc.getDescription();
|
||||
items[i] = cc.getDisplayText();
|
||||
itemsChecked[i] = cc.isEnabled();
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
package com.github.stenzek.duckstation;
|
||||
|
||||
public class PatchCode {
|
||||
private static final String UNGROUPED_NAME = "Ungrouped";
|
||||
|
||||
private int mIndex;
|
||||
private String mGroup;
|
||||
private String mDescription;
|
||||
private boolean mEnabled;
|
||||
|
||||
public PatchCode(int index, String description, boolean enabled) {
|
||||
public PatchCode(int index, String group, String description, boolean enabled) {
|
||||
mIndex = index;
|
||||
mGroup = group;
|
||||
mDescription = description;
|
||||
mEnabled = enabled;
|
||||
}
|
||||
@ -15,6 +19,10 @@ public class PatchCode {
|
||||
return mIndex;
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return mGroup;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return mDescription;
|
||||
}
|
||||
@ -22,4 +30,11 @@ public class PatchCode {
|
||||
public boolean isEnabled() {
|
||||
return mEnabled;
|
||||
}
|
||||
|
||||
public String getDisplayText() {
|
||||
if (mGroup == null || mGroup.equals(UNGROUPED_NAME))
|
||||
return mDescription;
|
||||
else
|
||||
return String.format("(%s) %s", mGroup, mDescription);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user