From f9954ea4c76dfb9e97cb31ca55d857fda27cfd5e Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sat, 7 Nov 2020 17:20:58 -0800 Subject: [PATCH 1/8] initial implementation --- core/src/mindustry/type/UnitType.java | 2 ++ core/src/mindustry/world/meta/Stat.java | 4 ++++ core/src/mindustry/world/meta/values/AmmoListValue.java | 7 +++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 3c2cc4a1be..95c6e8912d 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -229,6 +229,8 @@ public class UnitType extends UnlockableContent{ if(inst instanceof Payloadc){ stats.add(Stat.payloadCapacity, (payloadCapacity / (tilesize * tilesize)), StatUnit.blocksSquared); } + + stats.add(Stat.weapons, new WeaponListValue(this, weapons)); } @CallSuper diff --git a/core/src/mindustry/world/meta/Stat.java b/core/src/mindustry/world/meta/Stat.java index 718dbb8f2d..a49b35ea28 100644 --- a/core/src/mindustry/world/meta/Stat.java +++ b/core/src/mindustry/world/meta/Stat.java @@ -55,6 +55,10 @@ public enum Stat{ linkRange(StatCat.crafting), instructions(StatCat.crafting), + weapons(StatCat.function), + mirrored(StatCat.function), + bullet(StatCat.function), + speedIncrease(StatCat.function), repairTime(StatCat.function), range(StatCat.function), diff --git a/core/src/mindustry/world/meta/values/AmmoListValue.java b/core/src/mindustry/world/meta/values/AmmoListValue.java index 359b958a96..3900b238bb 100644 --- a/core/src/mindustry/world/meta/values/AmmoListValue.java +++ b/core/src/mindustry/world/meta/values/AmmoListValue.java @@ -10,6 +10,7 @@ import mindustry.content.*; import mindustry.ctype.*; import mindustry.entities.bullet.*; import mindustry.gen.*; +import mindustry.type.*; import mindustry.ui.*; import mindustry.world.meta.*; @@ -28,8 +29,10 @@ public class AmmoListValue implements StatValue{ table.row(); for(T t : map.keys()){ BulletType type = map.get(t); - table.image(icon(t)).size(3 * 8).padRight(4).right().top(); - table.add(t.localizedName).padRight(10).left().top(); + if(!(t instanceof UnitType)){ + table.image(icon(t)).size(3 * 8).padRight(4).right().top(); + table.add(t.localizedName).padRight(10).left().top(); + } table.table(Tex.underline, bt -> { bt.left().defaults().padRight(3).left(); From 1555e77348939401fdc5030d1b89b20d30dbac01 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sat, 7 Nov 2020 17:21:03 -0800 Subject: [PATCH 2/8] Create WeaponListValue.java --- .../world/meta/values/WeaponListValue.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 core/src/mindustry/world/meta/values/WeaponListValue.java diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java new file mode 100644 index 0000000000..118c494b5f --- /dev/null +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -0,0 +1,65 @@ +package mindustry.world.meta.values; + +//TODO: remove unused imports +import arc.*; +import arc.graphics.*; +import arc.graphics.g2d.*; +import arc.math.*; +import arc.scene.ui.layout.*; +import arc.struct.*; +import arc.util.*; +import mindustry.content.*; +import mindustry.ctype.*; +import mindustry.entities.bullet.*; +import mindustry.gen.*; +import mindustry.ui.*; +import mindustry.type.*; +import mindustry.world.meta.*; + +import static mindustry.Vars.*; + +public class WeaponListValue implements StatValue{ + private final Seq weapons; + private final UnitType unit; + + public WeaponListValue(UnitType unit, Seq weapons){ + this.weapons = weapons; + this.unit = unit; + } + + @Override + public void display(Table table){ + table.row(); + for(Weapon weapon : weapons){ + if(weapon.flipSprite){ + continue; + } + + if(weapon.outlineRegion.found()){ + table.image(weapon.outlineRegion).size(10 * 8).right().top(); + }else{ + table.image(unit.icon(Cicon.full)).size(10 * 8).right().top(); + } + + table.table(Tex.underline, w -> { + w.left().defaults().padRight(3).left(); + + sep(w, "[lightgray]" + Stat.mirrored.localized() + ": [white]" + weapon.mirror); + sep(w, "[lightgray]" + Stat.inaccuracy.localized() + ": [white]" + (int)weapon.inaccuracy + " " + StatUnit.degrees.localized()); + sep(w, "[lightgray]" + Stat.reload.localized() + ": [white]" + Strings.autoFixed(60f / weapon.reload * weapon.shots, 1)); + sep(w, "[lightgray]" + Stat.targetsAir.localized() + ": [white]" + weapon.bullet.collidesAir); + sep(w, "[lightgray]" + Stat.targetsGround.localized() + ": [white]" + weapon.bullet.collidesGround); + sep(w, "[lightgray]" + Stat.bullet.localized() + ":"); + + AmmoListValue bullet = new AmmoListValue(OrderedMap.of(unit, weapon.bullet)); + bullet.display(w); + }).left().padTop(-9); + table.row(); + } + } + + void sep(Table table, String text){ + table.row(); + table.add(text); + } +} From b448b90999069d53d3155c95e75c199649ff238e Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sat, 7 Nov 2020 17:21:16 -0800 Subject: [PATCH 3/8] bundles --- core/assets/bundles/bundle.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index c85b9086d2..72533e3a3f 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -624,6 +624,9 @@ stat.memorycapacity = Memory Capacity stat.basepowergeneration = Base Power Generation stat.productiontime = Production Time stat.repairtime = Block Full Repair Time +stat.weapons = Weapons +stat.mirrored = Mirrored +stat.bullet = Bullet stat.speedincrease = Speed Increase stat.range = Range stat.drilltier = Drillables From d133709423ffba2681ae0d656ad6e8fbf8120685 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sat, 7 Nov 2020 18:31:47 -0800 Subject: [PATCH 4/8] update sprites --- .../world/meta/values/WeaponListValue.java | 8 +++--- tools/src/mindustry/tools/Generators.java | 26 +++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java index 118c494b5f..5c89deb649 100644 --- a/core/src/mindustry/world/meta/values/WeaponListValue.java +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -30,15 +30,17 @@ public class WeaponListValue implements StatValue{ @Override public void display(Table table){ table.row(); - for(Weapon weapon : weapons){ + for(int i = 0;i < weapons.size;i ++){ + Weapon weapon = weapons.get(i); + if(weapon.flipSprite){ continue; } if(weapon.outlineRegion.found()){ - table.image(weapon.outlineRegion).size(10 * 8).right().top(); + table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top(); }else{ - table.image(unit.icon(Cicon.full)).size(10 * 8).right().top(); + table.image(unit.icon(Cicon.full)).size(15 * 8).right().top(); } table.table(Tex.underline, w -> { diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 2b56d76a4e..e28d11fff8 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -505,6 +505,32 @@ public class Generators{ } } + //generate weapon stat UI + //TODO: optimize + Image base = new Image(image.width, image.height); + + image.each((x, y) -> { + Color c = image.getColor(x, y); + base.draw(x, y, c.set(c.r, c.g, c.b, c.a * 0.2f)); + }); + + for(int i = 0;i < type.weapons.size;i ++){ + Weapon weapon = type.weapons.get(i); + + if(weapon.flipSprite){ + continue; + } + + weapon.load(); + Image finalBase = base.copy(); + + finalBase.draw(outline.get(ImagePacker.get(weapon.region)), + (int)(weapon.x / Draw.scl + base.width / 2f - weapon.region.width / 2f), + (int)(-weapon.y / Draw.scl + base.height / 2f - weapon.region.height / 2f), + weapon.flipSprite, false); + + finalBase.save(type.name + "-weapon" + i); + } }catch(IllegalArgumentException e){ Log.err("WARNING: Skipping unit @: @", type.name, e.getMessage()); } From 82348d4fff1a75fcbf53b8017d17ac39be90cfd2 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sun, 8 Nov 2020 14:35:06 -0800 Subject: [PATCH 5/8] update sprite generation + update bullet stats --- core/assets/bundles/bundle.properties | 2 ++ core/src/mindustry/content/UnitTypes.java | 2 ++ .../world/meta/values/AmmoListValue.java | 11 ++++++++++- .../world/meta/values/WeaponListValue.java | 8 ++------ tools/src/mindustry/tools/Generators.java | 17 +++++++++++------ 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 72533e3a3f..ec291c3e34 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -695,12 +695,14 @@ units.processorcontrol = [lightgray]Processor Controlled bullet.damage = [stat]{0}[lightgray] damage bullet.splashdamage = [stat]{0}[lightgray] area dmg ~[stat] {1}[lightgray] tiles bullet.incendiary = [stat]incendiary +bullet.sapping = [stat]sapping bullet.homing = [stat]homing bullet.shock = [stat]shock bullet.frag = [stat]frag bullet.knockback = [stat]{0}[lightgray] knockback bullet.pierce = [stat]{0}[lightgray]x pierce bullet.infinitepierce = [stat]pierce +bullet.healpercent = [stat]{0}[lightgray]% healing bullet.freezing = [stat]freezing bullet.tarred = [stat]tarred bullet.multiplier = [stat]{0}[lightgray]x ammo multiplier diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index c32d4113ed..11c45f097d 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -336,6 +336,8 @@ public class UnitTypes implements ContentList{ lightningLength = 7; lightningLengthRand = 7; shootEffect = Fx.shootHeal; + //Does not actually do anything; Just here to make stats work + healPercent = 2f; lightningType = new BulletType(0.0001f, 0f){{ lifetime = Fx.lightning.lifetime; diff --git a/core/src/mindustry/world/meta/values/AmmoListValue.java b/core/src/mindustry/world/meta/values/AmmoListValue.java index 3900b238bb..a0635e7650 100644 --- a/core/src/mindustry/world/meta/values/AmmoListValue.java +++ b/core/src/mindustry/world/meta/values/AmmoListValue.java @@ -53,10 +53,15 @@ public class AmmoListValue implements StatValue{ sep(bt, Core.bundle.format("bullet.knockback", Strings.fixed(type.knockback, 1))); } - if(type.pierce || type.pierceCap != -1){ + //sap bullets don't really have pierce + if((type.pierce || type.pierceCap != -1) && !(type instanceof SapBulletType)){ sep(bt, type.pierceCap == -1 ? "@bullet.infinitepierce" : Core.bundle.format("bullet.pierce", type.pierceCap)); } + if((type.healPercent > 0f)){ + sep(bt, Core.bundle.format("bullet.healpercent", (int)type.healPercent)); + } + if((type.status == StatusEffects.burning || type.status == StatusEffects.melting) || type.incendAmount > 0){ sep(bt, "@bullet.incendiary"); } @@ -69,6 +74,10 @@ public class AmmoListValue implements StatValue{ sep(bt, "@bullet.tarred"); } + if(type.status == StatusEffects.sapped){ + sep(bt, "@bullet.sapping"); + } + if(type.homingPower > 0.01f){ sep(bt, "@bullet.homing"); } diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java index 5c89deb649..40272a2390 100644 --- a/core/src/mindustry/world/meta/values/WeaponListValue.java +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -34,15 +34,11 @@ public class WeaponListValue implements StatValue{ Weapon weapon = weapons.get(i); if(weapon.flipSprite){ + //fliped weapons are not given stats continue; } - if(weapon.outlineRegion.found()){ - table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top(); - }else{ - table.image(unit.icon(Cicon.full)).size(15 * 8).right().top(); - } - + table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top(); table.table(Tex.underline, w -> { w.left().defaults().padRight(3).left(); diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index e28d11fff8..b4ee8a340b 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -506,30 +506,35 @@ public class Generators{ } //generate weapon stat UI - //TODO: optimize - Image base = new Image(image.width, image.height); + + //largest side calculated here to prevent sprite squishing + int largestSide = Math.max(image.width, image.height); + Image base = new Image(largestSide, largestSide); image.each((x, y) -> { + int newX = x - image.width/2 + base.width/2; + int newY = y - image.height/2 + base.height/2; Color c = image.getColor(x, y); - base.draw(x, y, c.set(c.r, c.g, c.b, c.a * 0.2f)); + base.draw(newX, newY, c.set(c.r, c.g, c.b, c.a * 0.2f)); }); for(int i = 0;i < type.weapons.size;i ++){ Weapon weapon = type.weapons.get(i); if(weapon.flipSprite){ + //fliped weapons are not given stats continue; } weapon.load(); - Image finalBase = base.copy(); + Image baseWithWeapon = base.copy(); - finalBase.draw(outline.get(ImagePacker.get(weapon.region)), + baseWithWeapon.draw(outline.get(ImagePacker.get(weapon.region)), (int)(weapon.x / Draw.scl + base.width / 2f - weapon.region.width / 2f), (int)(-weapon.y / Draw.scl + base.height / 2f - weapon.region.height / 2f), weapon.flipSprite, false); - finalBase.save(type.name + "-weapon" + i); + baseWithWeapon.save(type.name + "-weapon" + i); } }catch(IllegalArgumentException e){ Log.err("WARNING: Skipping unit @: @", type.name, e.getMessage()); From e9c00d8a9f92b8162e2d389633200f69e3e11d4d Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Sun, 8 Nov 2020 17:23:05 -0800 Subject: [PATCH 6/8] remove unused imports --- .../mindustry/world/meta/values/WeaponListValue.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java index 40272a2390..60411447b0 100644 --- a/core/src/mindustry/world/meta/values/WeaponListValue.java +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -1,18 +1,10 @@ package mindustry.world.meta.values; -//TODO: remove unused imports import arc.*; -import arc.graphics.*; -import arc.graphics.g2d.*; -import arc.math.*; +import arc.util.*; import arc.scene.ui.layout.*; import arc.struct.*; -import arc.util.*; -import mindustry.content.*; -import mindustry.ctype.*; -import mindustry.entities.bullet.*; import mindustry.gen.*; -import mindustry.ui.*; import mindustry.type.*; import mindustry.world.meta.*; From 4d3c6879b53b1cb90dfabfc012ed65ff4cc89187 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Wed, 11 Nov 2020 13:27:03 -0800 Subject: [PATCH 7/8] Fix many things --- core/assets/bundles/bundle.properties | 1 - core/src/mindustry/world/meta/Stat.java | 1 - .../world/meta/values/AmmoListValue.java | 14 ++++++-- .../world/meta/values/WeaponListValue.java | 12 ++++--- tools/src/mindustry/tools/Generators.java | 32 ------------------- 5 files changed, 18 insertions(+), 42 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 96b3052e8b..98b25cfdee 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -629,7 +629,6 @@ stat.basepowergeneration = Base Power Generation stat.productiontime = Production Time stat.repairtime = Block Full Repair Time stat.weapons = Weapons -stat.mirrored = Mirrored stat.bullet = Bullet stat.speedincrease = Speed Increase stat.range = Range diff --git a/core/src/mindustry/world/meta/Stat.java b/core/src/mindustry/world/meta/Stat.java index a49b35ea28..8f1d23820b 100644 --- a/core/src/mindustry/world/meta/Stat.java +++ b/core/src/mindustry/world/meta/Stat.java @@ -56,7 +56,6 @@ public enum Stat{ instructions(StatCat.crafting), weapons(StatCat.function), - mirrored(StatCat.function), bullet(StatCat.function), speedIncrease(StatCat.function), diff --git a/core/src/mindustry/world/meta/values/AmmoListValue.java b/core/src/mindustry/world/meta/values/AmmoListValue.java index a0635e7650..2d3688cc72 100644 --- a/core/src/mindustry/world/meta/values/AmmoListValue.java +++ b/core/src/mindustry/world/meta/values/AmmoListValue.java @@ -1,6 +1,7 @@ package mindustry.world.meta.values; import arc.*; +import arc.func.*; import arc.graphics.g2d.*; import arc.math.*; import arc.scene.ui.layout.*; @@ -29,11 +30,12 @@ public class AmmoListValue implements StatValue{ table.row(); for(T t : map.keys()){ BulletType type = map.get(t); + //no point in displaying unit icon twice if(!(t instanceof UnitType)){ table.image(icon(t)).size(3 * 8).padRight(4).right().top(); table.add(t.localizedName).padRight(10).left().top(); } - table.table(Tex.underline, bt -> { + Cons tableCons = bt -> { bt.left().defaults().padRight(3).left(); if(type.damage > 0 && (type.collides || type.splashDamage <= 0)){ @@ -44,7 +46,8 @@ public class AmmoListValue implements StatValue{ sep(bt, Core.bundle.format("bullet.splashdamage", (int)type.splashDamage, Strings.fixed(type.splashDamageRadius / tilesize, 1))); } - if(!Mathf.equal(type.ammoMultiplier, 1f)) + //ammo multiplyers do not make sense for units + if(!(t instanceof UnitType) && !Mathf.equal(type.ammoMultiplier, 1f)) sep(bt, Core.bundle.format("bullet.multiplier", (int)type.ammoMultiplier)); if(!Mathf.equal(type.reloadMultiplier, 1f)) sep(bt, Core.bundle.format("bullet.reload", Strings.fixed(type.reloadMultiplier, 1))); @@ -89,7 +92,12 @@ public class AmmoListValue implements StatValue{ if(type.fragBullet != null){ sep(bt, "@bullet.frag"); } - }).left().padTop(-9); + }; + if(t instanceof UnitType){ + table.table(tableCons); + }else{ + table.table(Tex.underline, tableCons).left().padTop(-9); + } table.row(); } } diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java index 60411447b0..9317a69fab 100644 --- a/core/src/mindustry/world/meta/values/WeaponListValue.java +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -6,6 +6,7 @@ import arc.scene.ui.layout.*; import arc.struct.*; import mindustry.gen.*; import mindustry.type.*; +import mindustry.ui.*; import mindustry.world.meta.*; import static mindustry.Vars.*; @@ -30,15 +31,16 @@ public class WeaponListValue implements StatValue{ continue; } - table.image(Core.atlas.find(unit.name + "-weapon" + i)).size(15 * 8).right().top(); + if(weapon.outlineRegion.found()){ + table.image(weapon.outlineRegion).size(10 * 8).right().top(); + }else{ + table.image(unit.icon(Cicon.full)).size(10 * 8).right().top(); + } table.table(Tex.underline, w -> { w.left().defaults().padRight(3).left(); - sep(w, "[lightgray]" + Stat.mirrored.localized() + ": [white]" + weapon.mirror); sep(w, "[lightgray]" + Stat.inaccuracy.localized() + ": [white]" + (int)weapon.inaccuracy + " " + StatUnit.degrees.localized()); - sep(w, "[lightgray]" + Stat.reload.localized() + ": [white]" + Strings.autoFixed(60f / weapon.reload * weapon.shots, 1)); - sep(w, "[lightgray]" + Stat.targetsAir.localized() + ": [white]" + weapon.bullet.collidesAir); - sep(w, "[lightgray]" + Stat.targetsGround.localized() + ": [white]" + weapon.bullet.collidesGround); + sep(w, "[lightgray]" + Stat.reload.localized() + ": " + (weapon.mirror ? "2x " : "") + "[white]" + Strings.autoFixed(60f / weapon.reload * weapon.shots, 1)); sep(w, "[lightgray]" + Stat.bullet.localized() + ":"); AmmoListValue bullet = new AmmoListValue(OrderedMap.of(unit, weapon.bullet)); diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index b4ee8a340b..1350a0ff24 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -504,38 +504,6 @@ public class Generators{ scaled.save(type.name + "-icon-logic"); } } - - //generate weapon stat UI - - //largest side calculated here to prevent sprite squishing - int largestSide = Math.max(image.width, image.height); - Image base = new Image(largestSide, largestSide); - - image.each((x, y) -> { - int newX = x - image.width/2 + base.width/2; - int newY = y - image.height/2 + base.height/2; - Color c = image.getColor(x, y); - base.draw(newX, newY, c.set(c.r, c.g, c.b, c.a * 0.2f)); - }); - - for(int i = 0;i < type.weapons.size;i ++){ - Weapon weapon = type.weapons.get(i); - - if(weapon.flipSprite){ - //fliped weapons are not given stats - continue; - } - - weapon.load(); - Image baseWithWeapon = base.copy(); - - baseWithWeapon.draw(outline.get(ImagePacker.get(weapon.region)), - (int)(weapon.x / Draw.scl + base.width / 2f - weapon.region.width / 2f), - (int)(-weapon.y / Draw.scl + base.height / 2f - weapon.region.height / 2f), - weapon.flipSprite, false); - - baseWithWeapon.save(type.name + "-weapon" + i); - } }catch(IllegalArgumentException e){ Log.err("WARNING: Skipping unit @: @", type.name, e.getMessage()); } From 636fffc750f8f40891e25711e8e703c6010051e7 Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Thu, 12 Nov 2020 08:37:38 -0800 Subject: [PATCH 8/8] scaling(Scaling.fit) Untested --- core/src/mindustry/world/meta/values/WeaponListValue.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/meta/values/WeaponListValue.java b/core/src/mindustry/world/meta/values/WeaponListValue.java index 9317a69fab..be50d94c29 100644 --- a/core/src/mindustry/world/meta/values/WeaponListValue.java +++ b/core/src/mindustry/world/meta/values/WeaponListValue.java @@ -32,9 +32,9 @@ public class WeaponListValue implements StatValue{ } if(weapon.outlineRegion.found()){ - table.image(weapon.outlineRegion).size(10 * 8).right().top(); + table.image(weapon.outlineRegion).size(10 * 8).scaling(Scaling.fit).right().top(); }else{ - table.image(unit.icon(Cicon.full)).size(10 * 8).right().top(); + table.image(unit.icon(Cicon.full)).size(10 * 8).scaling(Scaling.fit).right().top(); } table.table(Tex.underline, w -> { w.left().defaults().padRight(3).left();