public void SetMoveButton( PBS.Battle.View.WifiFriendly.Pokemon pokemon, PBS.Battle.View.Events.CommandAgent.Moveslot moveslot, Panels.FightButton moveBtn, bool choosingZMove = false, bool choosingMaxMove = false) { MoveData moveData = MoveDatabase.instance.GetMoveData(moveslot.moveID); moveBtn.moveslot = moveslot; if (!moveslot.hide) { TypeData typeData = TypeDatabase.instance.GetTypeData(moveData.moveType); Color typeColor = Color.clear; ColorUtility.TryParseHtmlString(typeData.typeColor, out typeColor); moveBtn.moveTxt.text = moveData.moveName; moveBtn.ppTxt.text = moveslot.PP + "/" + moveslot.maxPP; moveBtn.typeTxt.text = typeData.typeName; moveBtn.typeTxt.color = typeColor; moveBtn.moveID = moveData.ID; moveBtn.colorSel = new Color(typeColor.r, typeColor.g, typeColor.b, 0.75f); } else { moveBtn.moveTxt.text = ""; moveBtn.ppTxt.text = ""; moveBtn.typeTxt.text = ""; moveBtn.moveID = ""; } moveBtn.UnselectSelf(); }
public void HighlightMove(int moveIndex) { Panels.FightButton selectedBtn = null; if (moveIndex == 0) { selectedBtn = move1Btn; } else { move1Btn.UnselectSelf(); } if (moveIndex == 1) { selectedBtn = move2Btn; } else { move2Btn.UnselectSelf(); } if (moveIndex == 2) { selectedBtn = move3Btn; } else { move3Btn.UnselectSelf(); } if (moveIndex == 3) { selectedBtn = move4Btn; } else { move4Btn.UnselectSelf(); } if (selectedBtn != null) { selectedBtn.SelectSelf(); backBtn.UnselectSelf(); if (selectedBtn.moveslot.hide) { promptText.text = "This move can't be selected..."; } else { MoveData moveData = MoveDatabase.instance.GetMoveData(selectedBtn.moveID); TypeData typeData = TypeDatabase.instance.GetTypeData(moveData.moveType); Color typeColor = Color.clear; ColorUtility.TryParseHtmlString(typeData.typeColor, out typeColor); string moveText = "<color=" + typeData.typeColor + ">" + typeData.typeName + "</color>\n"; moveText += moveData.category.ToString() + " / "; moveText += (selectedBtn.moveslot.basePower > 0) ? selectedBtn.moveslot.basePower + " BP / " : ""; moveText += (selectedBtn.moveslot.accuracy > 0) ? (Mathf.FloorToInt(selectedBtn.moveslot.accuracy * 100)) + "% ACC" : "Never Misses"; promptText.text = moveText; } } }