示例#1
0
        public TitleChildSceneOptionUserSelect(AccountInformation ainfo, int idx, bool back, User[] us)
        {
            b = back;
            ai = ainfo;
            uinfo = new UserInformation(ai.Users[idx]);
            index = idx;
            mvf = (ta, aid, max) => (mai, val) =>
            {
                if (max > aid) ta[aid].Alpha = val ? 1.0 : 0.5;
            };
            users = us;
            opod = new List<StringSprite>
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 64 - 8, Value = "1st" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 96 - 8, Value = "2nd" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 128 - 8, Value = "3rd" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 160 - 8, Value = "4th" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 192 - 8, Value = "5th" }
            };
            next = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Blue) { X = 64, Y = nextpos - 8, Value = "決定" };
            opsn = new List<StringSprite>
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 64 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 96 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 128 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 160 - 8, Value = "" },
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 128, Y = 192 - 8, Value = "" }
            };
            mal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation(){ X = 32, Y = 64 },
                new MenuAllocationInformation(){ X = 32, Y = 96 },
                new MenuAllocationInformation(){ X = 32, Y = 128 },
                new MenuAllocationInformation(){ X = 32, Y = 160 },
                new MenuAllocationInformation(){ X = 32, Y = 192 },
                new MenuAllocationInformation(){ X = 32, Y = 224 },
            };
            opop = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 64, Y = 224 - 8, Value = "編集        削除" };
            opopmal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation(){X=40,Y=224},
                new MenuAllocationInformation(){X=136,Y=224},
            };

            okcancel = new List<StringSprite>
            {
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "OK", X = 528, Y = 180 , Alpha = 0},
                new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { Value = "キャンセル", X = 528, Y = 204, Alpha = 0 }
            };
            ocmal = new List<MenuAllocationInformation>
            {
                new MenuAllocationInformation(){X=512,Y=180+8,IsAvailable=false},
                new MenuAllocationInformation(){X=512,Y=204+8},
            };
            ouip = new OptionUserInformationPanel(ai.Tokens[index], ai.Users[index])
            {
                ChangingAction = (p) =>
                {
                    //タイムラグ対策
                    if (cs != 2) return;
                    if (p && users.Where(q => q != null).All(q => q.Id != ouip.SourceUser.Id))
                    {
                        valid.Value = "オプションOK";
                        valid.Color = CommonObjects.Colors.Blue;
                        ocmal[0].IsAvailable = true;
                    }
                    else
                    {
                        valid.Value = "オプションNG";
                        valid.Color = CommonObjects.Colors.Red;
                        ocmsel = 1;
                        ocmal[0].IsAvailable = false;
                        mc.AddSubOperation(SpritePatterns.VerticalMove(10, ocmal[ocmsel].Y, Easing.OutQuad));
                    }
                }
            };
            for (int i = 0; i < opopmal.Count; i++)
            {
                opopmal[i].Lefter = opopmal[(i + opopmal.Count - 1) % opopmal.Count];
                opopmal[i].Righter = opopmal[(i + 1) % opopmal.Count];
            }
            for (int i = 0; i < ocmal.Count; i++)
            {
                ocmal[i].Upper = ocmal[(i + ocmal.Count - 1) % ocmal.Count];
                ocmal[i].Lower = ocmal[(i + 1) % ocmal.Count];
                ocmal[i].AvailableChangingAction = mvf(okcancel, i, okcancel.Count);
            }
            for (int i = 0; i < mal.Count; i++)
            {
                mal[i].Upper = mal[(i + mal.Count - 1) % mal.Count];
                mal[i].Lower = mal[(i + 1) % mal.Count];
                mal[i].AvailableChangingAction = mvf(opod, i, opod.Count);
                mal[i].IsAvailable = (i < users.Length && users[i] != null) || i == mal.Count - 1 || (users.Count(p => p != null) == i);
            }
            for (int i = 0; i < opsn.Count; i++)
            {
                if (users[i] != null) opsn[i].Value = users[i].ScreenName;
            }

            valid = new StringSprite(CommonObjects.FontSystemMedium, CommonObjects.Colors.Black) { X = 320, Y = 216, Value = "オプションOK/NG" };
            mc = new MultiAdditionalCoroutineSprite() { Image = CommonObjects.ImageCursor128[1], HomeX = 64, HomeY = 64, ScaleX = 0.25, ScaleY = 0.25 };
            cs = 0;
            ki = null;
            msel = 0;
            ocmsel = 0;
        }
示例#2
0
 private void GoToScreenNameInput()
 {
     cs = 1;
     mc.AddSubOperation(SpritePatterns.Move(10, 300, 64, Easing.OutQuad));
     ki = new KeyInputObject(CommonObjects.FontSystemMedium, 20, true, true, false)
     {
         X = 376,
         Y = 64 - 8,
     };
     Manager.Add(ki, 1);
     okcancel.ForEach(p => p.Alpha = 0);
 }
示例#3
0
 public void SubMenuOperation()
 {
     if ((tstate.Direction & GamepadDirection.Up) != 0)
     {
         do
         {
             var tm = uvsmal.IndexOf(uvsmal[smsel].Upper);
             if (tm != -1) smsel = tm;
         } while (!uvsmal[smsel].IsAvailable);
         mc.AddSubOperation(SpritePatterns.VerticalMove(10, uvsmal[smsel].Y, Easing.OutQuad));
         CommonObjects.SoundMenuSelect.Play();
     }
     if ((tstate.Direction & GamepadDirection.Down) != 0)
     {
         do
         {
             var tm = uvsmal.IndexOf(uvsmal[smsel].Lower);
             if (tm != -1) smsel = tm;
         } while (!uvsmal[smsel].IsAvailable);
         mc.AddSubOperation(SpritePatterns.VerticalMove(10, uvsmal[smsel].Y, Easing.OutQuad));
         CommonObjects.SoundMenuSelect.Play();
     }
     switch (smsel)
     {
         case 0:
             if ((tstate.Direction & GamepadDirection.Left) != 0)
             {
                 osi[usel] = (osi[usel] + (OptionOperations.SelectionInformation.Count - 1)) % OptionOperations.SelectionInformation.Count;
                 RefreshOptionInformation(true);
                 CommonObjects.SoundMenuSelect.Play();
             }
             if ((tstate.Direction & GamepadDirection.Right) != 0)
             {
                 osi[usel] = (osi[usel] + 1) % OptionOperations.SelectionInformation.Count;
                 RefreshOptionInformation(true);
                 CommonObjects.SoundMenuSelect.Play();
             }
             break;
         case 1:
             if ((tstate.Direction & GamepadDirection.Left) != 0)
             {
                 oii[usel].Direction = (OptionDirection)((int)(oii[usel].Direction + (OptionOperations.OptionDirectionDescriptions.Count - 1)) % OptionOperations.OptionDirectionDescriptions.Count);
                 RefreshOptionInformation(false);
                 CommonObjects.SoundMenuSelect.Play();
             }
             if ((tstate.Direction & GamepadDirection.Right) != 0)
             {
                 oii[usel].Direction = (OptionDirection)((int)(oii[usel].Direction + 1) % OptionOperations.OptionDirectionDescriptions.Count);
                 RefreshOptionInformation(false);
                 CommonObjects.SoundMenuSelect.Play();
             }
             break;
         case 2:
             var tosi = OptionOperations.SelectionInformation[osi[usel]];
             if ((tstate.Direction & GamepadDirection.Left) != 0)
             {
                 oii[usel].Mode = (oii[usel].Mode + (tosi.ModeStrings.Count - 1)) % tosi.ModeStrings.Count;
                 RefreshOptionInformation(false);
                 CommonObjects.SoundMenuSelect.Play();
             }
             if ((tstate.Direction & GamepadDirection.Right) != 0)
             {
                 oii[usel].Mode = (oii[usel].Mode + 1) % tosi.ModeStrings.Count;
                 RefreshOptionInformation(false);
                 CommonObjects.SoundMenuSelect.Play();
             }
             break;
         case 3:
         case 4:
         case 5:
             if (tstate.Buttons[0])
             {
                 ki = new KeyInputObject(CommonObjects.FontSystemMedium, 256, true, false, false) { X = seluvs[smsel].X, Y = seluvs[smsel].Y };
                 seluvs[smsel].Alpha = 0;
                 Manager.Add(ki, 2);
                 cstate = 2;
                 CommonObjects.SoundMenuOK.Play();
             }
             break;
     }
     if (tstate.Buttons[1])
     {
         cstate = 0;
         mc.AvailableSubOperations.Clear();
         CommonObjects.SoundMenuCancel.Play();
     }
 }