v3.0.0: added ring type icons to trinity selection

This commit is contained in:
Evan Debenham
2025-02-05 15:26:57 -05:00
parent 70993f9a74
commit bfe440abfe
3 changed files with 20 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
import com.shatteredpixel.shatteredpixeldungeon.ui.HeroIcon;
import com.shatteredpixel.shatteredpixeldungeon.ui.ItemButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.QuickSlotButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton;
import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
@@ -355,13 +356,14 @@ public class Trinity extends ArmorAbility {
int left = 0;
for (Item item : options){
RedButton btn = new RedButton(""){
ItemButton btn = new ItemButton(){
@Override
protected void onClick() {
GameScene.show(new WndItemConfirm(WndItemtypeSelect.this, item, tome, spell));
}
};
btn.icon(new ItemSprite(item));
btn.item(item);
btn.slot().textVisible(false);
btn.setRect(left, top, 19, 19);
add(btn);

View File

@@ -101,4 +101,8 @@ public class ItemButton extends Component {
slot.clear();
}
public ItemSlot slot(){
return slot;
}
}

View File

@@ -326,6 +326,18 @@ public class ItemSlot extends Button {
}
public void textVisible( boolean visible ){
if (visible){
add(status);
add(extra);
add(level);
} else {
remove(status);
remove(extra);
remove(level);
}
}
public void setMargins( int left, int top, int right, int bottom){
margin.set(left, top, right, bottom);
layout();