Core database content icon click support

This commit is contained in:
Anuken
2024-06-19 16:56:20 -04:00
parent 4f93a5c332
commit 65e7891991
14 changed files with 101 additions and 61 deletions

View File

@@ -25,6 +25,7 @@ import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
import mindustry.world.blocks.ConstructBlock.*;
import mindustry.world.meta.*;
import static mindustry.Vars.*;
@@ -465,7 +466,7 @@ public class PlacementFragment{
for(int i = 0; i < counts.length; i++){
if(counts[i] > 0){
var type = content.unit(i);
unitlist.add(new ItemImage(type.uiIcon, counts[i])).tooltip(type.localizedName).pad(4).with(b -> {
unitlist.add(StatValues.stack(type, counts[i])).tooltip(type.localizedName).pad(4).with(b -> {
var listener = new ClickListener();
//left click -> select