Beispiel #1
0
 public override void Update()
 {
     if (this.eventmanager.playevent)
     {
         this.eventmanager.UpDate();
     }
     else if (this.yesnoSelect)
     {
         this.yesnoSelect = false;
         if (this.savedata.selectQuestion == 0)
         {
             this.sound.PlaySE(SoundEffect.clincher);
             this.savedata.interiors.RemoveAt(this.Select);
             if (this.top1 > 0)
             {
                 --this.top1;
             }
             else if (this.cursol1 > 0)
             {
                 --this.cursol1;
             }
             this.parent.Field.InteriorSet();
             this.overTop = this.savedata.interiors.Count - 5;
             if (this.savedata.interiors.Count <= 0)
             {
                 this.parent.setCameraOn    = false;
                 this.parent.Player.NoPrint = false;
                 this.parent.cameraPlus.X   = 0.0f;
                 this.nowschene             = InteriorSetting.NOWSCENE.menu;
             }
         }
     }
     else
     {
         this.Control();
     }
     if (this.waittime > 0)
     {
         --this.waittime;
     }
     this.FlameControl(10);
     if (!this.moveflame)
     {
         return;
     }
     ++this.cursolanime;
     if (this.cursolanime >= 3)
     {
         this.cursolanime = 0;
     }
 }
Beispiel #2
0
        private void Control()
        {
            switch (this.nowschene)
            {
            case InteriorSetting.NOWSCENE.menu:
                if (Input.IsPress(Button._A))
                {
                    if (this.savedata.interiors.Count > 0)
                    {
                        this.sound.PlaySE(SoundEffect.decide);
                        this.overTop   = this.savedata.interiors.Count - 5;
                        this.nowschene = InteriorSetting.NOWSCENE.select;
                        break;
                    }
                    this.sound.PlaySE(SoundEffect.error);
                    break;
                }
                if (Input.IsPress(Button._B))
                {
                    this.sound.PlaySE(SoundEffect.cancel);
                    this.EndCommand();
                    break;
                }
                if (this.waittime > 0)
                {
                    break;
                }
                if (Input.IsPush(Button.Up))
                {
                    this.sound.PlaySE(SoundEffect.movecursol);
                    if (this.menu > InteriorSetting.MENU.put)
                    {
                        --this.menu;
                    }
                    else
                    {
                        this.menu = InteriorSetting.MENU.trash;
                    }
                    this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
                }
                else if (Input.IsPush(Button.Down))
                {
                    if (this.menu < InteriorSetting.MENU.trash)
                    {
                        ++this.menu;
                    }
                    else
                    {
                        this.menu = InteriorSetting.MENU.put;
                    }
                    this.sound.PlaySE(SoundEffect.movecursol);
                    this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
                }
                break;

            case InteriorSetting.NOWSCENE.select:
                if (Input.IsPress(Button._A))
                {
                    if (this.savedata.interiors.Count > 0)
                    {
                        this.sound.PlaySE(SoundEffect.decide);
                        switch (this.menu)
                        {
                        case InteriorSetting.MENU.put:
                            this.oldset = this.savedata.interiors[this.Select].set;
                            this.savedata.interiors[this.Select].set = true;
                            this.oldpoji = new Point(this.savedata.interiors[this.Select].posiX, this.savedata.interiors[this.Select].posiY);
                            this.oldspin = this.savedata.interiors[this.Select].rebirth;
                            this.parent.Field.InteriorSet();
                            this.nowschene = InteriorSetting.NOWSCENE.move;
                            return;

                        case InteriorSetting.MENU.remove:
                            this.savedata.interiors[this.Select].set = false;
                            this.parent.Field.InteriorSet();
                            return;

                        case InteriorSetting.MENU.sort:
                            if (this.sort)
                            {
                                Interior interior = this.savedata.interiors[this.Select1];
                                if (this.Select1 < this.Select2)
                                {
                                    this.savedata.interiors.Insert(this.Select2, interior);
                                    this.savedata.interiors.RemoveAt(this.Select1);
                                }
                                else
                                {
                                    this.savedata.interiors.RemoveAt(this.Select1);
                                    this.savedata.interiors.Insert(this.Select2, interior);
                                }
                                this.sound.PlaySE(SoundEffect.docking);
                                this.top1    = this.top2;
                                this.cursol1 = this.cursol2;
                                this.sort    = false;
                                return;
                            }
                            this.top2    = this.top1;
                            this.cursol2 = this.cursol1;
                            this.sort    = true;
                            return;

                        case InteriorSetting.MENU.trash:
                            this.EventMake();
                            return;

                        default:
                            return;
                        }
                    }
                    else
                    {
                        this.sound.PlaySE(SoundEffect.error);
                        break;
                    }
                }
                else
                {
                    if (Input.IsPress(Button._B))
                    {
                        this.sound.PlaySE(SoundEffect.cancel);
                        if (!this.sort)
                        {
                            this.parent.setCameraOn    = false;
                            this.parent.Player.NoPrint = false;
                            this.parent.cameraPlus.X   = 0.0f;
                            this.nowschene             = InteriorSetting.NOWSCENE.menu;
                            break;
                        }
                        this.sort = false;
                        break;
                    }
                    if (this.waittime > 0)
                    {
                        break;
                    }
                    if (Input.IsPush(Button.Up))
                    {
                        if (this.Select > 0)
                        {
                            if (this.Cursol > 0)
                            {
                                --this.Cursol;
                            }
                            else
                            {
                                --this.Top;
                            }
                            this.sound.PlaySE(SoundEffect.movecursol);
                            this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
                        }
                    }
                    else if (Input.IsPush(Button.Down))
                    {
                        if (this.Select < this.savedata.interiors.Count - 1)
                        {
                            if (this.Cursol < 4)
                            {
                                ++this.Cursol;
                            }
                            else
                            {
                                ++this.Top;
                            }
                            this.sound.PlaySE(SoundEffect.movecursol);
                            this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
                        }
                    }
                    else if (Input.IsPush(Button._R))
                    {
                        int num = this.overTop - this.Top;
                        if (num > 5)
                        {
                            num = 5;
                        }
                        if (num > 0)
                        {
                            this.sound.PlaySE(SoundEffect.movecursol);
                            this.Top += num;
                        }
                        this.waittime = Input.IsPress(Button._R) ? 10 : 4;
                    }
                    else if (Input.IsPush(Button._L))
                    {
                        int num = this.Top;
                        if (num > 5)
                        {
                            num = 5;
                        }
                        if (num > 0)
                        {
                            this.sound.PlaySE(SoundEffect.movecursol);
                            this.Top -= num;
                        }
                        this.waittime = Input.IsPress(Button._L) ? 10 : 4;
                    }
                    break;
                }

            case InteriorSetting.NOWSCENE.move:
                if (Input.IsPress(Button._A))
                {
                    this.sound.PlaySE(SoundEffect.decide);
                    this.nowschene = InteriorSetting.NOWSCENE.select;
                    break;
                }
                if (Input.IsPress(Button._B))
                {
                    this.sound.PlaySE(SoundEffect.cancel);
                    this.savedata.interiors[this.Select].posiX   = this.oldpoji.X;
                    this.savedata.interiors[this.Select].posiY   = this.oldpoji.Y;
                    this.savedata.interiors[this.Select].rebirth = this.oldspin;
                    this.savedata.interiors[this.Select].set     = this.oldset;
                    this.parent.Field.InteriorSet();
                    this.nowschene = InteriorSetting.NOWSCENE.select;
                    break;
                }
                if (Input.IsPress(Button._L))
                {
                    this.sound.PlaySE(SoundEffect.lance);
                    this.savedata.interiors[this.Select].rebirth = !this.savedata.interiors[this.Select].rebirth;
                    this.parent.Field.InteriorSet();
                    break;
                }
                if (this.waittime != 0)
                {
                    break;
                }
                if (Input.IsPush(Button.Up) && this.savedata.interiors[this.Select].posiY > -32)
                {
                    if (Input.IsPush(Button._R))
                    {
                        if (this.savedata.interiors[this.Select].posiY % 8 == 0)
                        {
                            this.savedata.interiors[this.Select].posiY -= 8;
                        }
                        else
                        {
                            this.savedata.interiors[this.Select].posiY = this.savedata.interiors[this.Select].posiY / 8 * 8;
                        }
                    }
                    else
                    {
                        --this.savedata.interiors[this.Select].posiY;
                    }
                    this.sound.PlaySE(SoundEffect.movecursol);
                    this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
                    this.parent.Field.InteriorSet();
                    this.CameraSet(true);
                }
                if (Input.IsPush(Button.Down) && this.savedata.interiors[this.Select].posiY < 232)
                {
                    if (Input.IsPush(Button._R))
                    {
                        if (this.savedata.interiors[this.Select].posiY % 8 == 0)
                        {
                            this.savedata.interiors[this.Select].posiY += 8;
                        }
                        else
                        {
                            this.savedata.interiors[this.Select].posiY = this.savedata.interiors[this.Select].posiY / 8 * 8 + 8;
                        }
                    }
                    else
                    {
                        ++this.savedata.interiors[this.Select].posiY;
                    }
                    this.sound.PlaySE(SoundEffect.movecursol);
                    this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
                    this.parent.Field.InteriorSet();
                    this.CameraSet(true);
                }
                if (Input.IsPush(Button.Left) && this.savedata.interiors[this.Select].posiX > -32)
                {
                    if (Input.IsPush(Button._R))
                    {
                        if (this.savedata.interiors[this.Select].posiX % 8 == 0)
                        {
                            this.savedata.interiors[this.Select].posiX -= 8;
                        }
                        else
                        {
                            this.savedata.interiors[this.Select].posiX = this.savedata.interiors[this.Select].posiX / 8 * 8;
                        }
                    }
                    else
                    {
                        --this.savedata.interiors[this.Select].posiX;
                    }
                    this.sound.PlaySE(SoundEffect.movecursol);
                    this.waittime = Input.IsPress(Button.Left) ? 10 : 4;
                    this.parent.Field.InteriorSet();
                    this.CameraSet(true);
                }
                if (Input.IsPush(Button.Right) && this.savedata.interiors[this.Select].posiX < 232)
                {
                    if (Input.IsPush(Button._R))
                    {
                        if (this.savedata.interiors[this.Select].posiX % 8 == 0)
                        {
                            this.savedata.interiors[this.Select].posiX += 8;
                        }
                        else
                        {
                            this.savedata.interiors[this.Select].posiX = this.savedata.interiors[this.Select].posiX / 8 * 8 + 8;
                        }
                    }
                    else
                    {
                        ++this.savedata.interiors[this.Select].posiX;
                    }
                    this.sound.PlaySE(SoundEffect.movecursol);
                    this.waittime = Input.IsPress(Button.Right) ? 10 : 4;
                    this.parent.Field.InteriorSet();
                    this.CameraSet(true);
                }
                break;
            }
        }