Exemplo n.º 1
0
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = System.Windows.Forms.VisualStyles.VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true
            };

            Background = new BackgroundControl {
                ShrinkToContents    = !RendersEntireSpace,
                VerticalAlignment   = System.Windows.Forms.VisualStyles.VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                Padding             = new Padding(3)
            };

            Controls.Add(flow);
            flow.Controls.Add(Background);

            foreach (var config in StatsControls)
            {
                Background.Controls.Add(config);
            }

            SetUpEntityForInfoControls(Entity);
        }
Exemplo n.º 2
0
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true
            };

            Background = new BackgroundControl {
                Position = Position, ShrinkToContents = !RendersEntireSpace, Padding = new Padding(4)
            };

            var innerflow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, VerticalAlignment = VerticalAlignment.Center, ShrinkToContents = true
            };

            Background.Controls.Add(innerflow);

            if (_displayEntity != null)
            {
                var entityControl = new MenuEntityControl {
                    Entity = _displayEntity, VerticalAlignment = VerticalAlignment.Center
                };
                innerflow.Controls.Add(entityControl);
            }

            innerflow.Controls.Add(new TextControl {
                Parameters = Text, VerticalAlignment = VerticalAlignment.Center, Margin = new Padding(2)
            });

            Controls.Add(flow);
            flow.Controls.Add(Background);
        }
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true,
                Padding             = new Padding(10)
            };

            var backgroundControl = new BackgroundControl
            {
                Position            = Position,
                Padding             = new Padding(3),
                ShrinkToContents    = true,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center
            };

            var downFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.TopDown, VerticalAlignment = VerticalAlignment.Top, ShrinkToContents = true
            };
            var sideFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true
            };
            var textControl = new TextControl {
                Parameters = _caption, Margin = new Padding(1)
            };
            var buttonControl = new ButtonControl {
                Text = "Cancel"
            };

            HoveredCellName = new TextControl {
                Parameters = HoveredCellText
            };

            buttonControl.OnClick += buttonControl_OnClick;

            Controls.Add(flow);
            flow.Controls.Add(backgroundControl);

            backgroundControl.Controls.Add(downFlow);

            downFlow.Controls.Add(textControl);
            downFlow.Controls.Add(sideFlow);
            downFlow.Controls.Add(HoveredCellName);
            downFlow.Controls.Add(buttonControl);

            foreach (var cell in Entities)
            {
                sideFlow.Controls.Add(new MenuEntityControl {
                    Entity = cell, Margin = new Padding(1)
                });
            }
        }
Exemplo n.º 4
0
 protected virtual void SetBackgroundColor(Color?color)
 {
     if (color != null)
     {
         BackgroundControl.SetBackground(color.Value);
     }
     else
     {
         BackgroundControl.ClearBackground();
     }
 }
Exemplo n.º 5
0
	// Use this for initialization
	void Start () {
        mHp = mOrinHp;
        mAttack = mOrinAttack;
        //Archer의 Animator 컴포넌트 레퍼런스를 가져옵니다.
        mAnimator = gameObject.GetComponent<Animator>();

        //계층 뷰(Hierache View)에 있는 게임오브젝트 컴포넌트 중 BackgroundControl타입의 컴포넌트를 모두 가져옵니다.
        BackgroundControl[] component = GameObject.FindObjectsOfType<BackgroundControl>();
        mBackgrounds = component[0];
        mForegrounds = component[1];

        //자식(child) 게임오브젝트 중 spot이라는 이름의 오브젝트를 찾아 transform 컴포넌트의 레퍼런스를 반환합니다.
        mAttackSpot = transform.FindChild("spot");
        mHpControl.SetHp(mHp);
	}
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        mHp     = mOrinHp;
        mAttack = mOrinAttack;
        //Archer의 Animator 컴포넌트 레퍼런스를 가져옵니다.
        mAnimator = gameObject.GetComponent <Animator>();

        //계층 뷰(Hierache View)에 있는 게임오브젝트 컴포넌트 중 BackgroundControl타입의 컴포넌트를 모두 가져옵니다.
        BackgroundControl[] component = GameObject.FindObjectsOfType <BackgroundControl>();
        mBackgrounds = component[0];
        mForegrounds = component[1];

        //자식(child) 게임오브젝트 중 spot이라는 이름의 오브젝트를 찾아 transform 컴포넌트의 레퍼런스를 반환합니다.
        mAttackSpot = transform.FindChild("spot");
        mHpControl.SetHp(mHp);
    }
Exemplo n.º 7
0
        public override void InitialiseControls()
        {
            var flow = new FlowContainerControl
            {
                VerticalAlignment   = VerticalAlignment.Center,
                HorizontalAlignment = HorizontalAlignment.Center,
                ApplyAlignment      = true,
                Padding             = new Padding(10)
            };


            var background = new BackgroundControl {
                ShrinkToContents = true, Padding = new Padding(2)
            };
            var text = new TextControl {
                Position = new Rectangle(), Parameters = _text, Margin = new Padding(1)
            };

            OkButton = new ButtonControl {
                Position = new Rectangle(), Text = "OK", Margin = new Padding(1)
            };
            CancelButton = new ButtonControl {
                Position = new Rectangle(), Text = "Cancel", Margin = new Padding(1)
            };

            var verticalFlow = new FlowContainerControl()
            {
                ShrinkToContents = true
            };
            var horizontalFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true
            };

            OkButton.IsFocused     = OkSelected;
            OkButton.OnClick      += OkButton_OnClick;
            CancelButton.IsFocused = !OkSelected;
            CancelButton.OnClick  += CancelButton_OnClick;

            Controls.Add(flow);
            flow.Controls.Add(background);
            background.Controls.Add(verticalFlow);
            verticalFlow.Controls.Add(text);
            verticalFlow.Controls.Add(horizontalFlow);
            horizontalFlow.Controls.Add(OkButton);
            horizontalFlow.Controls.Add(CancelButton);
        }
Exemplo n.º 8
0
    void Awake()
    {
        if (sharedInstance == null)
        {
            sharedInstance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }

        srBackground = GetComponent <SpriteRenderer> ();
        asBackground = GetComponent <AudioSource> ();

        SceneIntro();
    }
Exemplo n.º 9
0
        public override void InitialiseControls()
        {
            var label = new TextControl {
                Parameters = Text
            };
            var textBox = new TextBoxControl {
                Value = InputText
            };
            var background = new BackgroundControl {
                Position = Position
            };
            var topFlow = new FlowContainerControl();

            topFlow.Controls.Add(label);
            topFlow.Controls.Add(textBox);

            Controls.Add(background);
            Controls.Add(topFlow);
        }
Exemplo n.º 10
0
    protected virtual void Awake()
    {
        //solarCore = Object.FindObjectOfType<SolarCore>().gameObject;
        sRings = Object.FindObjectOfType <SolarRings>();

        background = Camera.main.GetComponent <BackgroundControl>();

        coin_prefab = Resources.Load("Prefabs/Coin") as GameObject;
        Pooler.Instantiate(coin, coin_prefab, 50);

        music = Music.Instance.GetComponent <AudioSource>();



        if (HardMode.active)
        {
            music.pitch *= 1.1f;
            syncOverride = true;
        }
    }
    public override void Setup()
    {
        backGroundList = new List <AbstractControl>();
        for (int i = 0; i < activePrefabCountbg; i++)
        {
            if (i == 0)
            {
                pos = new Vector2(gameView.localPosition.x, gameView.position.y);
            }
            else
            {
                pos = new Vector2(gameView.localPosition.x + scalePref, gameView.position.y);
            }

            bgControl = PoolController.Use(ControlPrefab, pos) as BackgroundControl;
            bgControl.PipeOffScreen += OnBackgroundOffScreen;
            backGroundList.Add(bgControl);

            GoOnInits1?.Invoke(bgControl);
        }
    }
Exemplo n.º 12
0
        public override void InitialiseControls()
        {
            var horizontalAlignment = Menu.Centred ? HorizontalAlignment.Center : HorizontalAlignment.Left;
            var verticalAlignment   = Menu.Centred ? VerticalAlignment.Center : VerticalAlignment.Top;

            var background = new BackgroundControl {
                Position = Position, Padding = Padding, HorizontalAlignment = horizontalAlignment, VerticalAlignment = verticalAlignment
            };

            Controls.Add(background);

            MenuActions = new MenuActionsControl {
                AvailableActions = Menu.AvailableActions, SelectedAction = Menu.SelectedAction, SelectedColor = Color.Blue, VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Right
            };
            background.Controls.Add(MenuActions);

            var topFlow = new FlowContainerControl {
                HorizontalAlignment = horizontalAlignment, VerticalAlignment = verticalAlignment, ShrinkToContents = true
            };

            var titleText = new LargeTextControl {
                Parameters = Menu.MenuName
            };

            topFlow.Controls.Add(titleText);

            var lineControl = new LineControl();

            topFlow.Controls.Add(lineControl);

            background.Controls.Add(topFlow);

            PagedMenuControl = new PagedMenuControl {
                MenuItems = Menu.MenuItems, SelectedItem = Menu.SelectedItem, ShrinkToContents = true, Margin = new Padding(4, 1, 1, 1), HorizontalAlignment = horizontalAlignment, VerticalAlignment = verticalAlignment
            };

            topFlow.Controls.Add(PagedMenuControl);
        }
Exemplo n.º 13
0
    /// <summary>
    /// Remove backgrounds that have gone off-screen.
    /// </summary>
    private void CullBackgrounds()
    {
        Vector3 offscreen = Camera.main.ScreenToWorldPoint(new Vector3(-1000.0f, 0, 0));

        // cull backgrounds (but never cull them all!)
        bool isDone = false;

        while (!isDone && mBackgrounds.Count > 1)
        {
            BackgroundControl first = mBackgrounds[0];

            // destroy if offscreen
            if (first.AttachPoint.transform.position.x < offscreen.x)
            {
                mBackgrounds.RemoveAt(0);
                Destroy(first.gameObject);
            }
            else
            {
                isDone = true;
            }
        }
    }
Exemplo n.º 14
0
        public override void InitialiseControls()
        {
            backgroundControl = new BackgroundControl {
                Position = Position, Padding = new Padding(3)
            };

            var topFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.BottomUp, VerticalAlignment = VerticalAlignment.Bottom
            };
            var downFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.TopDown, VerticalAlignment = VerticalAlignment.Top
            };

            ShopItemsFlow = new FlowContainerControl {
                FlowDirection = FlowDirection.LeftToRight
            };

            titleControl = new LargeTextControl {
                Parameters = this.shop.DescriptionName
            };
            exitButton = new ButtonControl {
                Position = new Rectangle(), Text = "Exit"
            };
            exitButton.OnClick += ExitButton_OnClick;

            Controls.Add(backgroundControl);
            backgroundControl.Controls.Add(topFlow);

            topFlow.Controls.Add(exitButton);
            topFlow.Controls.Add(downFlow);

            downFlow.Controls.Add(titleControl);
            downFlow.Controls.Add(new Spacer());
            downFlow.Controls.Add(ShopItemsFlow);

            RefreshShopItemControls();
        }
Exemplo n.º 15
0
 private void initializeUserControls()
 {
     introComponent                = new IntroControl(WM);
     raceComponent                 = new RaceControl(WM);
     alignmentComponent            = new AlignmentControl(WM);
     raceComponent.SubraceChanged += new EventHandler(raceComponent_SubraceChanged);
     ageComponent        = new AgeControl(WM);
     bodyComponent       = new BodyControl(WM);
     appearanceComponent = new AppearanceControl(WM);
     appearanceComponent.AppearanceChanged += new EventHandler(appearanceComponent_AppearanceChanged);
     classComponent = new ClassControl(WM);
     classComponent.ClassChanged       += new EventHandler(classComponent_ClassChanged);
     classComponent.ClassChoiceChanged += new EventHandler(classComponent_ClassChoiceChanged);
     backgroundComponent = new BackgroundControl(WM);
     abilityComponent    = new AbilityControl(WM);
     abilityComponent.AbilityAssigned      += new EventHandler(abilityComponent_AbilityAssigned);
     abilityComponent.AbilityBonusAssigned += new EventHandler(abilityComponent_AbilityBonusAssigned);
     languageComponent = new LanguageControl(WM);
     languageComponent.LanguageSelectionChanged += new EventHandler(languageComponent_LanguageSelectionChanged);
     skillComponent              = new SkillControl(WM);
     skillComponent.SkillChosen += new EventHandler(skillComponent_SkillChosen);
     equipmentComponent          = new EquipmentControl(WM);
     equipmentComponent.EquipmentSelectionChanged += new EventHandler(equipmentComponent_EquipmentSelectionChanged);
     spellComponent              = new SpellControl(WM);
     spellComponent.SpellChosen += new EventHandler(spellComponent_SpellChosen);
     extraRaceChoiceComponent    = new ExtraRaceChoiceControl(WM);
     extraRaceChoiceComponent.ExtraRaceChoiceChanged += new EventHandler(extraRaceChoiceComponent_ExtraRaceChoiceChanged);
     extraClassChoiceComponent = new ExtraClassChoiceControl(WM);
     extraClassChoiceComponent.SubcontrolOptionChosen += new EventHandler(extraClassChoiceComponent_SubcontrolOptionChosen);
     extraSubclassChoiceComponent = new ExtraSubclassChoiceControl(WM);
     extraSubclassChoiceComponent.SubcontrolOptionChosen += new EventHandler(extraSubclassChoiceComponent_SubcontrolOptionChosen);
     nameComponent                          = new NameControl(WM);
     nameComponent.NameChanged             += new EventHandler(nameComponent_NameChanged);
     storyComponent                         = new StoryControl(WM);
     storyComponent.SubcontrolOptionChosen += new EventHandler(storyComponent_SubcontrolOptionChosen);
     exportComponent                        = new ExportControl(WM);
 }
Exemplo n.º 16
0
        public MainWindow(IEnumerable <string> args)
        {
            InitializeComponent();
            var ver = Assembly.GetAssembly(typeof(MainWindow)).GetName().Version;

            Title = string.Format(Title, ver.Major, ver.Minor, ver.Build);
            Icon  = App.WpfIcon;

            #region Boxart

            _boxart           = new BoxartControl(this);
            BoxartTab.Content = _boxart;
            _boxartMenu       = new[] {
                new MenuItem {
                    Header = "Save Cover Art to File"
                },
                new MenuItem {
                    Header = "Select Cover Art Image"
                }
            };
            _boxartMenu[0].Click += _boxart.SaveImageToFileOnClick;
            _boxartMenu[1].Click += _boxart.SelectNewCover;

            #endregion

            #region Background

            _background           = new BackgroundControl(this);
            BackgroundTab.Content = _background;
            _backgroundMenu       = new[] {
                new MenuItem {
                    Header = "Save Background to File"
                },
                new MenuItem {
                    Header = "Select Background Image"
                }
            };
            _backgroundMenu[0].Click += _background.SaveImageToFileOnClick;
            _backgroundMenu[1].Click += _background.SelectNewBackground;

            #endregion

            #region Icon & Banner

            _iconBanner           = new IconBannerControl(this);
            IconBannerTab.Content = _iconBanner;
            _iconBannerMenu       = new UIElement[] {
                new MenuItem {
                    Header = "Save Icon to File"
                },
                new MenuItem {
                    Header = "Select Icon Image"
                },
                new Separator(),
                new MenuItem {
                    Header = "Save Banner to File"
                },
                new MenuItem {
                    Header = "Select Banner Image"
                }
            };
            ((MenuItem)_iconBannerMenu[0]).Click += _iconBanner.SaveIconToFileOnClick;
            ((MenuItem)_iconBannerMenu[1]).Click += _iconBanner.SelectNewIcon;
            ((MenuItem)_iconBannerMenu[3]).Click += _iconBanner.SaveBannerToFileOnClick;
            ((MenuItem)_iconBannerMenu[4]).Click += _iconBanner.SelectNewBanner;

            #endregion

            #region Screenshots

            _screenshots           = new ScreenshotsControl(this);
            ScreenshotsTab.Content = _screenshots;
            _screenshotsMenu       = new[] {
                new MenuItem {
                    Header = "Save Screenshot to File"
                },
                new MenuItem {
                    Header = "Replace Screenshot"
                },
                new MenuItem {
                    Header = "Select Screenshot Image(s)"
                },
                new MenuItem {
                    Header = "Remove Screenshot"
                }
            };
            _screenshotsMenu[0].Click += _screenshots.SaveImageToFileOnClick;
            _screenshotsMenu[1].Click += _screenshots.SelectNewScreenshot;
            _screenshotsMenu[2].Click += _screenshots.AddNewScreenshot;
            _screenshotsMenu[3].Click += _screenshots.RemoveScreenshot;

            #endregion

            OnlineAssetsTab.Content = new OnlineAssetsControl(this, _boxart, _background, _iconBanner, _screenshots);
            FtpAssetsTab.Content    = new FtpAssetsControl(this, _boxart, _background, _iconBanner, _screenshots);

            var bw = new BackgroundWorker();
            bw.DoWork += (sender, e) => {
                foreach (var arg in args.Where(File.Exists))
                {
                    if (VerifyAuroraMagic(arg))
                    {
                        LoadAuroraAsset(arg);
                    }
                    else
                    {
                        LoadFsdAsset(arg);
                    }
                }
            };
            bw.RunWorkerCompleted += (sender, e) => BusyIndicator.Visibility = Visibility.Collapsed;
            if (!args.Any())
            {
                return;
            }
            BusyIndicator.Visibility = Visibility.Visible;
            bw.RunWorkerAsync();
        }
Exemplo n.º 17
0
    public void Land()
    {
        BackgroundControl BGC = Planets[NextPlanet];

        BGC.Land();
    }
Exemplo n.º 18
0
    public void TakeOff()
    {
        BackgroundControl BGC = Planets[NextPlanet];

        BGC.TakeOff();
    }
Exemplo n.º 19
0
        public override void InitialiseControls()
        {
            var backgroundControl = new BackgroundControl {
                Position = Position, Padding = Padding
            };

            var topFlow = new FlowContainerControl {
                Position = Position, ShrinkToContents = true
            };

            var titleText = new LargeTextControl {
                Parameters = Form.Title
            };

            topFlow.Controls.Add(titleText);
            var lineControl = new LineControl();

            topFlow.Controls.Add(lineControl);

            var buttonFlowContainer = new FlowContainerControl {
                Position = Position, FlowDirection = FlowDirection.BottomUp, VerticalAlignment = VerticalAlignment.Bottom, ShrinkToContents = true
            };
            var buttonFlow = new FlowContainerControl {
                Position = Position, FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true, VerticalAlignment = VerticalAlignment.Bottom
            };

            buttonFlowContainer.Controls.Add(buttonFlow);

            Buttons = new List <ButtonControl>();
            foreach (var button in Form.Buttons.GetFlags())
            {
                var buttonControl = new ButtonControl {
                    Text = button.ToString(), Margin = new Padding(2)
                };
                buttonControl.OnClick += FormButtonControl_OnClick;
                buttonFlow.Controls.Add(buttonControl);
                Buttons.Add(buttonControl);
            }

            FormControls = new List <FormData>();
            foreach (var formField in Form.Fields)
            {
                var nameText = new TextControl {
                    Parameters = formField.Key + ": "
                };
                var formFieldControl = formField.Value;

                formFieldControl.OnClick += FormFieldControl_OnClick;
                FormControls.Add(formFieldControl);

                var subFlow = new FlowContainerControl {
                    FlowDirection = FlowDirection.LeftToRight, ShrinkToContents = true, Margin = new Padding {
                        Top = 1
                    }
                };
                subFlow.Controls.Add(nameText);
                subFlow.Controls.Add(formFieldControl);
                topFlow.Controls.Add(subFlow);
            }

            Controls.Add(backgroundControl);
            backgroundControl.Controls.Add(topFlow);
            backgroundControl.Controls.Add(buttonFlow);
        }
Exemplo n.º 20
0
    public void AnimatorEvent(string Key)
    {
        BackgroundControl BGC = Planets[NextPlanet];

        BGC.AnimatorEvent(Key);
    }
Exemplo n.º 21
0
        public Level LoadLevel(String file, ContentManager content, GraphicsDevice graphics, CollisionDetection collisions, BackgroundControl backgroundControl)
        {
            XmlDocument reader = new XmlDocument();

            reader.Load(file);

            Entities = new Collection <IEntity>();

            Camera camera = Camera.Instance;

            XmlNode root = reader.DocumentElement;

            if (root.HasChildNodes)
            {
                for (int i = Constants.ZERO; i < root.ChildNodes.Count; i++)
                {
                    entity = null;
                    XmlNode x = root.ChildNodes[i];

                    GetAttributes(x);
                    if (tag.Equals("avatar"))
                    {
                        if (type.Equals("peach"))
                        {
                            peach = new Peach(content, graphics)
                            {
                                Location    = new Vector2(float.Parse(xPosition), float.Parse(yPosition)),
                                Visible     = visBool,
                                VisBounding = visibleBounding
                            };
                            peach.Sprite.Velocity  = new Vector2(float.Parse(xVelocity), float.Parse(yVelocity));
                            peach.Sprite.Velocity += new Vector2(Constants.ZERO, float.Epsilon); // force frame 1 collision participation
                            Entities.Add(peach);
                            collisions.Register(peach);
                            camera.Peach            = peach;
                            backgroundControl.Peach = peach;
                        }
                    }
                    else if (tag.Equals("block"))
                    {
                        entity = AddBlock(x, content, graphics, collisions);
                    }
                    else if (tag.Equals("enemy"))
                    {
                        entity = AddEnemy(content, graphics, peach);
                        if (entity is Mario)
                        {
                            Debug.WriteLine("adding mario to collisions");
                        }
                        ;
                    }
                    else if (tag.Equals("item"))
                    {
                        entity = AddItem(content, graphics);
                    }
                    else if (tag.Equals("levelProperties"))
                    {
                        levelWidth  = int.Parse(width);
                        levelHeight = int.Parse(height);
                        if (!verticalScrollingMode)
                        {
                            camera.SetLevelBounds(Constants.ZERO, levelWidth, Constants.ZERO, 1080);
                        }
                        else
                        {
                            camera.SetLevelBounds(Constants.ZERO, 1920, Constants.ZERO, levelHeight);
                        }
                    }
                    SetProperties(collisions);
                }
            }
            return(new Level(Entities));
        }