コード例 #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            //movement
            AttachEditTextInt(EditMonster.Adjuster, Resource.Id.speedText, "LandSpeed");
            AttachEditTextIntNull(EditMonster.Adjuster, Resource.Id.flyText, "FlySpeed");

            List <Tuple <int, string> > flyList = new List <Tuple <int, string> >();

            for (int i = 0; i < CombatManager.Monster.FlyQualityList.Count; i++)
            {
                flyList.Add(new Tuple <int, string>(i,
                                                    CombatManager.Monster.FlyQualityList[i]));
            }

            AttachButtonIntStringList(EditMonster.Adjuster, Resource.Id.flyQualityButton, "FlyQuality", flyList);



            AttachEditTextIntNull(EditMonster.Adjuster, Resource.Id.climbText, "ClimbSpeed");
            AttachEditTextIntNull(EditMonster.Adjuster, Resource.Id.burrowText, "BurrowSpeed");
            AttachEditTextIntNull(EditMonster.Adjuster, Resource.Id.swimText, "SwimSpeed");

            AttachEditTextInt(EditMonster.Adjuster, Resource.Id.spaceText, "Space");
            AttachEditTextInt(EditMonster.Adjuster, Resource.Id.reachText, "Reach");

            //attacks
            Button b = FindViewById <Button>(Resource.Id.meleeAttacksButton);

            b.Text   = EditMonster.Melee;
            b.Click += (object sender, EventArgs e) =>
            {
                UIUtils.ShowTextDialog("Melee", EditMonster, this);
            };

            b        = FindViewById <Button>(Resource.Id.rangedAttacksButton);
            b.Text   = EditMonster.Ranged;
            b.Click += (object sender, EventArgs e) =>
            {
                UIUtils.ShowTextDialog("Ranged", EditMonster, this);
            };

            b        = FindViewById <Button>(Resource.Id.attacksEditorButton);
            b.Click += (object sender, EventArgs e) =>
            {
                ShowAttacksEditor();
            };


            //other offense text
            AttachEditTextString(EditMonster, Resource.Id.specialAttacksText, "SpecialAttacks");
            AttachEditTextString(EditMonster, Resource.Id.spellLikeAbilitiesText, "SpellLikeAbilities");
            AttachEditTextString(EditMonster, Resource.Id.spellsKnownText, "SpellsKnown");
            AttachEditTextString(EditMonster, Resource.Id.spellsPreparedText, "SpellsPrepared");

            EditMonster.PropertyChanged += HandlePropertyChanged;
        }
コード例 #2
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View v = convertView;

            if (v == null)
            {
                LayoutInflater vi = (LayoutInflater)Application.Context.GetSystemService(Context.LayoutInflaterService);
                v = vi.Inflate(Resource.Layout.CharacterListItem, parent, false);

                v.FindViewById <Button>(Resource.Id.nameEditText).Click += delegate
                {
                    UIUtils.ShowTextDialog("Name", _Characters[(int)v.Tag], parent.Context);
                };

                v.FindViewById <Button>(Resource.Id.hpButton).Click += delegate
                {
                    new NumberDialog("HP", _Characters[(int)v.Tag], parent.Context).Show();
                };

                v.FindViewById <Button>(Resource.Id.hpMaxButton).Click += delegate
                {
                    new NumberDialog("MaxHP", _Characters[(int)v.Tag], parent.Context).Show();
                };

                v.FindViewById <Button>(Resource.Id.initButton).Click += delegate
                {
                    new NumberDialog("Init", _Characters[(int)v.Tag].Monster, parent.Context).Show();
                };

                v.FindViewById <ImageButton>(Resource.Id.actionButton).Click += delegate
                {
                    Character c = _Characters[(int)v.Tag];
                    ShowActionDialog(c, parent.Context);
                };

                EventHandler <View.LongClickEventArgs> handler = (object sender, View.LongClickEventArgs e) =>
                {
                    ClipData data = ClipData.NewPlainText("", "");
                    View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(v);
                    v.StartDrag(data, shadowBuilder, v, 0);
                };
                v.LongClickable = true;
                v.LongClick    += handler;
                v.FindViewById <Button>(Resource.Id.nameEditText).LongClick         += handler;
                v.FindViewById <Button>(Resource.Id.hpButton).LongClick             += handler;
                v.FindViewById <Button>(Resource.Id.hpMaxButton).LongClick          += handler;
                v.FindViewById <Button>(Resource.Id.initButton).LongClick           += handler;
                v.FindViewById <ImageButton>(Resource.Id.actionButton).LongClick    += handler;
                v.FindViewById <Button>(Resource.Id.nameEditText).LongClickable      = true;
                v.FindViewById <Button>(Resource.Id.hpButton).LongClickable          = true;
                v.FindViewById <Button>(Resource.Id.hpMaxButton).LongClickable       = true;
                v.FindViewById <Button>(Resource.Id.initButton).LongClickable        = true;
                v.FindViewById <ImageButton>(Resource.Id.actionButton).LongClickable = true;
                v.SetOnDragListener(new ListOnDragListener(this, v));
            }
            v.Tag = position;


            Character cp = _Characters[position];

            UpdateViewText(v, cp);
            UpdateConditions(v, cp, parent);
            ConditionChangedHandler cch = new ConditionChangedHandler(v, cp, this, parent);

            _Handlers.Add(cch);

            return(v);
        }
コード例 #3
0
 void ShowNotesDialog()
 {
     UIUtils.ShowTextDialog("Notes", _Character, Context, true);
 }