void Awake() { optionEnabled.normalColor = new Color32(255, 255, 255, 255); optionEnabled.highlightedColor = new Color32(255, 255, 255, 255); optionEnabled.pressedColor = new Color32(255, 255, 255, 200); optionEnabled.disabledColor = new Color32(61, 61, 61, 255); optionEnabled.colorMultiplier = 1; tutorialYes.SetColorBlock("normal", b.colors); // for some reason this is all bugged, so need to set the normal colour block tutorialNo.SetColorBlock("normal", b.colors); tutorialYes.SetColorBlock("na0", optionEnabled); tutorialNo.SetColorBlock("na0", optionEnabled); tipsYes.SetColorBlock("normal", b.colors); tipsNo.SetColorBlock("normal", b.colors); tipsYes.SetColorBlock("na0", optionEnabled); tipsNo.SetColorBlock("na0", optionEnabled); as1.SetColorBlock("normal", b.colors); as2.SetColorBlock("normal", b.colors); as1.SetColorBlock("na0", optionEnabled); as2.SetColorBlock("na0", optionEnabled); timerYes.SetColorBlock("normal", b.colors); timerNo.SetColorBlock("normal", b.colors); timerYes.SetColorBlock("na0", optionEnabled); timerNo.SetColorBlock("na0", optionEnabled); fullscreenYes.SetColorBlock("normal", b.colors); fullscreenNo.SetColorBlock("normal", b.colors); fullscreenYes.SetColorBlock("na0", optionEnabled); fullscreenNo.SetColorBlock("na0", optionEnabled); bgmtt.SetKey("title", "bgm_title"); bgmtt.SetKey("subtitle", "bgm_des"); sfxtt.SetKey("title", "sfx_title"); sfxtt.SetKey("subtitle", "sfx_des"); tutorialtt.SetKey("title", "tutorial_title"); tutorialtt.SetKey("subtitle", "tutorial_des"); tipstt.SetKey("title", "tips_title"); tipstt.SetKey("subtitle", "tips_des"); animationSpeedtt.SetKey("title", "as_title"); animationSpeedtt.SetKey("subtitle", "as_des"); timertt.SetKey("title", "timer_title"); timertt.SetKey("subtitle", "timer_des"); fullscreentt.SetKey("title", "fullscreen_title"); fullscreentt.SetKey("subtitle", "fullscreen_des"); resolutiontt.SetKey("title", "resolution_title"); resolutiontt.SetKey("subtitle", "resolution_des"); bgmtt.SetImageDisplayBackgroundWidth(labelWidthsBig); sfxtt.SetImageDisplayBackgroundWidth(labelWidthsBig); tutorialtt.SetImageDisplayBackgroundWidth(labelWidths); tipstt.SetImageDisplayBackgroundWidth(labelWidths); animationSpeedtt.SetImageDisplayBackgroundWidth(labelWidthsBig); timertt.SetImageDisplayBackgroundWidth(labelWidths); fullscreentt.SetImageDisplayBackgroundWidth(labelWidths); resolutiontt.SetImageDisplayBackgroundWidth(labelWidths); }
private bool selectButtonEnabled = false; /// <value> Select button will only move to next scene if a class is selected </value> /// <summary> /// Awake to intialize eventSystem and select button's alternate colour blocks /// </summary> void Awake() { ColorBlock sbEnabledBlock = selectButton.colors; ColorBlock btsPressedBlock = selectButton.colors; // arbitrary, just need a color block ColorBlock btsNormalBlock = selectButton.colors; // arbitrary, just need a color block sbEnabledBlock.normalColor = new Color32(255, 255, 255, 100); sbEnabledBlock.highlightedColor = new Color32(133, 133, 133, 255); sbEnabledBlock.pressedColor = new Color32(255, 255, 255, 255); btsPressedBlock.normalColor = new Color32(255, 255, 255, 255); btsPressedBlock.highlightedColor = new Color32(255, 255, 255, 255); btsPressedBlock.pressedColor = new Color32(255, 255, 255, 255); btsPressedBlock.disabledColor = new Color32(61, 61, 61, 255); foreach (ButtonTransitionState bts in compBtss) { bts.SetColorBlock("normal", btsNormalBlock); bts.SetColorBlock("na0", btsPressedBlock); } foreach (ButtonTransitionState bts in classBtss) { bts.SetColorBlock("normal", btsNormalBlock); bts.SetColorBlock("na0", btsPressedBlock); } warriorIcon = Resources.Load <Sprite>("Sprites/Classes/WarriorIcon"); mageIcon = Resources.Load <Sprite>("Sprites/Classes/MageIcon"); archerIcon = Resources.Load <Sprite>("Sprites/Classes/ArcherIcon"); rogueIcon = Resources.Load <Sprite>("Sprites/Classes/RogueIcon"); sbBts.SetColorBlock("na0", sbEnabledBlock); }
private float lerpSpeed = 3f; /// <value> Speed at which aciton text fades in </value> /// <summary> /// Awake to get all components attached to the Action button /// </summary> void Awake() { b = GetComponent <Button>(); bts = GetComponent <ButtonTransitionState>(); img = GetComponent <Image>(); t = GetComponentInChildren <TextMeshProUGUI>(); ColorBlock normalBlock = b.colors; ColorBlock unusableBlock = b.colors; ColorBlock highlightedBlock = b.colors; ColorBlock disabledBlock = b.colors; ColorBlock STRBlock = b.colors; ColorBlock DEXBlock = b.colors; ColorBlock INTBlock = b.colors; ColorBlock LUKBlock = b.colors; unusableBlock.normalColor = new Color32(196, 36, 48, 255); unusableBlock.highlightedColor = new Color32(255, 0, 64, 255); unusableBlock.pressedColor = new Color32(120, 36, 48, 255); unusableBlock.disabledColor = new Color32(120, 36, 48, 255); disabledBlock.normalColor = disabledBlock.disabledColor; disabledBlock.highlightedColor = disabledBlock.disabledColor; disabledBlock.pressedColor = disabledBlock.disabledColor; highlightedBlock.normalColor = normalBlock.pressedColor; STRBlock.normalColor = new Color32(185, 29, 0, 125); STRBlock.highlightedColor = new Color32(185, 29, 0, 175); STRBlock.pressedColor = new Color32(185, 29, 0, 255); STRBlock.disabledColor = new Color32(61, 61, 61, 255); DEXBlock.normalColor = new Color32(90, 197, 79, 125); DEXBlock.highlightedColor = new Color32(90, 197, 79, 175); DEXBlock.pressedColor = new Color32(90, 197, 79, 255); DEXBlock.disabledColor = new Color32(90, 197, 79, 255); INTBlock.normalColor = new Color32(0, 152, 220, 125); INTBlock.highlightedColor = new Color32(0, 152, 220, 175); INTBlock.pressedColor = new Color32(0, 152, 220, 255); INTBlock.disabledColor = new Color32(61, 61, 61, 255); LUKBlock.normalColor = new Color32(255, 205, 2, 125); LUKBlock.highlightedColor = new Color32(255, 205, 2, 175); LUKBlock.pressedColor = new Color32(255, 205, 2, 255); LUKBlock.disabledColor = new Color32(61, 61, 61, 255); bts.SetColorBlock("normal", normalBlock); bts.SetColorBlock("na0", unusableBlock); bts.SetColorBlock("na1", STRBlock); bts.SetColorBlock("na2", DEXBlock); bts.SetColorBlock("na3", INTBlock); bts.SetColorBlock("na4", LUKBlock); bts.SetColorBlock("highlighted", highlightedBlock); bts.SetColorBlock("disabled", disabledBlock); }
private TextMeshProUGUI t; /// <value> Text display </value> /// <summary> /// Awake to get all components attached to the Action button /// </summary> void Awake() { b = GetComponent <Button>(); bts = GetComponent <ButtonTransitionState>(); img = GetComponent <Image>(); t = GetComponentInChildren <TextMeshProUGUI>(); ColorBlock normalBlock = b.colors; ColorBlock unusableBlock = b.colors; unusableBlock.normalColor = new Color32(196, 36, 48, 255); unusableBlock.highlightedColor = new Color32(255, 0, 64, 255); unusableBlock.pressedColor = new Color32(120, 36, 48, 255); unusableBlock.disabledColor = new Color32(120, 36, 48, 255); bts.SetColorBlock("normal", normalBlock); bts.SetColorBlock("normalAlternate", unusableBlock); }
/// <summary> /// Sets the alternate colour block scheme for the monster's selection button (and tooltip) /// (used to show this monster is a target of an area of effect attack) /// </summary> public void SetButtonColourBlock() { ColorBlock aoeSelectBlock = b.colors; if (PartyManager.instance.GetHighestPartyMemberLVL() < displayedMonster.LVL) { ColorBlock normalBlock = b.colors; ColorBlock highlightedBlock = b.colors; ColorBlock pressedBlock = b.colors; t.SetBackgroundColour(UIManager.instance.tooltipDangerColour); t.SetColour("subtitle", UIManager.instance.tooltipDangerColourVibrant); highlightedBlock.normalColor = UIManager.instance.tooltipDangerColourVibrant; pressedBlock.normalColor = UIManager.instance.tooltipDangerColourVibrant; pressedBlock.highlightedColor = UIManager.instance.tooltipDangerColourVibrant; pressedBlock.selectedColor = UIManager.instance.tooltipDangerColourVibrant; normalBlock.normalColor = UIManager.instance.tooltipDangerColourInvisible; normalBlock.highlightedColor = UIManager.instance.tooltipDangerColourFaded; normalBlock.pressedColor = UIManager.instance.tooltipDangerColourVibrant; normalBlock.selectedColor = UIManager.instance.tooltipDangerColourVibrant; aoeSelectBlock.normalColor = UIManager.instance.monsterAltDangerButtonColour; aoeSelectBlock.highlightedColor = aoeSelectBlock.normalColor; aoeSelectBlock.pressedColor = aoeSelectBlock.normalColor; bts.SetColorBlock("normal", normalBlock); bts.SetColorBlock("highlighted", highlightedBlock); bts.SetColorBlock("pressed", pressedBlock); } else { aoeSelectBlock.normalColor = UIManager.instance.monsterAltButtonColour; aoeSelectBlock.highlightedColor = aoeSelectBlock.normalColor; aoeSelectBlock.pressedColor = aoeSelectBlock.normalColor; } bts.SetColorBlock("na0", aoeSelectBlock); }
/// <summary> /// Initialize a skillDisplay, displaying the skill's icon and preparing the possible colourings /// for if the skill is enabled or not. /// </summary> /// <param name="skillIndex"></param> /// <param name="displayedSkill"></param> /// <param name="skillSprite"></param> /// <param name="skillColour"></param> /// <param name="pmd"></param> public void Init(int skillIndex, Skill displayedSkill, Sprite skillSprite, Color skillColour, PartyMemberDisplay pmd) { skillSpriteRenderer.sprite = skillSprite; this.skillColour = skillColour; this.skillIndex = skillIndex; this.skillDisplayEnabled = displayedSkill.skillEnabled; this.displayedSkill = displayedSkill; this.pmd = pmd; SetTooltip(); ColorBlock normalBlock = b.colors; if (skillDisplayEnabled == true) { normalBlock.normalColor = new Color(skillColour.r, skillColour.g, skillColour.b, 0.75f); normalBlock.highlightedColor = skillColour; normalBlock.pressedColor = skillColour; normalBlock.disabledColor = new Color(skillColour.r, skillColour.g, skillColour.b, 0.33f); skillSpriteRenderer.color = skillColour; bts.SetColorBlock("normal", normalBlock); bts.SetColor("normal"); } else { normalBlock.normalColor = new Color32(99, 99, 99, 255); normalBlock.highlightedColor = new Color32(141, 141, 141, 255); normalBlock.pressedColor = new Color32(255, 255, 255, 255); normalBlock.disabledColor = new Color32(61, 61, 61, 255); skillSpriteRenderer.color = new Color32(133, 133, 133, 255); bts.SetColorBlock("normal", normalBlock); bts.SetColor("normal"); } }
private bool selectButtonEnabled = false; /// <value> Select button will only move to next scene if a class is selected </value> /// <summary> /// Awake to intialize eventSystem and select button's alternate colour blocks /// </summary> void Awake() { es = EventSystem.current; classButtons = GetComponentsInChildren <ClassButton>(); ColorBlock sbEnabledBlock = selectButton.colors; sbEnabledBlock.normalColor = new Color32(215, 215, 215, 255); sbEnabledBlock.highlightedColor = new Color32(255, 255, 255, 255); sbEnabledBlock.pressedColor = sbEnabledBlock.highlightedColor; sbBts = selectButton.GetComponent <ButtonTransitionState>(); sbBts.SetColorBlock("normalAlternate", sbEnabledBlock); }
private bool selectForAttack = false; /// <value> Flag for if partyMember can be selected for an attack target on the next click</value> public void Awake() { if (bts != null) { ColorBlock activeBlock = b.colors; activeBlock.normalColor = new Color32(255, 255, 255, 255); activeBlock.highlightedColor = new Color32(255, 255, 255, 200); activeBlock.pressedColor = new Color32(255, 255, 255, 255); activeBlock.disabledColor = new Color32(255, 255, 255, 255); bts.SetColorBlock("na0", activeBlock); } }
// public void InitMirror(StatusEffectDisplay sed) { // this.se = sed.se; // gameObject.SetActive(false); // SetColour(); // UpdateText(); // gameObject.SetActive(true); // SetTooltip(); // } public void SetColour() { ColorBlock normalBlock = b.colors; switch (se.name) { case StatusEffectConstant.BURN: normalBlock.normalColor = new Color32(185, 29, 0, 200); normalBlock.highlightedColor = new Color32(185, 29, 0, 255); normalBlock.pressedColor = new Color32(185, 29, 0, 255); normalBlock.disabledColor = new Color32(185, 29, 0, 150); durationText.SetColour(new Color32(185, 29, 0, 255)); break; case StatusEffectConstant.POISON: normalBlock.normalColor = new Color32(92, 138, 57, 200); normalBlock.highlightedColor = new Color32(92, 138, 57, 255); normalBlock.pressedColor = new Color32(92, 138, 57, 255); normalBlock.disabledColor = new Color32(92, 138, 57, 150); durationText.SetColour(new Color32(92, 138, 57, 255)); break; case StatusEffectConstant.FROSTBITE: case StatusEffectConstant.FREEZE: normalBlock.normalColor = new Color32(0, 152, 220, 200); normalBlock.highlightedColor = new Color32(0, 152, 220, 255); normalBlock.pressedColor = new Color32(0, 152, 220, 255); normalBlock.disabledColor = new Color32(0, 152, 220, 150); durationText.SetColour(new Color32(0, 152, 220, 255)); break; case StatusEffectConstant.TAUNT: case StatusEffectConstant.RAGE: normalBlock.normalColor = new Color32(234, 50, 60, 200); normalBlock.highlightedColor = new Color32(234, 50, 60, 255); normalBlock.pressedColor = new Color32(234, 50, 60, 255); normalBlock.disabledColor = new Color32(234, 50, 60, 150); durationText.SetColour(new Color32(234, 50, 60, 255)); break; case StatusEffectConstant.FATALWOUND: case StatusEffectConstant.VAMPIRE: case StatusEffectConstant.BLEED: normalBlock.normalColor = new Color32(138, 7, 7, 200); normalBlock.highlightedColor = new Color32(138, 7, 7, 255); normalBlock.pressedColor = new Color32(138, 7, 7, 255); normalBlock.disabledColor = new Color32(138, 7, 7, 150); durationText.SetColour(new Color32(138, 7, 7, 255)); break; case StatusEffectConstant.WEAKNESS: normalBlock.normalColor = new Color32(98, 36, 97, 200); normalBlock.highlightedColor = new Color32(98, 36, 97, 255); normalBlock.pressedColor = new Color32(98, 36, 97, 255); normalBlock.disabledColor = new Color32(98, 36, 97, 150); durationText.SetColour(new Color32(98, 36, 97, 255)); break; case StatusEffectConstant.ADVANTAGE: normalBlock.normalColor = new Color32(230, 126, 34, 200); normalBlock.highlightedColor = new Color32(230, 126, 34, 255); normalBlock.pressedColor = new Color32(230, 126, 34, 255); normalBlock.disabledColor = new Color32(230, 126, 34, 150); durationText.SetColour(new Color32(230, 126, 34, 255)); break; case StatusEffectConstant.ROOT: normalBlock.normalColor = new Color32(93, 44, 40, 200); normalBlock.highlightedColor = new Color32(93, 44, 40, 255); normalBlock.pressedColor = new Color32(93, 44, 40, 255); normalBlock.disabledColor = new Color32(93, 44, 40, 150); durationText.SetColour(new Color32(93, 44, 40, 255)); break; case StatusEffectConstant.STUN: normalBlock.normalColor = new Color32(255, 205, 2, 200); normalBlock.highlightedColor = new Color32(255, 205, 2, 255); normalBlock.pressedColor = new Color32(255, 205, 2, 255); normalBlock.disabledColor = new Color32(255, 205, 2, 150); durationText.SetColour(new Color32(255, 205, 2, 255)); break; case StatusEffectConstant.SHOCK: normalBlock.normalColor = new Color32(255, 235, 87, 200); normalBlock.highlightedColor = new Color32(255, 235, 87, 255); normalBlock.pressedColor = new Color32(255, 235, 87, 255); normalBlock.disabledColor = new Color32(255, 235, 87, 150); durationText.SetColour(new Color32(255, 235, 87, 255)); break; case StatusEffectConstant.REGENERATE: normalBlock.normalColor = new Color32(90, 197, 79, 200); normalBlock.highlightedColor = new Color32(90, 197, 79, 255); normalBlock.pressedColor = new Color32(90, 197, 79, 255); normalBlock.disabledColor = new Color32(90, 197, 79, 255); durationText.SetColour(new Color32(90, 197, 79, 255)); break; case StatusEffectConstant.GUARD: normalBlock.normalColor = new Color32(155, 66, 28, 200); normalBlock.highlightedColor = new Color32(155, 66, 28, 255); normalBlock.pressedColor = new Color32(155, 66, 28, 255); normalBlock.disabledColor = new Color32(155, 66, 28, 150); durationText.SetColour(new Color32(155, 66, 28, 255)); break; case StatusEffectConstant.CURE: normalBlock.normalColor = new Color32(125, 237, 164, 200); normalBlock.highlightedColor = new Color32(125, 237, 164, 255); normalBlock.pressedColor = new Color32(125, 237, 164, 255); normalBlock.disabledColor = new Color32(125, 237, 164, 150); durationText.SetColour(new Color32(125, 237, 164, 255)); break; case StatusEffectConstant.TRAP: normalBlock.normalColor = new Color32(133, 133, 133, 200); normalBlock.highlightedColor = new Color32(133, 133, 133, 255); normalBlock.pressedColor = new Color32(133, 133, 133, 255); normalBlock.disabledColor = new Color32(133, 133, 133, 150); durationText.SetColour(new Color32(133, 133, 133, 255)); break; case StatusEffectConstant.MIRACLE: normalBlock.normalColor = new Color32(208, 208, 208, 200); normalBlock.highlightedColor = new Color32(208, 208, 208, 255); normalBlock.pressedColor = new Color32(208, 208, 208, 255); normalBlock.disabledColor = new Color32(208, 208, 208, 150); durationText.SetColour(new Color32(208, 208, 208, 255)); break; case StatusEffectConstant.BARRIER: normalBlock.normalColor = new Color32(60, 50, 234, 200); normalBlock.highlightedColor = new Color32(60, 50, 234, 255); normalBlock.pressedColor = new Color32(60, 50, 234, 255); normalBlock.disabledColor = new Color32(60, 50, 234, 150); durationText.SetColour(new Color32(60, 50, 234, 255)); break; case StatusEffectConstant.MARIONETTE: normalBlock.normalColor = new Color32(99, 33, 197, 200); normalBlock.highlightedColor = new Color32(99, 33, 197, 255); normalBlock.pressedColor = new Color32(99, 33, 197, 255); normalBlock.disabledColor = new Color32(99, 33, 197, 150); durationText.SetColour(new Color32(99, 33, 197, 255)); break; case StatusEffectConstant.NIMBLE: normalBlock.normalColor = new Color32(0, 111, 135, 200); normalBlock.highlightedColor = new Color32(0, 111, 135, 255); normalBlock.pressedColor = new Color32(0, 111, 135, 255); normalBlock.disabledColor = new Color32(0, 111, 135, 150); durationText.SetColour(new Color32(0, 111, 135, 255)); break; case StatusEffectConstant.ETHEREAL: normalBlock.normalColor = new Color32(209, 201, 255, 200); normalBlock.highlightedColor = new Color32(209, 201, 255, 255); normalBlock.pressedColor = new Color32(209, 201, 255, 255); normalBlock.disabledColor = new Color32(209, 201, 255, 150); durationText.SetColour(new Color32(209, 201, 255, 255)); break; case StatusEffectConstant.BREAK: normalBlock.normalColor = new Color32(255, 152, 168, 200); normalBlock.highlightedColor = new Color32(255, 152, 168, 255); normalBlock.pressedColor = new Color32(255, 152, 168, 255); normalBlock.disabledColor = new Color32(255, 152, 168, 255); durationText.SetColour(new Color32(255, 152, 168, 255)); break; case StatusEffectConstant.BOSS: case StatusEffectConstant.FAMILIAR: case StatusEffectConstant.CHAMPIONHP: case StatusEffectConstant.CHAMPIONPATK: case StatusEffectConstant.CHAMPIONMATK: case StatusEffectConstant.CHAMPIONPDEF: case StatusEffectConstant.CHAMPIONMDEF: normalBlock.normalColor = new Color32(255, 255, 255, 200); normalBlock.highlightedColor = new Color32(255, 255, 255, 255); normalBlock.pressedColor = new Color32(255, 255, 255, 255); normalBlock.disabledColor = new Color32(255, 255, 255, 150); durationText.SetColour(new Color32(255, 255, 255, 255)); break; case StatusEffectConstant.SCUM: normalBlock.normalColor = new Color32(61, 61, 61, 200); normalBlock.highlightedColor = new Color32(61, 61, 61, 255); normalBlock.pressedColor = new Color32(61, 61, 61, 255); normalBlock.disabledColor = new Color32(61, 61, 61, 150); durationText.SetColour(new Color32(61, 61, 61, 255)); break; } bts.SetColorBlock("normal", normalBlock); bts.SetColor("normal"); }