add new sprite

This commit is contained in:
Sharlotte
2021-07-19 16:41:24 +09:00
parent 87de3b9f30
commit d72b9cd208
9 changed files with 12 additions and 3 deletions

View File

@@ -288,6 +288,7 @@ public class Setting {
addGraphicCheckSetting("select", false);
addGraphicCheckSetting("unithealthui", true);
addGraphicCheckSetting("ssim", false);
addGraphicCheckSetting("shar", false);
addGraphicCheckSetting("gaycursor", false);
}
}

View File

@@ -58,6 +58,7 @@ public class SBar extends Element{
boolean valid = true;
if(fraction == null || !valid) return;
boolean ssim = Core.settings.getBool("ssim");
boolean shar = Core.settings.getBool("shar");
float computed;
try{
@@ -81,12 +82,16 @@ public class SBar extends Element{
blink = Mathf.lerpDelta(blink, 0f, 0.2f);
value = Mathf.lerpDelta(value, computed, 0.05f);
NinePatchDrawable bar = ssim ? (NinePatchDrawable) drawable("unitinfo-barSS", 14, 14, 19, 19) : (NinePatchDrawable) drawable("unitinfo-barS", 10, 10, 9, 9);
NinePatchDrawable bar = (NinePatchDrawable) drawable("unitinfo-barS", 10, 10, 9, 9);
if(ssim) bar = (NinePatchDrawable) drawable("unitinfo-barSS", 14, 14, 19, 19);
if(shar) bar = (NinePatchDrawable) drawable("unitinfo-barSSS", 25, 25, 17, 17);
Draw.colorl(0.1f);
bar.draw(x, y, width, height);
Draw.color(color.cpy().mul(Pal.lightishGray), blinkColor, blink);
NinePatchDrawable top = ssim ? (NinePatchDrawable) drawable("unitinfo-barSS-top", 14, 14, 19, 19) : (NinePatchDrawable) drawable("unitinfo-barS-top", 10, 10, 9, 9);
NinePatchDrawable top = (NinePatchDrawable) drawable("unitinfo-barS-top", 10, 10, 9, 9);
if(ssim) top = (NinePatchDrawable) drawable("unitinfo-barSS-top", 14, 14, 19, 19);
if(shar) top = (NinePatchDrawable) drawable("unitinfo-barSSS-top", 25, 25, 17, 17);
float topWidth = width * value;
if(topWidth > (ssim ? Core.atlas.find("unitinfo-barSS-top").width : Core.atlas.find("unitinfo-barS-top").width)){