Reduced texture bindings with chat open
This commit is contained in:
@@ -298,7 +298,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
Map map = save();
|
Map map = save();
|
||||||
|
|
||||||
if(map != null){
|
if(map != null){
|
||||||
//skip dialog, play with survival or attack when shift clicked
|
//skip dialog, play immediately when shift clicked
|
||||||
if(Core.input.shift()){
|
if(Core.input.shift()){
|
||||||
hide();
|
hide();
|
||||||
//auto pick best fit
|
//auto pick best fit
|
||||||
@@ -309,8 +309,6 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
);
|
);
|
||||||
}else{
|
}else{
|
||||||
playtestDialog.playListener = this::hide;
|
playtestDialog.playListener = this::hide;
|
||||||
//TODO skip dialog? or reuse
|
|
||||||
//TODO set playtesting map, do not create save.
|
|
||||||
playtestDialog.show(map, true);
|
playtestDialog.show(map, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,11 @@ public class ChatFragment extends Table{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void rect(float x, float y, float w, float h){
|
||||||
|
//prevents texture bindings; the string lookup is irrelevant as it is only called <10 times per frame, and maps are very fast anyway
|
||||||
|
Draw.rect("whiteui", x + w/2f, y + h/2f, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
float opacity = Core.settings.getInt("chatopacity") / 100f;
|
float opacity = Core.settings.getInt("chatopacity") / 100f;
|
||||||
@@ -128,7 +133,7 @@ public class ChatFragment extends Table{
|
|||||||
Draw.color(shadowColor);
|
Draw.color(shadowColor);
|
||||||
|
|
||||||
if(shown){
|
if(shown){
|
||||||
Fill.crect(offsetx, chatfield.y + scene.marginBottom, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
rect(offsetx, chatfield.y + scene.marginBottom, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.draw();
|
super.draw();
|
||||||
@@ -159,7 +164,7 @@ public class ChatFragment extends Table{
|
|||||||
font.getCache().setAlphas(opacity);
|
font.getCache().setAlphas(opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
Fill.crect(offsetx, theight - layout.height - 2, textWidth + Scl.scl(4f), layout.height + textspacing);
|
rect(offsetx, theight - layout.height - 2, textWidth + Scl.scl(4f), layout.height + textspacing);
|
||||||
Draw.color(shadowColor);
|
Draw.color(shadowColor);
|
||||||
Draw.alpha(opacity * shadowColor.a);
|
Draw.alpha(opacity * shadowColor.a);
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,10 @@ public class ScriptConsoleFragment extends Table{
|
|||||||
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
add(chatfield).padBottom(offsety).padLeft(offsetx).growX().padRight(offsetx).height(28);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void rect(float x, float y, float w, float h){
|
||||||
|
Draw.rect("whiteui", x + w/2f, y + h/2f, w, h);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
float opacity = 1f;
|
float opacity = 1f;
|
||||||
@@ -112,7 +116,7 @@ public class ScriptConsoleFragment extends Table{
|
|||||||
Draw.color(shadowColor);
|
Draw.color(shadowColor);
|
||||||
|
|
||||||
if(open){
|
if(open){
|
||||||
Fill.crect(offsetx, chatfield.y + scene.marginBottom, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
rect(offsetx, chatfield.y + scene.marginBottom, chatfield.getWidth() + 15f, chatfield.getHeight() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
super.draw();
|
super.draw();
|
||||||
@@ -143,7 +147,7 @@ public class ScriptConsoleFragment extends Table{
|
|||||||
font.getCache().setAlphas(opacity);
|
font.getCache().setAlphas(opacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
Fill.crect(offsetx, theight - layout.height - 2, textWidth + Scl.scl(4f), layout.height + textspacing);
|
rect(offsetx, theight - layout.height - 2, textWidth + Scl.scl(4f), layout.height + textspacing);
|
||||||
Draw.color(shadowColor);
|
Draw.color(shadowColor);
|
||||||
Draw.alpha(opacity * shadowColor.a);
|
Draw.alpha(opacity * shadowColor.a);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user