Ejemplo n.º 1
0
        public HomeTopHeader(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, HomeBottomMenu hbm) : base(device)
        {
            this.resourceManager = resourceManager;
            this.hbm             = hbm;

            strings = new TextureString[HomeBottomMenu.ModeArray.Length];
            for (int i = 0; i < strings.Length; i++)
            {
                strings[i] = new TextureString(device, Utility.Language[HomeBottomMenu.ModeArray[i].ToString()], 18, true, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(400, 5)
                };
                strings[i].Alpha = 0;
                this.AddChild(strings[i]);
            }

            hbm.ModeChanged += hbm_ModeChanged;

            this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("l.png"))
            {
                Position = new SharpDX.Vector2(5, 5)
            });
            this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("r.png"))
            {
                Position = new SharpDX.Vector2(760, 5)
            });
            this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("header.png")));
        }
Ejemplo n.º 2
0
        public override void Load()
        {
            buttons = new Button[4];
            var names = new string[] { "RESUME", "RETRY", "REPLAY", "RETURN" };

            for (int i = 0; i < buttons.Length; i++)
            {
                buttons[i] = new Button(device, ResourceManager, pathManager, names[i])
                {
                    Position = new Vector2(400, 160 + 40 * i + 5)
                };
                buttons[i].Selected = false;
                this.AddChild(buttons[i]);
            }
            buttons[0].Selected    = true;
            buttons[2].Enabled     = false;
            latencyString          = new TextureString(device, GetLatencyString(PPDGameUtility.SongInformation.Latency), 20, PPDColors.White);
            latencyString.Position = new Vector2(400 - latencyString.Width / 2, 330);
            this.AddChild(latencyString);
            this.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("conftop.png"))
            {
                Position = new Vector2(266, 225 - 107)
            });
            this.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("confbottom.png"))
            {
                Position = new Vector2(266, 225 + 107 - 17)
            });
            this.AddChild(new PictureObject(device, ResourceManager, pathManager.Combine("confirmpause.png"))
            {
                Position = new Vector2(266, 118)
            });
            Hidden = false;
        }
Ejemplo n.º 3
0
            private void Generate()
            {
                this.AddChild(new TextureString(device, feed.Title, 20, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(10, 10)
                });
                this.AddChild(new TextureString(device, feed.Date.ToShortDateString(), 12, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(10, 40)
                });
                this.AddChild(new TextureString(device, feed.Author, 12, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(100, 40)
                });
                this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.White)
                {
                    Position = new SharpDX.Vector2(10, 35), RectangleWidth = 600, RectangleHeight = 1
                });

                float y = 70;

                foreach (string str in feed.Text.Split('\n'))
                {
                    var textureString = new TextureString(device, str, 14, 500, 800, true, PPDColors.White)
                    {
                        Position = new SharpDX.Vector2(30, y)
                    };
                    textureString.Update();
                    this.AddChild(textureString);
                    y += textureString.MultiLineHeight;
                }
            }
Ejemplo n.º 4
0
        public MultiSelectableText(PPDDevice device, IGameHost gameHost, PPDFramework.Resource.ResourceManager resourceManager, string startText, string[] menuTexts, int fontHeight) : base(device)
        {
            this.gameHost        = gameHost;
            this.resourceManager = resourceManager;
            this.fontHeight      = fontHeight;

            this.AddChild(startTextString = new TextureString(device, startText, fontHeight, PPDColors.White));
            var menus = new List <TextureString>();

            foreach (var menuText in menuTexts)
            {
                var obj = new TextureString(device, menuText, fontHeight, PPDColors.White)
                {
                    Alpha = 0
                };
                this.AddChild(obj);
                menus.Add(obj);
            }
            menuTextStrings         = menus.ToArray();
            this.AddChild(rectangle = new RectangleComponent(device, resourceManager, PPDColors.Active)
            {
                Position        = new Vector2(0, -fontHeight / 2),
                RectangleHeight = fontHeight + fontHeight,
                RectangleWidth  = 0,
                Alpha           = 0.75f
            });

            GotFocused  += MultiSelectableText_GotFocused;
            LostFocused += MultiSelectableText_LostFocused;
            Inputed     += MultiSelectableText_Inputed;
        }
Ejemplo n.º 5
0
        public ScoreSearcher(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, DxTextBox textBox, SongSelectFilter filter) : base(device)
        {
            this.textBox = textBox;
            this.filter  = filter;

            back = new PictureObject(device, resourceManager, Utility.Path.Combine("searchback.png"), true)
            {
                Position = new Vector2(400, 234)
            };

            sif = new SongInfoFinder(filter);

            border = new LineRectangleComponent(device, resourceManager, PPDColors.Selection)
            {
                BorderThickness = 3,
                Hidden          = true
            };
            this.AddChild(border);
            results = new TextureString[12];
            for (int i = 0; i < results.Length; i++)
            {
                results[i] = new TextureString(device, "", 20, 300, PPDColors.Black)
                {
                    Position = new Vector2(240, 120 + 26 * i)
                };
                this.AddChild(results[i]);
            }


            Inputed    += ScoreSearcher_Inputed;
            GotFocused += ScoreSearcher_GotFocused;

            this.AddChild(back);
        }
Ejemplo n.º 6
0
        public override void In(FlowEventArgs e)
        {
            SetValue(nameof(Height));
            SetValue(nameof(Position));
            SetValue(nameof(Text));
            SetValue(nameof(Color));

            if (Text == null)
            {
                Text = "";
            }

            if (resourceManager != null)
            {
                Object = new TextureString(resourceManager.Device, Text, Height, Color)
                {
                    Position = Position
                };
                OnSuccess();
            }
            else
            {
                OnFailed();
            }
        }
Ejemplo n.º 7
0
            public RoomContentComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, RoomInfo roomInfo) : base(device)
            {
                this.RoomInfo = roomInfo;

                if (roomInfo.HasPassword)
                {
                    this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("lock.png"))
                    {
                        Position = new Vector2(4, 1)
                    });
                }

                this.AddChild(roomName = new TextureString(device, roomInfo.RoomName, 20, 400, PPDColors.White)
                {
                    Position = new Vector2(25, 2)
                });
                this.AddChild(userName = new TextureString(device, roomInfo.UserName, 20, 140, PPDColors.White)
                {
                    Position = new Vector2(445, 2)
                });
                this.AddChild(new TextureString(device, roomInfo.Language.ToUpper(), 20, PPDColors.White)
                {
                    Position = new Vector2(605, 2)
                });
                this.AddChild(new TextureString(device, String.Format("{0}/16", roomInfo.PlayerCount), 20, 80, PPDColors.White)
                {
                    Position = new Vector2(655, 2)
                });
                this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("roomback.png")));

                roomName.AllowScroll = userName.AllowScroll = false;
            }
Ejemplo n.º 8
0
            public UserComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, User user) : base(device)
            {
                this.resourceManager = resourceManager;

                User = user;

                this.AddChild((userIcon = new PictureObject(device, resourceManager, PathObject.Absolute(currentUserIconPath), true)
                {
                    Position = new Vector2(21, 21)
                }));
                this.AddChild((userNameString = new TextureString(device, "", 18, 160, PPDColors.White)
                {
                    Position = new Vector2(42, 12)
                }));
                this.AddChild(rectangle = new RectangleComponent(device, resourceManager, PPDColors.White)
                {
                    Hidden          = true,
                    Position        = new Vector2(5, 5),
                    RectangleHeight = 30
                });

                AddBinding(new Binding(user, "Name", this, "UserName"));
                AddBinding(new Binding(user, "ImagePath", this, "UserImagePath"));
                ChangeUserIconScale();
            }
Ejemplo n.º 9
0
 public SongNameComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, bool isSelected) : base(device)
 {
     AddChild(folder = new PictureObject(device, resourceManager, Utility.Path.Combine("folder.png")));
     AddChild(ac     = new PictureObject(device, resourceManager, Utility.Path.Combine("ac.png"))
     {
         Position = new Vector2(30, -10)
     });
     AddChild(ft = new PictureObject(device, resourceManager, Utility.Path.Combine("ft.png"))
     {
         Position = new Vector2(70, -10)
     });
     AddChild(perfect = new PictureObject(device, resourceManager, Utility.Path.Combine("perfect.png"))
     {
         Position = new Vector2(110, -10)
     });
     AddChild(text = new TextureString(device, "", 20, 390, PPDColors.White)
     {
         Position = new Vector2(40, 5)
     });
     if (isSelected)
     {
         anim = new EffectObject(device, resourceManager, Utility.Path.Combine("selectback.etd"))
         {
             PlayType  = Effect2D.EffectManager.PlayType.Loop,
             Alignment = EffectObject.EffectAlignment.TopLeft
         };
         anim.Play();
         AddChild(anim);
     }
     else
     {
         back = new PictureObject(device, resourceManager, Utility.Path.Combine("selectback.png"));
         AddChild(back);
     }
 }
Ejemplo n.º 10
0
        public MovieVolumeSprite(PPDDevice device, MyGame myGame) : base(device)
        {
            this.myGame     = myGame;
            resourceManager = new PPDFramework.Resource.ResourceManager();

            var color = PPDColors.Green;

            this.AddChild(new TextureString(device, Utility.Language["Video"], 30, color)
            {
                Position  = new Vector2(800, 0),
                Alignment = Alignment.Right
            });
            this.AddChild(volumeText = new TextureString(device, "100", 30, color)
            {
                Position  = new Vector2(70, 400),
                Alignment = Alignment.Right
            });
            rects = new RectangleComponent[50];
            for (int i = 0; i < rects.Length; i++)
            {
                rects[i] = new RectangleComponent(device, resourceManager, color)
                {
                    Position        = new Vector2(80 + i * (RectWidth + RectMargin), 400),
                    RectangleHeight = RectHeight,
                    RectangleWidth  = RectWidth
                };
                this.AddChild(rects[i]);
            }
            Hidden = true;
        }
Ejemplo n.º 11
0
        public ChangeVolumeSprite(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, MyGame myGame, ISound sound) : base(device)
        {
            this.resourceManager = resourceManager;
            this.myGame          = myGame;
            this.sound           = sound;

            texts   = new TextureString[3];
            rects   = new RectangleComponent[3];
            spheres = new PictureObject[3];
            var sprite = new SpriteObject(device,
                                          texts[0] = new TextureString(device, Utility.Language["Master"], 18, PPDColors.White),
                                          texts[1] = new TextureString(device, Utility.Language["Movie"], 18, PPDColors.White)
            {
                Position = new SharpDX.Vector2(0, 25)
            },
                                          texts[2] = new TextureString(device, Utility.Language["SE"], 18, PPDColors.White)
            {
                Position = new SharpDX.Vector2(0, 50)
            },
                                          rects[0] = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position = new SharpDX.Vector2(RectStartX, 10), RectangleHeight = 2, RectangleWidth = RectWidth
            },
                                          rects[1] = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position = new SharpDX.Vector2(RectStartX, 35), RectangleHeight = 2, RectangleWidth = RectWidth
            },
                                          rects[2] = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                Position = new SharpDX.Vector2(RectStartX, 60), RectangleHeight = 2, RectangleWidth = RectWidth
            },
                                          spheres[0] = new PictureObject(device, resourceManager, Utility.Path.Combine("sphere.png"), true)
            {
                Position = new SharpDX.Vector2(RectStartX, 10)
            },
                                          spheres[1] = new PictureObject(device, resourceManager, Utility.Path.Combine("sphere.png"), true)
            {
                Position = new SharpDX.Vector2(RectStartX, 35)
            },
                                          spheres[2] = new PictureObject(device, resourceManager, Utility.Path.Combine("sphere.png"), true)
            {
                Position = new SharpDX.Vector2(RectStartX, 60)
            },
                                          select = new PictureObject(device, resourceManager, Utility.Path.Combine("right.png"), true)
            {
                Position = new SharpDX.Vector2(30, 0),
                Scale    = new SharpDX.Vector2(0.5f, 0.5f)
            }
                                          )
            {
                Position = new SharpDX.Vector2(160, 225 - 75 / 2f)
            };

            modified = true;

            this.AddChild(sprite);
            AdjustPosition();
            Inputed     += ChangeVolumeSprite_Inputed;
            LostFocused += ChangeVolumeSprite_LostFocused;
        }
Ejemplo n.º 12
0
        public GameInterfaceBottom(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PPDGameUtility gameUtility) : base(device)
        {
            bottom       = new PictureObject(device, resourceManager, Utility.Path.Combine("bottom.png"));
            bottomdanger = new PictureObject(device, resourceManager, Utility.Path.Combine("bottomred.png"))
            {
                Hidden = true
            };

            kasi = new TextureString(device, "", 20, true, PPDColors.White);

            this.AddChild(kasi);

            if (gameUtility.AutoMode != AutoMode.None)
            {
                this.AddChild(new TextureString(device, "-AUTO-", 20, PPDColors.White)
                {
                    Position = new Vector2(710, 16)
                });
            }

            lg = new LifeGage(device, resourceManager);
            te = new TemporaryEvaluate(device, resourceManager);

            this.AddChild(lg);
            this.AddChild(te);
            this.AddChild(bottomdanger);
            this.AddChild(bottom);
            InitializeComponentPosition();
        }
Ejemplo n.º 13
0
 public ModInfoComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ModInfo modInfo, bool allowedByServer)
     : base(device, modInfo)
 {
     this.allowedByServer = allowedByServer;
     this.AddChild(check  = new PictureObject(device, resourceManager, Utility.Path.Combine("optioncheck.png"))
     {
         Position = new Vector2(0, -5),
         Scale    = new Vector2(0.5f),
         Hidden   = !modInfo.IsApplied
     });
     this.AddChild(checkBox = new PictureObject(device, resourceManager, Utility.Path.Combine("optioncheckbox.png"))
     {
         Position = new Vector2(7, 7),
         Scale    = new Vector2(0.5f),
         Alpha    = 0
     });
     this.AddChild(text = new TextureString(device, modInfo.DisplayName, 20, 320, PPDColors.White)
     {
         Position = new Vector2(30, 0)
     });
     this.AddChild(availableRanking = new PictureObject(device, resourceManager, Utility.Path.Combine("checkgreen.png"))
     {
         Position = new Vector2(0, 2)
     });
     UpdateInfo();
 }
Ejemplo n.º 14
0
 public DxTextBox(PPDDevice device, IGameHost host, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
 {
     this.host      = host;
     back           = new RectangleComponent(device, resourceManager, PPDColors.White);
     selection      = new RectangleComponent(device, resourceManager, PPDColors.Active);
     border         = new LineRectangleComponent(device, resourceManager, PPDColors.Selection);
     caret          = new RectangleComponent(device, resourceManager, PPDColors.Black);
     caret.CanDraw += (o, c, d, ci) =>
     {
         return(count >= 30 && Focused);
     };
     stringObj                   = new TextureString(device, "", 14, PPDColors.Black);
     TextBoxWidth                = 150;
     MaxTextLength               = int.MaxValue;
     MaxWidth                    = int.MaxValue;
     DrawMode                    = DrawingMode.DrawAll;
     DrawOnlyFocus               = true;
     GotFocused                 += DxTextBox_GotFocused;
     LostFocused                += DxTextBox_LostFocused;
     Inputed                    += DxTextBox_Inputed;
     host.IMEStarted            += host_IMEStarted;
     host.TextBoxEnabledChanged += host_TextBoxEnabledChanged;
     this.AddChild(border);
     this.AddChild(caret);
     this.AddChild(stringObj);
     this.AddChild(selection);
     this.AddChild(back);
 }
Ejemplo n.º 15
0
        public GraphDrawer(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
        {
            this.AddChild(name  = new TextureString(device, "", 16, PPDColors.White));
            this.AddChild(xname = new TextureString(device, Utility.Language["Latest"], 12, PPDColors.White));
            ynames = new TextureString[5];
            for (int i = 0; i < ynames.Length; i++)
            {
                this.AddChild(ynames[i] = new TextureString(device, "", 12, PPDColors.White));
            }
            this.AddChild(yAxis = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                RectangleWidth = 2
            });
            this.AddChild(xAxis = new RectangleComponent(device, resourceManager, PPDColors.White)
            {
                RectangleHeight = 2
            });
            this.AddChild(line = new LineComponent(device, resourceManager, lineColor)
            {
                LineWidth = 2
            });

            poses     = new List <Vector2>();
            Formatter = FloatToIntFormatter.Formatter;
        }
Ejemplo n.º 16
0
        public ConfirmComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string message, string yes, string no, string ok, ConfirmButtonType buttonType) : base(device)
        {
            this.resourceManager = resourceManager;

            confirm = new TextureString(device, message, 15, 200, 400, true, true, PPDColors.White)
            {
                Position = new Vector2(300, 150)
            };
            this.AddChild(confirm);

            if (buttonType == ConfirmButtonType.YesNo)
            {
                buttons = new Button[2];
                for (int i = 0; i < buttons.Length; i++)
                {
                    buttons[i] = new Button(device, resourceManager, pathManager, i == 0 ? yes : no)
                    {
                        Position = new Vector2(i == 0 ? 350 : 450, 280)
                    };

                    buttons[i].Selected = false;
                    this.AddChild(buttons[i]);
                }
            }
            else
            {
                buttons    = new Button[1];
                buttons[0] = new Button(device, resourceManager, pathManager, ok)
                {
                    Position = new Vector2(400, 280)
                };
            }
            buttons[0].Selected = true;

            this.AddChild(new PictureObject(device, resourceManager, pathManager.Combine("conftop.png"))
            {
                Position = new Vector2(266, 225 - 107)
            });
            this.AddChild(new PictureObject(device, resourceManager, pathManager.Combine("confbottom.png"))
            {
                Position = new Vector2(266, 225 + 107 - 17)
            });
            this.AddChild(new PictureObject(device, resourceManager, pathManager.Combine("confirmpause.png"))
            {
                Position = new Vector2(266, 118)
            });
            this.AddChild(new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleWidth  = 800,
                RectangleHeight = 450,
                Alpha           = 0.75f
            });

            Alpha = 1;

            Inputed += ConfirmComponent_Inputed;
        }
Ejemplo n.º 17
0
 private void UpdateDepth()
 {
     if (text != null)
     {
         this.RemoveChild(text);
     }
     text = new TextureString(device, "", 14, 350 - 30 * depth, PPDColors.White);
     this.InsertChild(text, 0);
 }
Ejemplo n.º 18
0
        public OpenBrowserDialog(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, ISound sound) : base(device)
        {
            this.sound = sound;

            confirm = new EffectObject(device, resourceManager, Utility.Path.Combine("tweetconfirm.etd"))
            {
                Position = new Vector2(400, 225)
            };
            black = new RectangleComponent(device, resourceManager, PPDColors.Black)
            {
                RectangleHeight = 450,
                RectangleWidth  = 800,
                Alpha           = 0.5f
            };
            sprite = new SpriteObject(device);
            text   = new TextureString(device, Utility.Language["NotHaveScoreDownload"], 16, 300, 200, true, PPDColors.White)
            {
                Position = new Vector2(240, 120)
            };

            buttons = new Button[2];
            for (int i = 0; i < buttons.Length; i++)
            {
                string str = "";
                switch (i)
                {
                case 0:
                    str = Utility.Language["OK"];
                    break;

                case 1:
                    str = Utility.Language["Cancel"];
                    break;
                }
                buttons[i] = new Button(device, resourceManager, Utility.Path, str)
                {
                    Position = new Vector2(300 + i * 200, 315)
                };
                buttons[i].Selected = false;
                this.AddChild(buttons[i]);
            }

            buttons[0].Selected = true;

            this.AddChild(sprite);
            sprite.AddChild(text);
            sprite.AddChild(buttons[0]);
            sprite.AddChild(buttons[1]);
            this.AddChild(confirm);
            this.AddChild(black);

            confirm.PlayType = Effect2D.EffectManager.PlayType.Once;
            confirm.Play();
            confirm.Seek(EffectObject.SeekPosition.End);

            Inputed += OpenBrowserDialog_Inputed;
        }
Ejemplo n.º 19
0
 public UpdatableScoreGameCompoennt(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, WebSongInformation songInformation) : base(device)
 {
     this.resourceManager = resourceManager;
     this.songInformation = songInformation;
     this.AddChild(new StackObject(device,
                                   songInfoText = new TextureString(device, songInformation.Title, 18, PPDColors.White),
                                   new SpaceObject(device, 5, 1),
                                   stateText = new TextureString(device, "", 18, PPDColors.White))
     {
         IsHorizontal = true
     });
     UpdateStateText();
 }
Ejemplo n.º 20
0
 private bool LFRecursiveDraw(List <TreeViewItem> sis, ref int iter)
 {
     foreach (LogicFolderTreeViewItem child in sis)
     {
         TextureString ts = child.TextureString;
         if (iter >= 0)
         {
             if (child == lfTreeView.SelectedItem)
             {
                 logicInfoSelection.RectangleHeight = ts.CharacterHeight + gapY;
                 logicInfoSelection.RectangleWidth  = ts.JustWidth;
                 logicInfoSelection.Position        = ts.Position;
                 logicInfoSelection.Update();
                 logicInfoSelection.Draw();
             }
             ts.Draw();
             if (!child.LogicFolderInfo.IsFolder)
             {
                 score.Position = new Vector2(ts.Position.X - 20, ts.Position.Y - 2);
                 score.Update();
                 score.Draw();
             }
             else
             {
                 folder.Position = new Vector2(ts.Position.X - 20, ts.Position.Y);
                 folder.Update();
                 folder.Draw();
             }
             if (child == cutOrCopylftvi)
             {
                 /*GraphicsUtility.DrawLine(new Vector2(ts.Position.X - 20, ts.Position.Y + ts.CharacterHeight + gapY),
                  *  new Vector2(ts.Position.X + ts.JustWidth, ts.Position.Y + ts.CharacterHeight + gapY),
                  *  PPDColors.White, 0.5f, cut ? GraphicsUtility.LineMode.Dashed : GraphicsUtility.LineMode.Solid, white);*/
             }
         }
         iter++;
         if (iter >= maxHeightNumber)
         {
             return(false);
         }
         if (child.LogicFolderInfo.IsFolder && child.IsExpanded)
         {
             if (!LFRecursiveDraw(child.Items, ref iter))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Ejemplo n.º 21
0
 public DirModInfoComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, DirModInfo modInfo)
     : base(device, modInfo)
 {
     this.AddChild(folder = new PictureObject(device, resourceManager, Utility.Path.Combine("folder.png"))
     {
         Scale = new Vector2(0.8f),
         Alpha = 0.5f
     });
     this.AddChild(text = new TextureString(device, modInfo.DisplayName, 20, 320, PPDColors.White)
     {
         Position = new Vector2(30, 0)
     });
     UpdateInfo();
 }
Ejemplo n.º 22
0
        private void InternalStruct(PPDFramework.Resource.ResourceManager resourceManager, PathObject normalImgPath, PathObject overImgPath, TextureString str)
        {
            normal = new PictureObject(device, resourceManager, normalImgPath, true);
            this.AddChild(normal);
            over = new PictureObject(device, resourceManager, overImgPath, true);
            this.AddChild(over);
            over.Alpha = 0;
            this.str   = str;
            this.AddChild(str);
            str.Alpha    = 0;
            str.Position = new SharpDX.Vector2(-str.Width / 2, -normal.Height / 2 - str.Height);

            MouseEnter += FadableButton_MouseEnter;
            MouseLeave += FadableButton_MouseLeave;
        }
Ejemplo n.º 23
0
        public void AddSelection(string text)
        {
            var textureString = new TextureString(device, text, 18, PPDColors.White)
            {
                Position = new SharpDX.Vector2(400, 0)
            };

            textureString.MouseEnter     += textureString_MouseEnter;
            textureString.MouseLeftClick += textureString_MouseLeftClick;
            textSprite.AddChild(textureString);
            modified = true;
            menuEnabled.Add(true);
            selectCount++;
            currentIndex = 0;
        }
Ejemplo n.º 24
0
            public NotifyComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, GameTimer gameTimer, string text) : base(device)
            {
                this.gameTimer = gameTimer;
                TextureString textureString = null;

                this.AddChild(textureString = new TextureString(device, text, 10, PPDColors.Black)
                {
                    Position = new Vector2(26, 8)
                });
                this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("notify_back.png")));
                textureString.Update();
                this.Position = new Vector2(Math.Max(400, 800 - textureString.Width - 40), 0);
                initTime      = gameTimer.ElapsedTime;
                this.Alpha    = 0;
            }
Ejemplo n.º 25
0
            public SystemMessageComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, Message message) : base(device)
            {
                this.resourceManager = resourceManager;

                Color4 color = PPDColors.White;

                this.AddChild((messageString = new TextureString(device, "", 10, 300, 40, true, PPDColors.Black)
                {
                    Position = new Vector2(10, 1)
                }));
                this.AddChild((back = new PictureObject(device, resourceManager, Utility.Path.Combine("system_back.png"))));

                AddBinding(new Binding(message, "User.Color", this, "Color"));
                AddBinding(new Binding(message, "Text", this, "Text"));

                Alpha = 0;
            }
Ejemplo n.º 26
0
 public ModSettingComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager,
                            ModSetting modSetting, string currentValue) : base(device)
 {
     this.AddChild(nameText = new TextureString(device, modSetting.Name, 24, 500, PPDColors.White)
     {
         AllowScroll = false
     });
     this.AddChild(infoText = new TextureString(device, GetInfoText(modSetting), 12, PPDColors.White));
     infoText.Update();
     infoText.Position             = new Vector2(690 - infoText.Width, 30);
     this.AddChild(descriptionText = new TextureString(device, modSetting.Description, 18, 660, int.MaxValue, true, PPDColors.White)
     {
         Position = new Vector2(15, 40)
     });
     this.AddChild(valueText = new TextureString(device, currentValue, 24, 400, PPDColors.White));
     valueText.Update();
     valueText.Position = new Vector2(690 - valueText.Width, 0);
 }
Ejemplo n.º 27
0
            public RankingChild(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager) : base(device)
            {
                gold        = new PictureObject(device, resourceManager, Utility.Path.Combine("1st.png"));
                silver      = new PictureObject(device, resourceManager, Utility.Path.Combine("2nd.png"));
                bronze      = new PictureObject(device, resourceManager, Utility.Path.Combine("3rd.png"));
                gold.Hidden = silver.Hidden = bronze.Hidden = true;
                text        = new TextureString(device, "", 12, 230, PPDColors.White)
                {
                    Position    = new SharpDX.Vector2(25, 0),
                    AllowScroll = true
                };

                Rank = 1;
                this.AddChild(gold);
                this.AddChild(silver);
                this.AddChild(bronze);
                this.AddChild(text);
            }
Ejemplo n.º 28
0
 private bool RecursiveDraw(List <TreeViewItem> sis, ref int iter)
 {
     foreach (SongInfoTreeViewItem child in sis)
     {
         TextureString ts = child.TextureString;
         if (iter >= 0)
         {
             if (child == siTreeView.SelectedItem)
             {
                 songInfoSelection.RectangleHeight = ts.CharacterHeight + gapY;
                 songInfoSelection.RectangleWidth  = ts.JustWidth;
                 songInfoSelection.Position        = ts.Position;
                 songInfoSelection.Update();
                 songInfoSelection.Draw();
             }
             ts.Draw();
             if (child.SongInformation.IsPPDSong)
             {
                 score.Position = new Vector2(ts.Position.X - 20, ts.Position.Y - 2);
                 score.Update();
                 score.Draw();
             }
             else
             {
                 folder.Position = new Vector2(ts.Position.X - 20, ts.Position.Y);
                 folder.Update();
                 folder.Draw();
             }
         }
         iter++;
         if (iter >= maxHeightNumber)
         {
             return(false);
         }
         if (!child.SongInformation.IsPPDSong && child.IsExpanded)
         {
             if (!RecursiveDraw(child.Items, ref iter))
             {
                 return(false);
             }
         }
     }
     return(true);
 }
Ejemplo n.º 29
0
        public ButtonComponent(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, PathManager pathManager, string text) : base(device)
        {
            TextureString str;

            this.AddChild(str = new TextureString(device, text, 20, PPDColors.White)
            {
                Position = new Vector2(30, 0)
            });

            select = new EffectObject(device, resourceManager, pathManager.Combine("greenflare.etd"))
            {
                Position = new Vector2(13, 13)
            };
            select.PlayType = Effect2D.EffectManager.PlayType.ReverseLoop;
            select.Play();
            select.Alignment = EffectObject.EffectAlignment.Center;
            select.Scale     = new Vector2(0.4f, 0.4f);
            this.AddChild(select);
        }
Ejemplo n.º 30
0
        public MenuSelectSong(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, Menu menu) : base(device)
        {
            this.menu      = menu;
            state          = State.NotAppeared;
            pictureobjects = new ArrayList();

            mode = new PictureObject(device, resourceManager, Utility.Path.Combine("modeselect.png"))
            {
                Position = new Vector2(-10, 20)
            };
            modeStringLeft = new TextureString(device, Utility.Language["List"], 16, true, PPDColors.Gray)
            {
                Position = new Vector2(50, 25)
            };
            modeStringCenter = new TextureString(device, Utility.Language["Score"], 16, true, PPDColors.White)
            {
                Position = new Vector2(170, 25)
            };
            modeStringRight = new TextureString(device, Utility.Language["Link"], 16, true, PPDColors.Gray)
            {
                Position = new Vector2(290, 25)
            };
            songNameSprite = new SpriteObject(device)
            {
                Position = new Vector2(0, ItemsDefaultY)
            };
            songNames = new SongNameComponent[ItemCount];
            for (var i = 0; i < songNames.Length; i++)
            {
                songNames[i] = new SongNameComponent(device, resourceManager, i == (ItemCount / 2))
                {
                    Position  = new Vector2(0, (SongNameComponent.ItemHeight + 5) * i + (i > (ItemCount / 2) ? 10 : 0)),
                    ItemAlpha = (float)1 / (Math.Abs(i - (ItemCount / 2)) + 1)
                };
                songNameSprite.AddChild(songNames[i]);
            }
            this.AddChild(songNameSprite);

            this.AddChild(modeStringLeft);
            this.AddChild(modeStringCenter);
            this.AddChild(modeStringRight);
            this.AddChild(mode);
        }