v2.3.0: long-pressing in ghost equip window now shows item info

This commit is contained in:
Evan Debenham
2023-11-09 11:58:38 -05:00
parent f9e346b2ca
commit 6d1590bfdd
2 changed files with 19 additions and 0 deletions

View File

@@ -68,6 +68,7 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.Window;
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog; import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle; import com.shatteredpixel.shatteredpixeldungeon.windows.IconTitle;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag; import com.shatteredpixel.shatteredpixeldungeon.windows.WndBag;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndInfoItem;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest; import com.shatteredpixel.shatteredpixeldungeon.windows.WndQuest;
import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem; import com.shatteredpixel.shatteredpixeldungeon.windows.WndUseItem;
import com.watabou.noosa.Game; import com.watabou.noosa.Game;
@@ -936,6 +937,15 @@ public class DriedRose extends Artifact {
}); });
} }
} }
@Override
protected boolean onLongClick() {
if (item() != null && item().name() != null){
GameScene.show(new WndInfoItem(item()));
return true;
}
return false;
}
}; };
btnWeapon.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.top() + message.height() + GAP, BTN_SIZE, BTN_SIZE ); btnWeapon.setRect( (WIDTH - BTN_GAP) / 2 - BTN_SIZE, message.top() + message.height() + GAP, BTN_SIZE, BTN_SIZE );
if (rose.weapon != null) { if (rose.weapon != null) {

View File

@@ -57,6 +57,11 @@ public class ItemButton extends Component {
protected void onClick() { protected void onClick() {
ItemButton.this.onClick(); ItemButton.this.onClick();
} }
@Override
protected boolean onLongClick() {
return ItemButton.this.onLongClick();
}
}; };
slot.enable(true); slot.enable(true);
add(slot); add(slot);
@@ -64,6 +69,10 @@ public class ItemButton extends Component {
protected void onClick() {} protected void onClick() {}
protected boolean onLongClick(){
return false;
}
@Override @Override
protected void layout() { protected void layout() {
super.layout(); super.layout();