コード例 #1
0
    private void SetOnClickForOpt(OptButton opt, ActionButtonNode n)
    {
        if (n.disabled)
        {
            opt.OnOptMousedOver += (button) => {
                UIManager.instance.Tooltip.SetText(n.label + ": " + n.disabledReason);
                UIManager.instance.Tooltip.Show(opt.transform as RectTransform);
            };

            opt.OnOptMousedOut += (button) => {
                UIManager.instance.Tooltip.Hide();
//				UIManager.instance.tooltip.SetText(n.disabledReason);
            };

            opt.GetComponent <Button> ().interactable = false;
        }
        else
        {
            opt.OnOptLeftClicked += (button) => {
                NodeSelected(n);
            };

            opt.SetTooltipInfo(Tooltip.TooltipPosition.TOP, 0, n.label, n.rightClickDescription);
        }
    }
コード例 #2
0
    public override void SyncUiWithCharacter(Sheet character)
    {
        Clear();

        str  = AddOptButton("Str:" + character.Strength + " " + ModifierValue("strength"));
        dex  = AddOptButton("Dex:" + character.Dexterity + " " + ModifierValue("dexterity"));
        con  = AddOptButton("Con:" + character.Constitution + " " + ModifierValue("constitution"));
        intl = AddOptButton("Int:" + character.Intelligence + " " + ModifierValue("intelligence"));
        wis  = AddOptButton("Wis:" + character.Wisdom + " " + ModifierValue("wisdom"));
        cha  = AddOptButton("Cha:" + character.Charisma + " " + ModifierValue("charisma"));


        str.SetTooltipInfo(Tooltip.TooltipPosition.LEFT, 15,
                           "Strength\n" + ModifierValue("strength") + " to melee hit and damage roll\nCarry weight:" + character.CarryWeight,
                           "Strength\nThe modifier, " + ModifierValue("strength") +
                           ", affects all melee weapon hit rolls, and damage rolls (main hand only).\nWeight carried is 15 x Strength score of " + GaugeValue("strength"));

        dex.SetTooltipInfo(Tooltip.TooltipPosition.LEFT, 15,
                           "Dexterity\n" + ModifierValue("dexterity") + " to ranged/finesse hit and damage roll\nAC bonus:" + ModifierValue("dexterity"),
                           "Dexterity\nThe modifier, " + ModifierValue("dexterity") +
                           ", affects all ranged weapon hit rolls, and damage rolls.  The same applies to melee weapons that have the finesse property.\nAlso, affects Armour Class by the modifier; this is restricted at +2 when wearing medium armour,  and completely when wearing heavy armour.");

        con.SetTooltipInfo(Tooltip.TooltipPosition.LEFT, 15,
                           "Constitution\n" + ModifierValue("constitution") + " to hit points per level",
                           "The modifier, " + ModifierValue("constitution") + " is multiplied by character level " + character.CharacterLevel);

        intl.SetTooltipInfo(Tooltip.TooltipPosition.LEFT, 15,
                            "Intelligence\nWizards prepare more spells, and increase their effectiveness with them.",
                            "Intelligence\nThe modifier, " + ModifierValue("intelligence") + " increases/decreases spells a wizard can have prepared in a day.  The base value is the wizard level of the caster.\nThe modifier also affects spell hit rolls when called for, and make a cleric's spells harder to resist.");

        wis.SetTooltipInfo(Tooltip.TooltipPosition.LEFT, 15,
                           "Wisdom\nClerics prepare more spells, and increase their effectiveness with them.",
                           "Wisdom\nThe modifier, " + ModifierValue("wisdom") + " increases/decreases spells a cleric can have prepared in a day.  The base value is the cleric level of the caster.\nThe modifier also affects spell hit rolls when called for, and make a wizard's spells harder to resist.");
        cha.SetTooltipInfo(Tooltip.TooltipPosition.LEFT, 15,
                           "Charisma\nGain more favor with the crowd.",
                           "Charisma\n(Long description needed)");
    }
コード例 #3
0
 public virtual void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos, int offset)
 {
     opt.SetTooltipInfo(pos, offset, ShortDescription(), null);
 }
コード例 #4
0
 public override void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos = Tooltip.TooltipPosition.TOP, int offset = 2)
 {
     opt.SetTooltipInfo(pos, offset, "You deal more damage (add ability modifier) to the bonus attack offered by two-weapon fighting", "When you engage in two-weapon fighting, you can  add your ability modifier to the damage of the second attack. ");
 }
コード例 #5
0
 public override void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos = Tooltip.TooltipPosition.TOP, int offset = 2)
 {
     opt.SetTooltipInfo(pos, offset, "The character is well versed in armour of all kinds.", "Gain +1 to armour class while wearing any armour.");
 }
コード例 #6
0
 public override void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos = Tooltip.TooltipPosition.TOP, int offset = 2)
 {
     opt.SetTooltipInfo(pos, offset, "Deal +2 damage with single-handed weapons, if holding no other weapons.", "When you are wielding a melee weapon in one hand  and no other weapons, you gain a +2 bonus to  damage rolls with that weapon. ");
 }
コード例 #7
0
 public virtual void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos = Tooltip.TooltipPosition.TOP, int offset = 2)
 {
     opt.SetTooltipInfo(pos, offset, "Just some feature", null);
 }
コード例 #8
0
 public override void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos = Tooltip.TooltipPosition.TOP, int offset = 2)
 {
     opt.SetTooltipInfo(pos, offset, shortDescription, description);
 }
コード例 #9
0
 public virtual void DressOptButtonForTooltip(OptButton opt, Tooltip.TooltipPosition pos, int offset = 10)
 {
     opt.SetTooltipInfo(pos, offset, ShortDescription(this.name), Description(this.name));
 }