From 85b7602e15c0d731ab3cc4d2354e30dbcb6efc87 Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Tue, 19 Mar 2019 13:36:52 -0700 Subject: [PATCH] Added aura icon color Added aura icon color Added default button state BlendMode Changed level entry image to use BlendMode.DARKEN Added darkenGold color Changed darken colors to be references of existing colors (looks correct) Clicking a SpellsQuickPanel button will hide the panel --- core/src/com/riiablo/Colors.java | 7 ++++--- core/src/com/riiablo/codec/excel/Skills.java | 1 + core/src/com/riiablo/panel/SpellsQuickPanel.java | 5 +++++ core/src/com/riiablo/screen/GameScreen.java | 3 ++- core/src/com/riiablo/widget/Button.java | 13 +++++++++++-- core/src/com/riiablo/widget/HotkeyButton.java | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/core/src/com/riiablo/Colors.java b/core/src/com/riiablo/Colors.java index 61341338..0e42baec 100644 --- a/core/src/com/riiablo/Colors.java +++ b/core/src/com/riiablo/Colors.java @@ -32,9 +32,10 @@ public class Colors { public Color purple = PURPLE.cpy(); public Color c12 = C12.cpy(); - public Color highlight = new Color(0.15f, 0.15f, 0.12f, 0); - public Color darken = new Color(0.40f, 0.40f, 0.40f, 0); - public Color darkenR = new Color(1.00f, 0.20f, 0.20f, 0); + public Color highlight = new Color(0.15f, 0.15f, 0.12f, 0); + public Color darken = new Color(0.40f, 0.40f, 0.40f, 0); + public Color darkenRed = RED.cpy();//new Color(1.00f, 0.20f, 0.20f, 0); + public Color darkenGold = GOLD.cpy(); public Color invBlue = new Color(0.1f, 0.1f, 0.5f, 0.3f); public Color invGreen = new Color(0.1f, 0.5f, 0.1f, 0.3f); diff --git a/core/src/com/riiablo/codec/excel/Skills.java b/core/src/com/riiablo/codec/excel/Skills.java index 2fdd8e7b..4f2e8c87 100644 --- a/core/src/com/riiablo/codec/excel/Skills.java +++ b/core/src/com/riiablo/codec/excel/Skills.java @@ -30,5 +30,6 @@ public class Skills extends Excel { public int Param[]; @Column public boolean leftskill; @Column public boolean passive; + @Column public boolean aura; } } diff --git a/core/src/com/riiablo/panel/SpellsQuickPanel.java b/core/src/com/riiablo/panel/SpellsQuickPanel.java index 13de7112..a1b6ba30 100644 --- a/core/src/com/riiablo/panel/SpellsQuickPanel.java +++ b/core/src/com/riiablo/panel/SpellsQuickPanel.java @@ -14,6 +14,7 @@ import com.riiablo.codec.DC6; import com.riiablo.codec.excel.SkillDesc; import com.riiablo.codec.excel.Skills; import com.riiablo.entity.Player; +import com.riiablo.graphics.BlendMode; import com.riiablo.key.MappedKey; import com.riiablo.key.MappedKeyStateAdapter; import com.riiablo.screen.GameScreen; @@ -64,6 +65,9 @@ public class SpellsQuickPanel extends Table implements Disposable { Table table = tables[desc.ListRow]; if (table == null) table = tables[desc.ListRow] = new Table(); final HotkeyButton button = new HotkeyButton(CharSkillicon, desc.IconCel); + if (skill.aura) { + button.setBlendMode(BlendMode.DARKEN, Riiablo.colors.darkenGold); + } int index = ArrayUtils.indexOf(player.skillBar, i); if (index != ArrayUtils.INDEX_NOT_FOUND) { @@ -81,6 +85,7 @@ public class SpellsQuickPanel extends Table implements Disposable { } else { controlPanel.getRightSkill().copy(button); } + SpellsQuickPanel.this.setVisible(false); } }); table.add(button); diff --git a/core/src/com/riiablo/screen/GameScreen.java b/core/src/com/riiablo/screen/GameScreen.java index 2f6d4a54..0d2e1005 100644 --- a/core/src/com/riiablo/screen/GameScreen.java +++ b/core/src/com/riiablo/screen/GameScreen.java @@ -815,7 +815,8 @@ public class GameScreen extends ScreenAdapter implements LoadingScreen.Loadable enteringImage = new DCWrapper(); enteringImage.setScaling(Scaling.none); enteringImage.setAlign(Align.center); - enteringImage.setBlendMode(BlendMode.TINT_ID_RED); + enteringImage.setBlendMode(BlendMode.DARKEN); + enteringImage.setColor(Riiablo.colors.darkenRed); stage.addActor(enteringImage); } diff --git a/core/src/com/riiablo/widget/Button.java b/core/src/com/riiablo/widget/Button.java index 28ac263c..073e33bb 100644 --- a/core/src/com/riiablo/widget/Button.java +++ b/core/src/com/riiablo/widget/Button.java @@ -23,6 +23,9 @@ public class Button extends com.badlogic.gdx.scenes.scene2d.ui.Button implements int highlightedBlendMode = BlendMode.BRIGHTEN; Color highlightedColor = Riiablo.colors.highlight; + int blendMode = BlendMode.ID; + Color color = Riiablo.colors.white; + @Override public void setStyle(com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle style) { super.setStyle(style); @@ -53,6 +56,11 @@ public class Button extends com.badlogic.gdx.scenes.scene2d.ui.Button implements }); } + public void setBlendMode(int blendMode, Color color) { + this.blendMode = blendMode; + this.color = color; + } + public void setDisabledBlendMode(int blendMode, Color color) { disabledBlendMode = blendMode; disabledColor = color; @@ -88,10 +96,11 @@ public class Button extends com.badlogic.gdx.scenes.scene2d.ui.Button implements setColor(highlightedColor); batch.setBlendMode(highlightedBlendMode); } else { - setColor(Color.WHITE); + setColor(color); + batch.setBlendMode(blendMode); } super.draw(batch, parentAlpha); - if (disabled || over) batch.resetBlendMode(); + batch.resetBlendMode(); } public static class ButtonStyle extends com.badlogic.gdx.scenes.scene2d.ui.Button.ButtonStyle { diff --git a/core/src/com/riiablo/widget/HotkeyButton.java b/core/src/com/riiablo/widget/HotkeyButton.java index b31cd309..913cb207 100644 --- a/core/src/com/riiablo/widget/HotkeyButton.java +++ b/core/src/com/riiablo/widget/HotkeyButton.java @@ -25,7 +25,7 @@ public class HotkeyButton extends Button { pad(2); pack(); - setDisabledBlendMode(BlendMode.DARKEN, Riiablo.colors.darkenR); + setDisabledBlendMode(BlendMode.DARKEN, Riiablo.colors.darkenRed); } public void map(MappedKey mapping) {