示例#1
0
 public TableDataSource(MonsterAddView parent)
 {
     this.parent = parent;
 }
        public CharacterListView(CombatState state, bool monsters)
        {
            listView = new UITableView();
            listView.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
            listView.SeparatorColor  = CMUIColors.PrimaryColorMedium;
            listView.BackgroundColor = UIExtensions.ARGBColor(0x0);

            BackgroundColor = CMUIColors.PrimaryColorDarker;

            AddSubview(listView);

            viewDelegate        = new ViewDelegate(this);
            viewDataSource      = new ViewDataSource(this);
            listView.Delegate   = viewDelegate;
            listView.DataSource = viewDataSource;

            _combatState = state;
            _monsters    = monsters;
            _combatState.Characters.CollectionChanged += Handle_combatStateCombatListCollectionChanged;
            _combatState.CharacterSortCompleted       += Handle_combatStateCharacterSortCompleted;
            _combatState.PropertyChanged += Handle_combatStatePropertyChanged;

            blankButton = new GradientButton();
            StyleButton(blankButton);
            blankButton.SetTitle("", UIControlState.Normal);
            blankButton.SetImage(UIExtensions.GetSmallIcon("invisible"), UIControlState.Normal);

            blankButton.TouchUpInside += HandleBlankButtonTouchUpInside;
            AddSubview(blankButton);


            monsterButton = new GradientButton();
            StyleButton(monsterButton);
            monsterButton.SetTitle("", UIControlState.Normal);
            monsterButton.SetImage(UIExtensions.GetSmallIcon("monster"), UIControlState.Normal);
            monsterButton.TouchUpInside += HandleMonsterButtonTouchUpInside;

            AddSubview(monsterButton);

            openButton = new GradientButton();
            StyleButton(openButton);
            openButton.SetText("");
            openButton.SetImage(UIExtensions.GetSmallIcon("openhs"), UIControlState.Normal);
            openButton.TouchUpInside += HandleOpenButtonTouchUpInside;
            AddSubview(openButton);


            saveButton = new GradientButton();
            StyleButton(saveButton);
            saveButton.SetText("");
            saveButton.SetImage(UIExtensions.GetSmallIcon("savehs"), UIControlState.Normal);
            saveButton.TouchUpInside += HandleSaveButtonTouchUpInside;
            AddSubview(saveButton);


            bottomView = new GradientView();
            AddSubview(bottomView);
            bottomLabel = new UILabel();
            bottomView.AddSubview(bottomLabel);
            bottomView.CornerRadius = 0f;
            bottomView.Gradient     = new GradientHelper(
                CMUIColors.PrimaryColorLight, CMUIColors.PrimaryColorLight);



            clearButton = new GradientButton();
            StyleButton(clearButton);
            clearButton.SetText("");
            clearButton.SetImage(UIExtensions.GetSmallIcon("delete"), UIControlState.Normal);
            clearButton.TouchUpInside += HandleClearButtonTouchUpInside;
            AddSubview(clearButton);


            _monsterAddView              = new MonsterAddView();
            _monsterAddView.IsMonsters   = monsters;
            _monsterAddView.ShouldClose += Handle_monsterAddViewShouldClose;
            _controller = new UIPopoverController(_monsterAddView);
            _monsterAddView.CombatState = _combatState;

            SetBottomText();
        }
示例#3
0
 public TableDelegate(MonsterAddView parent)
 {
     this.parent = parent;
 }