From 52d4b94103af674ac9f8e7e109ac9adac782cb5b Mon Sep 17 00:00:00 2001 From: sharlottes <60801210+sharlottes@users.noreply.github.com> Date: Mon, 31 May 2021 21:54:54 +0900 Subject: [PATCH] ssim bar --- assets/bundles/bundle.properties | 1 + assets/bundles/bundle_ko.properties | 1 + assets/sprites/ui/bar-top.9.png | Bin 258 -> 0 bytes assets/sprites/ui/bar.9.png | Bin 243 -> 0 bytes assets/sprites/ui/barSS-top.png | Bin 0 -> 270 bytes assets/sprites/ui/barSS.png | Bin 0 -> 284 bytes src/UnitInfo/core/Setting.java | 2 ++ src/UnitInfo/ui/SBar.java | 17 +++++++++-------- 8 files changed, 13 insertions(+), 8 deletions(-) delete mode 100644 assets/sprites/ui/bar-top.9.png delete mode 100644 assets/sprites/ui/bar.9.png create mode 100644 assets/sprites/ui/barSS-top.png create mode 100644 assets/sprites/ui/barSS.png diff --git a/assets/bundles/bundle.properties b/assets/bundles/bundle.properties index 766e093..1c02193 100644 --- a/assets/bundles/bundle.properties +++ b/assets/bundles/bundle.properties @@ -14,6 +14,7 @@ shar-stat.break = [red] broke [orange]{0}.[][] shar-stat.build = [green] built [orange]{0}.[][] # Settings +setting.ssim.name = Change Bar style [lightgray](made by ssim)[] setting.select.name = Display select Arrow setting.gaycursor.name = Enable mouse trail effect. only for desktop setting.wavemax.name = Wave Amount to display diff --git a/assets/bundles/bundle_ko.properties b/assets/bundles/bundle_ko.properties index 899bd09..9cee4a0 100644 --- a/assets/bundles/bundle_ko.properties +++ b/assets/bundles/bundle_ko.properties @@ -14,6 +14,7 @@ shar-stat.break = [lightgray] 가 [orange]{0}[]를 [red]철거[]했습니다.[] shar-stat.build = [lightgray] 가 [orange]{0}[]를 [green]건설[]했습니다.[] # Settings +setting.ssim.name = 바 스타일 변경 [lightgray](ssim님이 만듬)[] setting.select.name = 선택 화살표 표시 setting.gaycursor.name = PC 전용 마우스 꼬리효과 setting.wavemax.name = 표시할 단계 수 diff --git a/assets/sprites/ui/bar-top.9.png b/assets/sprites/ui/bar-top.9.png deleted file mode 100644 index c5049fe8a463f4568192b1c6992a35e2bacb8e8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^vOuiH!3-q%KO_VLDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheoB=)|t_P2t|Ns9#kSB52=qiw6E(!7r1`1q1#S2u+z**oCSU$M;32HrneGH*;^ z(s|>Q`nBTZ4$029vkWWeXtTZExOj7oXwz-R-cZAJe^1p$WN+JFpWu3R5<8#njSD5o w3MGl|*E^Y=ry9Qrnz=F2_n6Mb;?>{93(8p5o8H$f1zOMG>FVdQ&MBb@0JXeb&;S4c diff --git a/assets/sprites/ui/bar.9.png b/assets/sprites/ui/bar.9.png deleted file mode 100644 index f2697f56ca6b5a80e5443bdf4f4970822e061348..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^vOuiH!3-q%KO_VLDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheYymzYuK)l42QotsU9JOCOeH~n!T%YaZa44(@;D1TB8wRq_zr_Ga|ZZ?xc>kD|KO4HK;E>tE9^juxg^Lh`2T-~>!)~uY8f~SJR*x382Ao> zFr%o3R|8P6-qXb~#KQmVNl(551{}^8C;XP*)%7;u#1*~I;tD^fR_PRf{I#Ip#e-X3 zNW*W3$L4n4OP3_FlyjFJwY!m*YF%{M)_J?n-Hj!OW3Rv2^(6fNCYG~03BuXo%GvLD z*IYfF6Sen9nQ{NTif?BYv$Ll6d*#U;I&$LVPJ_Y%-Zh^$Mae%}!LoTpa`6qIQy4s5 L{an^LB{Ts5wIyYY literal 0 HcmV?d00001 diff --git a/assets/sprites/ui/barSS.png b/assets/sprites/ui/barSS.png new file mode 100644 index 0000000000000000000000000000000000000000..18da8e56b75bce80860f32201b57b28cff72a381 GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0vp^azL!X!3-qto!zAXq!^2X+?^QKos)S9vjzBsxc>kDAIJlF_i@Q1^;Jwy4}DF$m1;Vh%9Dc;5!7ujG`J| z4M4$(o-U3d7XDW|9fb}n@Em#YfBw3?+QJ^TGi9P>KPdJ7JTde5B9`z8EXUjh4tTA1 z(0>vl^u*0;`?|FHGmrC&BeJGnwknGZ(>)M-;}!1&?ltGb^-k|ieR8`;Z^P7$+_z7i z;J)d=ynUhA6Nk4JTFHDXCJL%wxqmKqd0O7C=mo7YD>(d3JS5E=Z_M~LfvLr^-u&4g Z29DiK!t&*TSAmXW@O1TaS?83{1OOG|XF>n~ literal 0 HcmV?d00001 diff --git a/src/UnitInfo/core/Setting.java b/src/UnitInfo/core/Setting.java index d0d5d36..a8289b8 100644 --- a/src/UnitInfo/core/Setting.java +++ b/src/UnitInfo/core/Setting.java @@ -149,6 +149,7 @@ public class Setting { boolean tmp = Core.settings.getBool("uiscalechanged", false); Core.settings.put("uiscalechanged", false); + addGraphicSetting("ssim"); addGraphicSetting("gaycursor"); addGraphicSetting("panfix"); addGraphicSetting("scan"); @@ -165,6 +166,7 @@ public class Setting { ui.settings.graphics.sliderPref("baropacity", 100, 0, 100, 5, s -> s + "%"); ui.settings.graphics.sliderPref("uiopacity", 50, 0, 100, 5, s -> s + "%"); + Core.settings.defaults("ssim", false); Core.settings.defaults("select", false); Core.settings.defaults("gaycursor", true); Core.settings.defaults("panfix", false); diff --git a/src/UnitInfo/ui/SBar.java b/src/UnitInfo/ui/SBar.java index 24b9cd5..adc2e36 100644 --- a/src/UnitInfo/ui/SBar.java +++ b/src/UnitInfo/ui/SBar.java @@ -84,12 +84,12 @@ public class SBar extends Element{ return this; } - public Drawable drawable(String name){ + public Drawable drawable(String name, int left, int right, int top, int bottom){ Drawable out; TextureAtlas.AtlasRegion region = Core.atlas.find(name); - int[] splits = {10,10,9,9}; + int[] splits = {left, right, top, bottom}; NinePatch patch = new NinePatch(region, splits[0], splits[1], splits[2], splits[3]); int[] pads = region.pads; if(pads != null) patch.setPadding(pads[0], pads[1], pads[2], pads[3]); @@ -101,6 +101,7 @@ public class SBar extends Element{ @Override public void draw(){ if(fraction == null || !valid) return; + boolean ssim = Core.settings.getBool("ssim"); float computed; try{ @@ -124,19 +125,19 @@ public class SBar extends Element{ blink = Mathf.lerpDelta(blink, 0f, 0.2f); value = Mathf.lerpDelta(value, computed, 0.05f); - NinePatchDrawable bar = (NinePatchDrawable) drawable("unitinfo-barS"); + NinePatchDrawable bar = ssim ? (NinePatchDrawable) drawable("unitinfo-barSS", 14, 14, 19, 19) : (NinePatchDrawable) drawable("unitinfo-barS", 10, 10, 9, 9); Draw.colorl(0.1f); bar.draw(x, y, width, height); Draw.color(color.cpy().mul(Pal.lightishGray), blinkColor, blink); - NinePatchDrawable top = (NinePatchDrawable) drawable("unitinfo-barS-top"); + NinePatchDrawable top = ssim ? (NinePatchDrawable) drawable("unitinfo-barSS-top", 14, 14, 19, 19) : (NinePatchDrawable) drawable("unitinfo-barS-top", 10, 10, 9, 9); float topWidth = width * value; - if(topWidth > Core.atlas.find("unitinfo-bar-top").width){ + if(topWidth > (ssim ? Core.atlas.find("unitinfo-barSS-top").width : Core.atlas.find("unitinfo-barS-top").width)){ top.draw(x, y, topWidth, height); }else{ if(ScissorStack.push(scissor.set(x, y, topWidth, height))){ - top.draw(x, y, Core.atlas.find("unitinfo-bar-top").width, height); + top.draw(x, y, (ssim ? Core.atlas.find("unitinfo-barSS-top").width : Core.atlas.find("unitinfo-barS-top").width), height); ScissorStack.pop(); } } @@ -144,11 +145,11 @@ public class SBar extends Element{ Draw.color(color, blinkColor, blink); float topWidthReal = width * (Math.min(value, computed)); - if(topWidthReal > Core.atlas.find("unitinfo-bar-top").width){ + if(topWidthReal > (ssim ? Core.atlas.find("unitinfo-barSS-top").width : Core.atlas.find("unitinfo-barS-top").width)){ top.draw(x, y, topWidthReal, height); }else{ if(ScissorStack.push(scissor.set(x, y, topWidthReal, height))){ - top.draw(x, y, Core.atlas.find("unitinfo-bar-top").width, height); + top.draw(x, y, (ssim ? Core.atlas.find("unitinfo-barSS-top").width : Core.atlas.find("unitinfo-barS-top").width), height); ScissorStack.pop(); } }