示例#1
0
        // The IntPtr and initWithCoder constructors are required for controllers that need
        // to be able to be created from a xib rather than from managed code

        public MainViewController(IntPtr handle) : base(handle)
        {
            Initialize();


            View.BackgroundColor = UIExtensions.RGBColor(0);
        }
示例#2
0
 public static void StyleBasicPanel(this GradientView panel)
 {
     panel.BackgroundColor = UIColor.Clear;
     panel.Gradient        = new GradientHelper(CMUIColors.PrimaryColorDarker);
     panel.BorderColor     = UIExtensions.RGBColor(0xFFFFFF);
     panel.Border          = 2;
 }
 protected void StyleBackground(GradientView backgroundView)
 {
     backgroundView.BackgroundColor = UIColor.Clear;
     backgroundView.BorderColor     = UIExtensions.RGBColor(0xFFFFFF);
     backgroundView.Border          = 2.0f;
     backgroundView.Gradient        = new GradientHelper(CMUIColors.SecondaryColorADark);
 }
示例#4
0
 public static void StyleStandardButton(this GradientButton b)
 {
     b.BorderColor = UIExtensions.RGBColor(0xFFFFFF);
     b.SetTitleColor(UIColor.White, UIControlState.Normal);
     b.SetTitleColor(UIColor.DarkGray, UIControlState.Highlighted);
     b.Border           = 2;
     b.DisabledGradient = new GradientHelper(0xFF999999.UIColor(), 0xFF555555.UIColor());
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (View.Bounds.Height > View.Bounds.Width)
            {
                View.SetSize((float)View.Bounds.Height, (float)View.Bounds.Width);
            }

            BackgroundView.BackgroundColor = UIColor.Clear;
            BackgroundView.BorderColor     = UIExtensions.RGBColor(0xFFFFFF);
            BackgroundView.Border          = 2.0f;
            BackgroundView.Gradient        = new GradientHelper(CMUIColors.SecondaryColorADark);



            HeaderView.BackgroundColor = UIColor.Clear;
            HeaderView.Border          = 0;
            HeaderView.Gradient        = new GradientHelper(CMUIColors.PrimaryColorDark);

            HeaderLabel.TextColor       = UIColor.White;
            HeaderLabel.BackgroundColor = UIColor.Clear;

            _BasicPage       = new MonsterEditorBasicPage();
            _DefensePage     = new MonsterEditorDefensePage();
            _OffensePage     = new MonsterEditorOffensePage();
            _StatisticsPage  = new MonsterEditorStatisticsPage();
            _FeatsPage       = new MonsterEditorFeatsPage();
            _SpecialPage     = new MonsterEditorSpecialPage();
            _DescriptionPage = new MonsterEditorDescriptionPage();

            _Pages = new List <MonsterEditorPage>()
            {
                _BasicPage, _DefensePage, _OffensePage, _StatisticsPage, _FeatsPage, _SpecialPage, _DescriptionPage
            };

            _TabButtons = new List <GradientButton>()
            {
                BasicButton, DefenseButton, OffenseButton, StatisticsButton, FeatsButton, SpecialButton, DescriptionButton
            };

            PageBorderView.Gradient    = new GradientHelper(CMUIColors.SecondaryColorADarker);
            PageBorderView.Border      = 2;
            PageBorderView.BorderColor = UIExtensions.RGBColor(0xFFFFFF);

            foreach (MonsterEditorPage p in _Pages)
            {
                if (p != null)
                {
                    p.CurrentMonster = Monster;
                    p.DialogParent   = this.View;
                }
            }

            ShowPage(0);

            UpdateOK();
        }
示例#6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            BackgroundView.BackgroundColor = UIColor.Clear;
            BackgroundView.BorderColor     = UIExtensions.RGBColor(0xFFFFFF);
            BackgroundView.Border          = 2.0f;
            BackgroundView.Gradient        = new GradientHelper(CMUIColors.SecondaryColorADark);


            ButtonPropertyManager m;

            m = new ButtonPropertyManager(NameButton, MainUI.MainView, _feat, "Name")
            {
                Title = "Name", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(PrerequisitesButton, MainUI.MainView, _feat, "Prerequistites")
            {
                Title = "Prerequisites", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(BenefitButton, MainUI.MainView, _feat, "Benefit")
            {
                Multiline = true
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(NormalButton, MainUI.MainView, _feat, "Normal")
            {
                Multiline = true
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(SpecialButton, MainUI.MainView, _feat, "Special")
            {
                Multiline = true
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(TypesButton, MainUI.MainView, _feat, "Type")
            {
                StringList = true
            };
            _Managers.Add(m);
            List <KeyValuePair <object, string> > types = new List <KeyValuePair <object, string> >();

            foreach (String s in Feat.FeatTypes)
            {
                types.Add(new KeyValuePair <object, string>(s, s));
            }
            m.ValueList = types;


            foreach (GradientButton b in from x in _Managers select x.Button)
            {
                CMStyles.TextFieldStyle(b, 15f);
            }
        }
示例#7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            BackgroundView.BackgroundColor = UIColor.Clear;
            BackgroundView.BorderColor     = UIExtensions.RGBColor(0xFFFFFF);
            BackgroundView.Border          = 2.0f;
            BackgroundView.Gradient        = new GradientHelper(CMUIColors.SecondaryColorADark);


            LevelsTable.DataSource = new ViewDataSource(this);
            LevelsTable.Delegate   = new ViewDelegate(this);
        }
示例#8
0
        public void StyleButton(GradientButton button, bool selected)
        {
            button.SetTitleColor(UIColor.White, UIControlState.Normal);
            UIColor color1 = CMUIColors.PrimaryColorDarker;
            UIColor color2 = CMUIColors.PrimaryColorLight;

            if (selected)
            {
                button.Gradient = new GradientHelper(color1, color2);
                button.SetTitleColor(UIColor.White, UIControlState.Normal);
            }
            else
            {
                button.Gradient = new GradientHelper(UIExtensions.RGBColor(0xEEEEEE), UIExtensions.RGBColor(0xEEEEEE));
                button.SetTitleColor(UIExtensions.ARGBColor(0xFF999999), UIControlState.Normal);
            }
        }
示例#9
0
        void Initialize()
        {
            GradientView view = new GradientView();

            view.Border             = 1f;
            view.CornerRadius       = 0;
            view.Color1             = CMUIColors.PrimaryColorMedium;
            view.Color2             = CMUIColors.PrimaryColorMedium;
            view.BorderColor        = CMUIColors.PrimaryColorLight;
            cellmain.BackgroundView = view;

            view              = new GradientView();
            view.Border       = 1f;
            view.CornerRadius = 0;
            view.Color1       = CMUIColors.SecondaryColorAMedium;
            view.Color2       = CMUIColors.SecondaryColorAMedium;
            view.BorderColor  = CMUIColors.SecondaryColorALight;
            cellmain.SelectedBackgroundView = view;

            actionsButton.SetImage(_ActionImage, UIControlState.Normal);
            maxHPButton.TouchUpInside     += HandleMaxHPButtonTouchUpInside;
            hpButton.TouchUpInside        += HandleHpButtonTouchUpInside;
            modButton.TouchUpInside       += HandleModButtonTouchUpInside;
            tempHPButton.TouchUpInside    += HandleTempHPButtonTouchUpInside;
            nonlethalButton.TouchUpInside += HandleNonlethalButtonTouchUpInside;
            _ActionsPopover = new ButtonStringPopover(actionsButton);
            _ActionsPopover.WillShowPopover += Handle_ActionsPopoverWillShowPopover;
            _ActionsPopover.ItemClicked     += Handle_ActionsPopoverItemClicked;

            nameField.TouchUpInside += HandleNameFieldhandleTouchUpInside;
            nameField.BorderColor    = UIExtensions.RGBColor(0xFFFFFF);
            nameField.SetTitleColor(UIColor.White, UIControlState.Normal);
            nameField.SetTitleColor(UIColor.LightGray, UIControlState.Highlighted);
            nameField.SetTitleColor(UIColor.White, UIControlState.Selected);
            nameField.Border       = 2;
            nameField.CornerRadius = 4;
            nameField.TitleLabel.AdjustsFontSizeToFitWidth = true;

            StyleButton(hpButton);
            StyleButton(maxHPButton);
            StyleButton(modButton);
            StyleButton(actionsButton);
            StyleButton(nonlethalButton);
            StyleButton(tempHPButton);
        }
示例#10
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                UITableViewCell cell = new UITableViewCell(UITableViewCellStyle.Default, "ButtonStringPopover");

                ButtonStringPopoverItem item = state._CurrentItems[indexPath.Row];

                if (item.Text.IsEmptyOrNull())
                {
                    UIView bview = new UIView();
                    bview.BackgroundColor = UIExtensions.RGBColor(0xCCCCCC);
                    cell.BackgroundView   = bview;
                    bview = new UIView();
                    bview.BackgroundColor       = UIExtensions.RGBColor(0xCCCCCC);
                    cell.SelectedBackgroundView = bview;
                    cell.Tag = 1;
                }
                else
                {
                    cell.TextLabel.Text = item.Text;
                    cell.TextLabel.Font = UIFont.SystemFontOfSize(14);
                    if (item.Disabled)
                    {
                        cell.TextLabel.TextColor = UIColor.LightGray;
                    }

                    UIImage image = state.GetCellIcon(indexPath.Row);
                    if (item.Selected)
                    {
                        image = UIExtensions.GetSmallIcon("check");
                    }
                    cell.ImageView.Image = image;
                    cell.ImageView.Frame = new CGRect(0, 0, 16, 16);
                }


                return(cell);
            }
示例#11
0
        public void SetupButtons()
        {
            //advanced button
            advancedPopover = new ButtonStringPopover(AdvancedButton);
            advancedPopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "None", Tag = 0
            });
            for (int i = 1; i < 4; i++)
            {
                advancedPopover.Items.Add(new ButtonStringPopoverItem()
                {
                    Text = "Advanced x" + i, Tag = i
                });
            }
            advancedPopover.ItemClicked += HandleAdvancedPopoverItemClicked;

            //simple size button
            simpleSizePopover = new ButtonStringPopover(SimpleSizeButton);
            for (int i = -3; i < 0; i++)
            {
                simpleSizePopover.Items.Add(new ButtonStringPopoverItem()
                {
                    Text = "Young x" + (-i), Tag = i
                });
            }
            simpleSizePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "None", Tag = 0
            });
            for (int i = 1; i < 4; i++)
            {
                simpleSizePopover.Items.Add(new ButtonStringPopoverItem()
                {
                    Text = "Giant x" + i, Tag = i
                });
            }
            simpleSizePopover.ItemClicked += HandleSimpleSizePopoverItemClicked;

            //simple outsider button
            simpleOutsiderPopover = new ButtonStringPopover(OutsiderButton);
            simpleOutsiderPopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "None", Tag = null
            });
            foreach (Monster.HalfOutsiderType t in Enum.GetValues(typeof(Monster.HalfOutsiderType)))
            {
                simpleOutsiderPopover.Items.Add(new ButtonStringPopoverItem()
                {
                    Text = Monster.GetOutsiderTypeName(t).Capitalize(),
                    Tag  = new Monster.HalfOutsiderType ?(t)
                });
            }
            simpleOutsiderPopover.ItemClicked += HandleSimpleOutsiderPopoverItemClicked;

            //simple outsider button
            augmentSummoningPopover = new ButtonStringPopover(AugmentSummoningButton);
            augmentSummoningPopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "On", Tag = true
            });
            augmentSummoningPopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Off", Tag = false
            });

            augmentSummoningPopover.ItemClicked += HandleAugmentSummoningPopoverItemClicked;


            racialHitDiePopover = new ButtonStringPopover(RacialHitDieButton);

            for (int i = -20; i < 21; i++)
            {
                if (i == 0)
                {
                    racialHitDiePopover.Items.Add(new ButtonStringPopoverItem()
                    {
                        Text = "None", Tag = 0
                    });
                }
                else
                {
                    racialHitDiePopover.Items.Add(new ButtonStringPopoverItem()
                    {
                        Text = i.PlusFormat(), Tag = i
                    });
                }
            }
            racialHitDiePopover.ItemClicked += HandleRacialHitDiePopoverItemClicked;
            UpdateButtonState();


            racialBonusPopover = new ButtonStringPopover(RacialBonusButton);
            foreach (Stat t in Enum.GetValues(typeof(Stat)))
            {
                racialBonusPopover.Items.Add(new ButtonStringPopoverItem()
                {
                    Text = Monster.StatText(t).Capitalize(),
                    Tag  = t
                });
            }
            racialBonusPopover.ItemClicked += HandleRacialBonusPopoverItemClicked;


            racialSizePopover = new ButtonStringPopover(RacialSizeButton);
            racialSizePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "50% HD", Tag = true
            });
            racialSizePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "No Size Change", Tag = false
            });

            racialSizePopover.ItemClicked += HandleRacialSizePopoverItemClicked;

            ResetButton.SetImage(UIExtensions.GetSmallIcon("reset"), UIControlState.Normal);

            AdvancerHeaderView.Gradient    = new GradientHelper(CMUIColors.SecondaryColorBDarker);
            AdvancerHeaderView.BorderColor = UIExtensions.RGBColor(0xFFFFFF);

            AddMonsterButton.SetSmallIcon("sword");

            otherTemplatePopover = new ButtonStringPopover(OtherTemplateButton);
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "None", Tag = AdvancerTemplate.None
            });
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Half-Celestial", Tag = AdvancerTemplate.HalfCelestial
            });
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Half-Dragon", Tag = AdvancerTemplate.HalfDragon
            });
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Half-Fiend", Tag = AdvancerTemplate.HalfFiend
            });
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Skeleton", Tag = AdvancerTemplate.Skeleton
            });
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Vampire", Tag = AdvancerTemplate.Vampire
            });
            otherTemplatePopover.Items.Add(new ButtonStringPopoverItem()
            {
                Text = "Zombie", Tag = AdvancerTemplate.Zombie
            });
            otherTemplatePopover.ItemClicked += HandleOtherTemplateItemClicked;
            _OtherPopovers = new List <ButtonStringPopover>();
            for (int i = 0; i < _OtherButtons.Length; i++)
            {
                _OtherPopovers.Add(new ButtonStringPopover(_OtherButtons[i]));
                _OtherPopovers[i].Data             = i;
                _OtherPopovers[i].WillShowPopover += HandleWillShowOtherPopover;
                _OtherPopovers[i].ItemClicked     += HandleOtherPopoverItemClicked;
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            BackgroundView.BackgroundColor = UIColor.Clear;
            BackgroundView.BorderColor     = UIExtensions.RGBColor(0xFFFFFF);
            BackgroundView.Border          = 2.0f;
            BackgroundView.Gradient        = new GradientHelper(CMUIColors.SecondaryColorADark);


            ButtonPropertyManager m;

            m = new ButtonPropertyManager(NameButton, MainUI.MainView, _spell, "Name")
            {
                Title = "Name", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(SchoolButton, MainUI.MainView, _spell, "school")
            {
                Title = "School", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(SubschoolButton, MainUI.MainView, _spell, "subschool")
            {
                Title = "Subschool", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(DescriptorButton, MainUI.MainView, _spell, "descriptor")
            {
                Title = "Descriptor", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(CastingTimeButton, MainUI.MainView, _spell, "casting_time")
            {
                Title = "Casting Time", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(RangeButton, MainUI.MainView, _spell, "range")
            {
                Title = "Range", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(AreaButton, MainUI.MainView, _spell, "area")
            {
                Title = "Area", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(TargetsButton, MainUI.MainView, _spell, "targets")
            {
                Title = "Targets", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(DurationButton, MainUI.MainView, _spell.Adjuster, "Duration")
            {
                Title = "Duration", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(DismissableButton, MainUI.MainView, _spell.Adjuster, "Dismissible")
            {
                Title = "Dismissible", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(SavingThrowButton, MainUI.MainView, _spell, "saving_throw")
            {
                Title = "Saving Throw", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(SpellResistanceButton, MainUI.MainView, _spell, "spell_resistence")
            {
                Title = "Spell Resistance", Multiline = false
            };
            _Managers.Add(m);

            m = new ButtonPropertyManager(VerbalButton, MainUI.MainView, _spell.Adjuster, "Verbal")
            {
                Title = "Verbal", Multiline = false
            };
            _Managers.Add(m);

            m = new ButtonPropertyManager(SomaticButton, MainUI.MainView, _spell.Adjuster, "Somatic")
            {
                Title = "Somatic", Multiline = false
            };
            _Managers.Add(m);

            m = new ButtonPropertyManager(MaterialButton, MainUI.MainView, _spell.Adjuster, "Material")
            {
                Title = "Material", Multiline = false
            };
            _Managers.Add(m);

            m = new ButtonPropertyManager(MaterialTextButton, MainUI.MainView, _spell.Adjuster, "MaterialText")
            {
                Title = "Material Text", Multiline = false
            };
            _Managers.Add(m);

            m = new ButtonPropertyManager(FocusButton, MainUI.MainView, _spell.Adjuster, "Focus")
            {
                Title = "Focus", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(DivineFocusButton, MainUI.MainView, _spell.Adjuster, "DivineFocus")
            {
                Title = "Divine Focus", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(FocusTextButton, MainUI.MainView, _spell.Adjuster, "FocusText")
            {
                Title = "FocusText", Multiline = false
            };
            _Managers.Add(m);
            m = new ButtonPropertyManager(DescriptionButton, MainUI.MainView, _spell, "description")
            {
                Title = "Description", Multiline = true
            };
            _Managers.Add(m);

            foreach (ButtonPropertyManager bpm in _Managers)
            {
                bpm.Button.BackgroundColor = UIColor.Clear;
            }
            LevelsButton.TouchUpInside += (object sender, EventArgs e) =>
            {
                SpellLevelsDialog dlg = new SpellLevelsDialog(_spell);
                dlg.OKClicked += (object se, EventArgs ea) =>
                {
                };
                View.AddSubview(dlg.View);
            };
            LevelsButton.BackgroundColor = UIColor.Clear;
        }