Don't mind my posts, I'm just collecting ideas on how this could be done
Let's say we want to put it in the inventory tab. We would have to take a look at the following file:
AndorsTrail/res/layout/heroinfo_equipped.xml
On line 14-20, the Character's sprite is shown. If this could be used for an onClick function of some sort, this should be quite easy without huge changes.
This could be done very similar on how the worn items are clickable:
src/.../AndorsTrail/activity/fragment/HeroinfoActivity_Inventory.java:171
Code: Select all
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (player.inventory.isEmptySlot(inventorySlot)) return;
imageView.setClickable(false); // Will be enabled again on update()
showEquippedItemInfo(player.inventory.getItemTypeInWearSlot(inventorySlot), inventorySlot);
}
});
This would look something like this:
Code: Select all
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
showCharacterIconSelection();
}
});
Of course, what's missing still is the menu itself, where the player can choose the sprite. I have not yet figured out how to do that, unfortunately.
Code: Select all
private void showCharacterIconSelection() {
// Show a new inflated window with either a vertical list or a grid containing all chooseable character sprites
// Each element of the list/grid has to have an onClick function itself, which calls player.updatePlayerIcon(spriteID);
// Problem: How to define which spriteID would be called for each button?
}
Edit: If I find the time for it, I will try implementing this function and, if it actually works, I can do a pull request for it on GitHub
Lvl: 75, XP: 7837474, Gold: 92480, RoLS: 1
Hp: 253, AC: 309, AD: 26-41, BC: 163, DR: 8