Example #1
0
 public PoolChanceRuleElement(ChestRule rule) : base(rule)
 {
     color = new Color(50, 50, 200);
     chanceSetter.Value = (int)Math.Round((rule as ChestRulePoolChance).chance * 100);
     countSetter.Value  = (rule as ChestRulePoolChance).itemsToGenerate;
     Append(chanceSetter);
     Append(countSetter);
 }
        public ChestRuleElement(ChestRule rule)
        {
            this.rule = rule;

            Width.Set(400, 0);
            Height.Set(36, 0);

            lootElements.Left.Set(0, 0);
            lootElements.Top.Set(40, 0);
            lootElements.Width.Set(400, 0);
            lootElements.Height.Set(0, 0);
            Append(lootElements);

            removeButton.Left.Set(-36, 1);
            removeButton.Width.Set(32, 0);
            removeButton.Height.Set(32, 0);
            removeButton.OnClick += Remove;
            Append(removeButton);

            upButton.Left.Set(4, 0);
            upButton.Top.Set(-4, 0);
            upButton.Width.Set(24, 0);
            upButton.Height.Set(18, 0);
            upButton.SetVisibility(1, 0.8f);
            upButton.OnClick += MoveUp;
            Append(upButton);

            downButton.Left.Set(4, 0);
            downButton.Top.Set(18, 0);
            downButton.Width.Set(24, 0);
            downButton.Height.Set(18, 0);
            downButton.SetVisibility(1, 0.8f);
            downButton.OnClick += MoveDown;
            Append(downButton);

            hideButton.Left.Set(-56, 1);
            hideButton.Top.Set(10, 0);
            hideButton.Width.Set(18, 0);
            hideButton.Height.Set(12, 0);
            hideButton.SetVisibility(1, 0.5f);
            hideButton.OnClick += Hide;
            Append(hideButton);

            foreach (Loot loot in rule.pool)
            {
                AddItem(loot);
            }
        }
Example #3
0
 public ChanceRuleElement(ChestRule rule) : base(rule)
 {
     color = Color.Green;
     chanceSetter.Value = (int)Math.Round((rule as ChestRuleChance).chance * 100);
     Append(chanceSetter);
 }
Example #4
0
 public PoolRuleElement(ChestRule rule) : base(rule)
 {
     color             = Color.Purple;
     countSetter.Value = (rule as ChestRulePool).itemsToGenerate;
     Append(countSetter);
 }
Example #5
0
 public GuaranteedRuleElement(ChestRule rule) : base(rule)
 {
     color = new Color(200, 0, 0);
 }