Skip to content
Snippets Groups Projects
Commit 25e16e1b authored by Matyáš Latner's avatar Matyáš Latner
Browse files

Victory dialogs buttons better font and text size

parent 3a03b416
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,8 @@ import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Stack;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Align;
import net.engio.mbassy.listener.Handler;
......@@ -109,6 +111,10 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
public static final String VICTORY_DIALOG_SUMMARY_ICON_TIME = "time";
private static final String VICTORY_DIALOG_TUTORIAL_TEXT = "victoryscreen_text_tutorial";
private static final float VICTORY_DIALOG_BUTTON_TEXT_SCALE = 0.7f;
private static final String VICTORY_DIALOG_BUTTON_TEXT_FONT_TYPE = ApplicationFontManager.APPLICATION_DEFAULT_FONT_BOLD;
private static final Color VICTORY_DIALOG_BUTTON_TEXT_FONT_COLOR = Color.BLACK;
private static final int VICTORY_DIALOG_SHOW_SOUND_DELAY = 2;
private static final String VICTORY_DIALOG_TEXT_FONT_TYPE = ApplicationFontManager.APPLICATION_DEFAULT_FONT_REGULAR;
......@@ -552,6 +558,13 @@ public abstract class AbstractTablexiaGame<T> extends AbstractTablexiaScreen<T>
return this;
}
@Override
public void createButton(TextButton textButton, ClickListener clickListener) {
textButton.getLabel().setStyle(new Label.LabelStyle(ApplicationFontManager.getInstance().getFont(VICTORY_DIALOG_BUTTON_TEXT_FONT_TYPE), VICTORY_DIALOG_BUTTON_TEXT_FONT_COLOR));
textButton.getLabel().setFontScale(VICTORY_DIALOG_BUTTON_TEXT_SCALE);
super.createButton(textButton, clickListener);
}
@Override
public void hide(Action action) {
if (victorySpeech != null) {
......
......@@ -73,8 +73,8 @@ public class TablexiaButton extends TextButton {
}
public TablexiaButton(NinePatchDrawable npdUp, NinePatchDrawable npdDown, NinePatchDrawable npdDis, NinePatchDrawable solarizedBackground, String buttonText) {
super(buttonText, getButtonStyle(npdUp, npdDown, npdDis));
super(buttonText, new TextButton.TextButtonStyle(npdUp, npdDown, npdDis, ApplicationFontManager.getInstance().getFont(DEFAULT_BUTTON_TEXT_FONT)));
getStyle().fontColor = DEFAULT_BUTTON_TEXT_COLOR;
if (solarizedBackground != null) {
solarizedBackgroundImage = new Image(solarizedBackground);
solarizedBackgroundImage.setSize(getWidth(), getHeight());
......@@ -110,12 +110,6 @@ public class TablexiaButton extends TextButton {
}
}
private static TextButton.TextButtonStyle getButtonStyle(NinePatchDrawable npdUp, NinePatchDrawable npdDown, NinePatchDrawable npdDis){
TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle(npdUp, npdDown, npdDis, ApplicationFontManager.getInstance().getFont(DEFAULT_BUTTON_TEXT_FONT));
textButtonStyle.fontColor = DEFAULT_BUTTON_TEXT_COLOR;
return textButtonStyle;
}
public void highliteButton(boolean enable) {
if (solarizedBackgroundImage != null) {
if (enable) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment