Coal centrifuge / In-game chat / Player health rule / Bugfixes
This commit is contained in:
@@ -45,6 +45,7 @@ public class CustomRulesDialog extends FloatingDialog{
|
||||
number("$rules.buildspeedmultiplier", f -> rules.buildSpeedMultiplier = f, () -> rules.buildSpeedMultiplier);
|
||||
number("$rules.unitbuildspeedmultiplier", f -> rules.unitBuildSpeedMultiplier = f, () -> rules.unitBuildSpeedMultiplier);
|
||||
number("$rules.unithealthmultiplier", f -> rules.unitHealthMultiplier = f, () -> rules.unitHealthMultiplier);
|
||||
number("$rules.playerhealthmultiplier", f -> rules.playerHealthMultiplier = f, () -> rules.playerHealthMultiplier);
|
||||
number("$rules.playerdamagemultiplier", f -> rules.playerDamageMultiplier = f, () -> rules.playerDamageMultiplier);
|
||||
number("$rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier);
|
||||
number("$rules.enemycorebuildradius", f -> rules.enemyCoreBuildRadius = f * tilesize, () -> Math.min(rules.enemyCoreBuildRadius / tilesize, 200));
|
||||
|
||||
@@ -178,6 +178,8 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
});
|
||||
|
||||
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Core.bundle.get("setting.fpscap.none") : Core.bundle.format("setting.fpscap.text", s)));
|
||||
graphics.sliderPref("chatopacity", 100, 0, 100, 5, s -> s + "%");
|
||||
|
||||
|
||||
if(!mobile){
|
||||
graphics.sliderPref("antialias", 0, 0, 5, 1, s -> (s == 0 ? 0 : (1 << s)) + "x");
|
||||
@@ -209,6 +211,7 @@ public class SettingsMenuDialog extends SettingsDialog{
|
||||
}
|
||||
}
|
||||
|
||||
graphics.checkPref("playerchat", true);
|
||||
graphics.checkPref("minimap", !mobile);
|
||||
graphics.checkPref("fps", false);
|
||||
graphics.checkPref("indicators", true);
|
||||
|
||||
@@ -123,6 +123,7 @@ public class ChatFragment extends Table{
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
float opacity = Core.settings.getInt("chatopacity") / 100f;
|
||||
|
||||
Draw.color(shadowColor);
|
||||
|
||||
@@ -138,6 +139,7 @@ public class ChatFragment extends Table{
|
||||
fieldlabel.visible(chatOpen);
|
||||
|
||||
Draw.color(shadowColor);
|
||||
Draw.alpha(shadowColor.a * opacity);
|
||||
|
||||
float theight = offsety + spacing + getMarginBottom();
|
||||
for(int i = scrollPos; i < messages.size && i < messagesShown + scrollPos && (i < fadetime || chatOpen); i++){
|
||||
@@ -150,12 +152,15 @@ public class ChatFragment extends Table{
|
||||
font.getCache().addText(messages.get(i).formattedMessage, fontoffsetx + offsetx, offsety + theight, textWidth, Align.bottomLeft, true);
|
||||
|
||||
if(!chatOpen && fadetime - i < 1f && fadetime - i >= 0f){
|
||||
font.getCache().setAlphas(fadetime - i);
|
||||
Draw.color(0, 0, 0, shadowColor.a * (fadetime - i));
|
||||
font.getCache().setAlphas((fadetime - i) * opacity);
|
||||
Draw.color(0, 0, 0, shadowColor.a * (fadetime - i) * opacity);
|
||||
}else{
|
||||
font.getCache().setAlphas(opacity);
|
||||
}
|
||||
|
||||
Fill.crect(offsetx, theight - layout.height - 2, textWidth + Unit.dp.scl(4f), layout.height + textspacing);
|
||||
Draw.color(shadowColor);
|
||||
Draw.alpha(opacity * shadowColor.a);
|
||||
|
||||
font.getCache().draw();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user