Fixed drawItemSelection squishing things

This commit is contained in:
Anuken
2025-07-03 21:23:02 -04:00
parent 835c8b4a6c
commit dd289d3d08
3 changed files with 12 additions and 4 deletions

View File

@@ -1215,11 +1215,11 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
public void drawItemSelection(@Nullable UnlockableContent selection){ public void drawItemSelection(@Nullable UnlockableContent selection){
if(selection != null){ if(selection != null){
float dx = x - block.size * tilesize/2f, dy = y + block.size * tilesize/2f, s = iconSmall / 4f; float dx = x - block.size * tilesize/2f, dy = y + block.size * tilesize/2f, s = iconSmall / 4f * selection.fullIcon.ratio(), h = iconSmall / 4f;
Draw.mixcol(Color.darkGray, 1f); Draw.mixcol(Color.darkGray, 1f);
Draw.rect(selection.fullIcon, dx, dy - 1, s, s); Draw.rect(selection.fullIcon, dx, dy - 1, s, h);
Draw.reset(); Draw.reset();
Draw.rect(selection.fullIcon, dx, dy, s, s); Draw.rect(selection.fullIcon, dx, dy, s, h);
} }
} }

View File

@@ -220,6 +220,14 @@ public class UnitFactory extends UnitBlock{
} }
} }
@Override
public void drawSelect(){
super.drawSelect();
if(plans.size > 1 && currentPlan != -1 && currentPlan < plans.size){
drawItemSelection(plans.get(currentPlan).unit);
}
}
@Override @Override
public Vec2 getCommandPosition(){ public Vec2 getCommandPosition(){
return commandPos; return commandPos;

View File

@@ -26,4 +26,4 @@ org.gradle.caching=true
org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000 org.gradle.internal.http.connectionTimeout=100000
android.enableR8.fullMode=false android.enableR8.fullMode=false
archash=9b55a5d628 archash=60e47d0f1b