Пример #1
0
        /// <summary>
        /// Sample Button Scroll List Menu
        /// </summary>
        public ChooseLevelMenu(MultiController controllers, List <Controller> allControllers, Rectangle bounds, GameManager pmanager)
            : base(controllers, bounds)
        {
            manager          = pmanager;
            BaseFrame.Layout = Layout.None;

            //Create a title, and scale the text so it is a little bigger
            new Label(BaseFrame, "List of levels")
            {
                Scale             = new Vector2(2f, 2f),
                FontColor         = Color.Gold,
                VerticalAlignment = VAlign.Top
            };

            sl = new ScrollList(BaseFrame, 10)
            {
                Direction           = ScrollList.Orientation.Horizontal,
                LayoutStretch       = 5,
                ScrollPosition      = ScrollList.ScrollBarPosition.Left, //left means top for horizontal orientation
                HorizontalAlignment = HAlign.Center
            };

            createScrollList(sl);

            /* ScrollList tsl = createScrollList(sl); tsl.Scale *= 2f;
             * tsl = createScrollList(sl); tsl.Scale *= 0.5f;
             * tsl = createScrollList(sl);
             * tsl = createScrollList(sl); tsl.Scale *= 2f;
             */
            Reset();
        }
Пример #2
0
 public static void AddScrollListOnScrollOver(ScrollList list, LuaFunction onScrollOver)
 {
     list.onScrollOver = delegate(int index)
     {
         onScrollOver.Call(index);
     };
 }
Пример #3
0
 public static void AddScrollListOnItemRender(ScrollList list, LuaFunction OnItemRender)
 {
     list.onItemRender = delegate(int index, Transform item)
     {
         OnItemRender.Call(index, item);
     };
 }
Пример #4
0
 public ScrollPairData(string key, string value)
 {
     title = key;
             help = value;
             animationAlpha	= 0.0f;
             chield = null;
 }
Пример #5
0
 public ScrollPairData(string key, string value)
 {
     title          = key;
     help           = value;
     animationAlpha = 0.0f;
     chield         = null;
 }
 public void Setup(Item currentItem, ScrollList currentScrollList)
 {
     item           = currentItem;
     nameLabel.text = item.Intitule + "  MP " + item.Mana + "  TPE " + item.IntituleType + "   CAR " + item.Caracteristique + "  FOR: " + item.Power;
     scrollList     = currentScrollList;
     this.gameObject.GetComponent <RectTransform>().localScale = new Vector2(1, 1);
 }
Пример #7
0
 void Awake()
 {
     instance = this;
     //引导页调用
     DownloadProp.Instance.AutoCheckUpdateLocalComponent();
     //引导页调用
     DownloadProp.Instance.UpdatePreview();
 }
Пример #8
0
 public void Setup(Destination currentDestination, ScrollList currentScrollList)
 {
     destination               = currentDestination;
     nameLabel.text            = destination.destinationName;
     destination.coordinates.x = currentDestination.coordinates.x;
     destination.coordinates.y = currentDestination.coordinates.y;
     scrollList = currentScrollList;
 }
Пример #9
0
 public void Setup(Item currentItem, ScrollList currentScrollList)
 {
     item             = currentItem;
     nameLabel.text   = item.itemName;
     iconImage.sprite = item.icon;
     priceText.text   = "$" + item.price.ToString();
     prefab           = item.prefab;
     scrollList       = currentScrollList;
 }
Пример #10
0
            public static void Create(ref ScrollList <T> scrollList, ScrollRect scrollArea, PrefabInstancePool itemPool, IList <T> items = null)
            {
                if (scrollList == null)
                {
                    scrollList = new ScrollList <T>(scrollArea, itemPool);
                }

                scrollList.Initialise(items);
            }
Пример #11
0
        protected void drawList(ScrollList list, RenderManager manager, GameTime time)
        {
            var renderer = list.getRenderer();

            if (renderer != null)
            {
                renderer.draw(manager, time);
            }
        }
Пример #12
0
 public void Setup(Item item, ScrollList scrollList)
 {
     curScrollList  = scrollList;
     curItem        = item;
     itemName.text  = "Name: " + item.itemName;
     price.text     = "100";
     RemainNum.text = "Remain: " + item.itemRemain.ToString();
     Debug.Log("itemRemain is" + item.itemRemain);
 }
Пример #13
0
 private void RemoveItem(Item itemToRemove, ScrollList shopList)
 {
     for (int i = shopList.itemList.Count - 1; i >= 0; i--)
     {
         if (shopList.itemList[i] == itemToRemove)
         {
             shopList.itemList.RemoveAt(i);
         }
     }
 }
        public ContactsController(OrganazerContext context, KeyboardInput parser) : base(context, parser)
        {
            var listBox = new ScrollList(1, 1, 11, 9);

            foreach (var person in context.People.ToList())
            {
                listBox.AddItem(person.FirstName + " " + person.LastName, person.Id);
            }

            this.root = new ContactList(0, 0, listBox);
        }
Пример #15
0
    void Start()
    {
        CreateReticleVertices();

        materialComp = gameObject.GetComponent <Renderer>().material;
        // access to the circularSlider and initialize its fill amount to zero
        circularBar            = gameObject.GetComponent <CirclularBar>().circularSlider;
        circularBar.fillAmount = 0;
        // CHANGE
        script = content.GetComponent <ScrollList>();
    }
Пример #16
0
//	public void TryTransferItemToOtherShop(Item item)
//	{
//		if (otherShop.gold >= item.price)
//		{
//			gold += item.price;
//			otherShop.gold -= item.price;
//
//			AddItem(item, otherShop);
//			RemoveItem(item, this);
//
//			RefreshDisplay();
//			otherShop.RefreshDisplay();
//			Debug.Log ("enough gold");
//
//		}
//		Debug.Log ("attempted");
//	}

//	private void AddItem(Item itemToAdd, ScrollList List)
//	{
//		List.itemList.Add (itemToAdd);
//	}

    public void ThrowOneItem(Item itemToThrow, ScrollList List)
    {
//		int remain = items [itemToThrow.itemName];
//		itemToThrow.itemRemain -= 1;
//		if (itemToThrow.itemRemain <= 0) {
//			RemoveItem (itemToThrow, List);
//			Debug.Log ("Throw");
//		}
        playerScript.throwItem(itemToThrow.itemName);

        RefreshDisplay();
    }
Пример #17
0
        public ContactsController(KeyboardInput parser, OrganizerEntities context)
            : base(parser, context)
        {
            var listBox = new ScrollList(1, 1, 11, 9);

            foreach (var person in context.People.ToList())
            {
                listBox.AddItem(person.FirstName + " " + person.LastName, person.Id);
            }

            this.root = new ContactsList(0, 0, listBox);
        }
Пример #18
0
    // Use this for initialization
    void Start()
    {
        scrollList = gameObject.GetComponent <ScrollList>();

        scrollList.onItemRender = onItemRender;
        scrollList.ChildCount   = 100;
        //scrollList.ReBuild();
        GameObject orgItem = GameObject.Find("SrvItem");

        orgItem.SetActive(false);
        //scrollList.SetItem(orgItem);
        StartCoroutine(InitList());
    }
Пример #19
0
        public override void onOpened()
        {
            base.onOpened();

            var height = getUnscaledHeight();

            this.List = new ItemList(-4823, this, 65, height - 250, 350, 250, this.CurrentPlayer.Inventory);

            var renderer = this.ButtonList[1].getRenderer() as ButtonRendererStatic;

            if (renderer != null)
            {
                renderer.setRenderRect(new Rectangle(286, 0, 30, 30));
            }
        }
Пример #20
0
    //=====================================================

    public void Update()
    {
        // Show correct page scrolling list and highlight icon
        foreach (GameObject ScrollList in m_ScrollingLists)
        {
            ScrollList.SetActive(false);
        }

        foreach (GameObject TypeHighlight in m_TypeHighlights)
        {
            TypeHighlight.SetActive(false);
        }

        m_ScrollingLists[(int)m_CurrentPage].SetActive(true);
        m_TypeHighlights[(int)m_CurrentPage].SetActive(true);
    }
Пример #21
0
        /// <summary>
        /// Creates a Pause Menu
        /// </summary>
        public static Menu createPauseMenu(MultiController controllers, List <Controller> allControllers, Rectangle bounds, GameManager pmanager)
        {
            Menu MainMenu = new Menu(controllers, bounds);

            MainMenu.BaseFrame.Layout = Layout.VerticalShared;

            new Label(MainMenu.BaseFrame, "Score Level '" + pmanager.nivCourant.GetName() + "': " + pmanager._playerScore.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };
            new Label(MainMenu.BaseFrame, "Levels Completed : " + pmanager._levelsCompleted.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };
            new Label(MainMenu.BaseFrame, "Lives Lost : " + pmanager._playerDeaths.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };
            new Label(MainMenu.BaseFrame, "Asteroids Destroyed : " + pmanager._astKilled.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };
            new Label(MainMenu.BaseFrame, "Ennemy Ships Destroyed : " + pmanager._enemiKilled.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };

            ScrollList sl = new ScrollList(MainMenu.BaseFrame);

            sl.Focus         = true;
            sl.LayoutStretch = 4;
            sl.Scale         = new Vector2(2, 2);

            Label lbl = new Label(sl, "Resume");

            lbl.OnA            = delegate() { MainMenu.Close(); };
            lbl.FontColor      = Color.DarkBlue;
            lbl.FontFocusColor = Color.DarkRed;

            lbl                = new Label(sl, "Quit");
            lbl.OnA            = delegate() { MainMenu.Close(); pmanager._game.Exit(); };
            lbl.FontColor      = Color.DarkBlue;
            lbl.FontFocusColor = Color.DarkRed;
            return(MainMenu);
        }
Пример #22
0
        ScrollList createScrollList(Item parent)
        {
            ScrollList sl = new ScrollList(parent);

            sl.ViewCount = 10;

            for (int i = 0; i < manager._lstLevels.Count; i++)
            {
                int    noLevel = i;
                Button btn     = new Button(sl, App.Button, App.menuButtonHighlighted, manager._lstLevels[noLevel].GetName() /* "Level " + (noLevel + 1)*/)
                {
                    Scale = new Vector2(1f, 1f)
                };
                btn.OnA = delegate() { manager.nivCourant = manager._lstLevels[noLevel];
                                       this.Close(); };
            }
            return(sl);
        }
Пример #23
0
        /// <summary>
        /// Creates a Death Menu
        /// </summary>
        public static Menu createDeathMenu(MultiController controllers, List <Controller> allControllers, Rectangle bounds, GameManager pmanager)
        {
            Menu MainMenu = new Menu(controllers, bounds);

            MainMenu.BaseFrame.Layout = Layout.VerticalShared;

            new Label(MainMenu.BaseFrame, "You D.I.E.D.!!!!!")
            {
                Scale = new Vector2(2, 2), FontColor = new Color(200, 0, 0), Animation = AnimateType.Size
            };
            new Label(MainMenu.BaseFrame, "Score Level '" + pmanager.nivCourant.GetName() + "': " + pmanager._playerScore.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };

            ScrollList sl = new ScrollList(MainMenu.BaseFrame);

            sl.Focus         = true;
            sl.LayoutStretch = 4;
            sl.Scale         = new Vector2(2, 2);

            Label lbl = new Label(sl, "Try Again!");

            lbl.OnA            = delegate() { MainMenu.Close(); };
            lbl.FontColor      = Color.DarkBlue;
            lbl.FontFocusColor = Color.DarkRed;

            lbl     = new Label(sl, "Choose Level");
            lbl.OnA = delegate()
            {
                MainMenu.ActiveSubMenu           = new ChooseLevelMenu(controllers, allControllers, bounds, pmanager);
                MainMenu.ActiveSubMenu.OnClosing = delegate() { MainMenu.Close(); };
            };
            lbl.FontColor      = Color.DarkBlue;
            lbl.FontFocusColor = Color.DarkRed;

            lbl                = new Label(sl, "Quit");
            lbl.OnA            = delegate() { MainMenu.Close(); pmanager._game.Exit(); };
            lbl.FontColor      = Color.DarkBlue;
            lbl.FontFocusColor = Color.DarkRed;
            return(MainMenu);
        }
Пример #24
0
            public static void Create(ref ScrollList <T> scrollList, ScrollRect scrollArea, PrefabInstancePool itemPool, IList <T> items = null,
                                      float startPadding = 0f, float endPadding = 0f, float movementTime = kDefaultLerpTime, AnimationCurve movementCurve = null)
            {
                if (movementCurve == null)
                {
                    movementCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1));
                }

                if (scrollList == null)
                {
                    scrollList = new ScrollList <T>(scrollArea, itemPool);
                }

                scrollList.MovementCurve = movementCurve;
                scrollList.MovementTime  = movementTime;
                scrollList.StartPadding  = startPadding;
                scrollList.EndPadding    = endPadding;

                scrollList.Initialise(items);
            }
Пример #25
0
        /// <summary>
        /// Creates a Main Menu
        /// </summary>
        public static Menu createMainMenu(MultiController controllers, List <Controller> allControllers, Rectangle bounds, GameManager pmanager, Boolean recommencer = false)
        {
            Menu MainMenu = new Menu(controllers, bounds);

            MainMenu.BaseFrame.Layout = Layout.VerticalShared;

            new Label(MainMenu.BaseFrame, "Asteroids")
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };

            ScrollList sl = new ScrollList(MainMenu.BaseFrame);

            sl.Focus         = true;
            sl.LayoutStretch = 4;
            sl.Scale         = new Vector2(2, 2);

            Label lbl = new Label(sl, (recommencer ? "Restart" : "Start"));

            lbl.OnA = delegate() { MainMenu.Close(); };

            lbl     = new Label(sl, "Choose Level");
            lbl.OnA = delegate()
            {
                MainMenu.ActiveSubMenu           = new ChooseLevelMenu(controllers, allControllers, bounds, pmanager);
                MainMenu.ActiveSubMenu.OnClosing = delegate() { MainMenu.Close(); };
            };

            /*lbl = new Label(sl, "Options");
             * lbl.OnA = delegate()
             * {
             *  //MainMenu.ActiveSubMenu = new OptionButtonMenu(controllers, allControllers, bounds);
             * };*/

            lbl     = new Label(sl, "Exit");
            lbl.OnA = delegate() { MainMenu.Close(); pmanager._game.Exit(); };
            return(MainMenu);
        }
Пример #26
0
        /// <summary>
        /// Creates a Win Menu
        /// </summary>
        public static Menu createWinMenu(MultiController controllers, List <Controller> allControllers, Rectangle bounds, GameManager pmanager)
        {
            Menu MainMenu = new Menu(controllers, bounds);

            MainMenu.BaseFrame.Layout = Layout.VerticalShared;

            new Label(MainMenu.BaseFrame, "Level succes!")
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };
            new Label(MainMenu.BaseFrame, "Score Level '" + pmanager.nivCourant.GetName() + "': " + pmanager._playerScore.ToString())
            {
                Scale = new Vector2(2, 2), FontColor = Color.White
            };

            ScrollList sl = new ScrollList(MainMenu.BaseFrame);

            sl.Focus         = true;
            sl.LayoutStretch = 4;
            sl.Scale         = new Vector2(2, 2);

            Label lbl = new Label(sl, "Next Level");

            lbl.OnA = delegate() { MainMenu.Close(); };

            lbl     = new Label(sl, "Choose Level");
            lbl.OnA = delegate()
            {
                MainMenu.ActiveSubMenu           = new ChooseLevelMenu(controllers, allControllers, bounds, pmanager);
                MainMenu.ActiveSubMenu.OnClosing = delegate() { MainMenu.Close(); };
            };

            lbl     = new Label(sl, "Exit");
            lbl.OnA = delegate() { MainMenu.Close(); pmanager._game.Exit(); };
            return(MainMenu);
        }
Пример #27
0
 public ListRenderer(ScrollList list)
 {
     this.List = list;
 }
Пример #28
0
 public void AddItem(Item itemToAdd, ScrollList shopList)
 {
     shopList.itemList.Add(itemToAdd);
 }
Пример #29
0
 public void Setup(ScrollList currentScrollList)
 {
     scrollList = currentScrollList;
 }
Пример #30
0
 public void Setup(string currentSong, ScrollList currentScrollList)
 {
     song          = currentSong;
     songText.text = song;
     scrollList    = currentScrollList;
 }
Пример #31
0
        static void Main(string[] args)
        {
            var noLimitIncr = new Incrementer(INCREMENT_NO_LIMITS);
            var speedIncr   = new SpeedIncrementer();
            var hourIncr    = new Incrementer(INCREMENT_WRAP, new[] { 23, 59, 59 });
            var decIncr     = new RaDecIncrementer("DEC");
            var raIncr      = new RaDecIncrementer("RA");

            // Main top-level menu
            var menu = new MainMenu();

            //////  RA  ///////
            var raMenu = new MenuItem("RA");

            raMenu.addMenuItem(new NumberInput("TRA", 4, "^%02dh^%02dm^%02ds ^@", raConfirmed, raIncr));

            //////  DEC  ///////
            var decMenu = new MenuItem("DEC");

            decMenu.addMenuItem(new NumberInput("TDEC", 4, "^%02d*^%02d\"^%02d' ^@", decConfirmed, decIncr));

            //////  GO  ///////
            var goMenu = new MenuItem("GO");
            var goList = new ScrollList();

            goList.addMenuItem(new Button("Polaris", goPointChosen));
            goList.addMenuItem(new Button("Vega", goPointChosen));
            goList.addMenuItem(new Button("Orions Nebla", goPointChosen));
            goList.addMenuItem(new Button("M31 Andromeda", goPointChosen));
            goList.addMenuItem(new Button("Navi", goPointChosen));
            goList.addMenuItem(new Button("Antares", goPointChosen));
            goList.addMenuItem(new Button("Home", goPointChosen));
            goList.addMenuItem(new Button("Unpark", goPointChosen));
            goList.addMenuItem(new Button("Park", goPointChosen));
            goMenu.addMenuItem(goList);

            //////  HA  ///////
            var haMenu = new MenuItem("HA");

            haMenu.addMenuItem(new NumberInput("HA", new[] { 15, 32 }, "^%02dh^%02dm", haConfirmed, hourIncr));

            //////  CTRL  ///////
            var ctrlMenu = new MenuItem("CTRL");

            ctrlMenu.addMenuItem(new Button("Manual Control", startManualControl));
            var dlgManualControl = new ManualControlModal(manualControlEvent, "RADECControl");

            var dlgSetHome = new MenuItem("Set home pos?", "ConfirmHome");

            dlgSetHome.addMenuItem(new OptionChooser(new string[] { "Yes", "No" }, 0, setHomePosition));

            //////  CAL  ///////
            var calMenu = new MenuItem("CAL");
            var calList = new ScrollList();

            var dlgStoreSync = new MenuItem("Adjust mount ", "StoreAndSync");

            dlgStoreSync.addMenuItem(new Button("Centered", storeAndSync));

            var dlgSlewToPolaris = new MultiStepActionRunnerModal("Slewing....", "SlewToPolaris", polarAlignFunction, dlgStoreSync);
            var paBtn            = new Button("Polar Alignmnt", (eventArgs) => menu.activateDialog("SlewToPolaris"));

            calList.addMenuItem(paBtn);

            var driftLenOption = new OptionChooser(new string[] { "1m", "2m", "3m", "5m" }, 0, setDriftLength);
            var driftAlignBtn  = new Button("Drift Alignmnt", driftLenOption);

            var dlgDriftAlign = new MultiStepActionRunnerModal("Drift alignment", "DriftAlign", driftAlignPhaseFunction);

            calList.addMenuItem(driftAlignBtn);

            calList.addMenuItem(new Button("Speed Calibratn", new NumberInput("SPD", 1, "SpdFctr: @", null, speedIncr, NumberInput.BehaviorFlags.AcceleratingRepetition)));
            calList.addMenuItem(new Button("RA Step Adjust", new NumberInput("RA", 1, "RA Steps: @", null, speedIncr, NumberInput.BehaviorFlags.AcceleratingRepetition)));
            calList.addMenuItem(new Button("DEC Step Adjust", new NumberInput("DEC", 1, "DEC Steps: @", null, speedIncr, NumberInput.BehaviorFlags.AcceleratingRepetition)));
            calList.addMenuItem(new Button("Backlash Adjust", new NumberInput("DEC", 1, "DEC Steps: @", null, speedIncr, NumberInput.BehaviorFlags.AcceleratingRepetition)));
            calList.addMenuItem(new Button("Roll Offset", new PitchRollDisplay("ROLL")));
            calList.addMenuItem(new Button("Pitch Offset", new PitchRollDisplay("PITCH")));
            calMenu.addMenuItem(calList);

            //////  INFO  ///////
            var infoMenu = new MenuItem("INFO");
            var infoList = new ScrollList();

            infoList.addMenuItem(new MultiTextInfo(3, getRASteps));
            infoList.addMenuItem(new MultiTextInfo(3, getDECSteps));
            infoList.addMenuItem(new MultiTextInfo(2, getTRKSteps));
            //infoList.addMenuItem(new TextInfo( "Loc ", getLocation));
            //infoList.addMenuItem(new TextInfo( "Temp: ", getTemperature));
            //infoList.addMenuItem(new TextInfo( "MemAvail: ", getMemAvail));
            //infoList.addMenuItem(new TextInfo( "Up: ", getUpTime));
            infoList.addMenuItem(new TextInfo("Firmw.: ", () => "V1.9.00"));
            infoMenu.addMenuItem(infoList);

            // Add all the menus
            menu.addMenuItem(raMenu);
            menu.addMenuItem(decMenu);
            menu.addMenuItem(goMenu);
            menu.addMenuItem(haMenu);
            menu.addMenuItem(ctrlMenu);
            menu.addMenuItem(calMenu);
            menu.addMenuItem(infoMenu);

            // Add all the model dialogs.
            menu.addModalDialog(dlgSlewToPolaris);
            menu.addModalDialog(dlgStoreSync);
            menu.addModalDialog(dlgDriftAlign);

            // Startup Wizard
            var dlgStartIsHome = new MenuItem("Home Position?", "StartIsHome");

            dlgStartIsHome.addMenuItem(new OptionChooser(new string[] { "Yes", "No", "Cancl" }, 1, startupIsHomePosition));
            var dlgStartFindGPS = new MenuItem("Finding GPS...", "StartFindGPS");

            dlgStartFindGPS.addMenuItem(new FindGPSDisplay("FINDGPS"));
            var dlgStartHowToGetHA = new MenuItem("Set HA via?", "StartHAChooser");

            dlgStartHowToGetHA.addMenuItem(new OptionChooser(new string[] { "GPS Sync", "Manual Set" }, 0, startupHowToGetHA));
            var dlgStartHAGetManual = new MenuItem("Polaris HA?", "StartEnterHA");

            dlgStartHAGetManual.addMenuItem(new NumberInput("HA", new[] { 15, 32 }, "^%02dh^%02dm", startHAConfirmed, hourIncr, NumberInput.BehaviorFlags.ConstantRepetition));
            var dlgStartManualControl = new ManualControlModal(manualControlEvent, "StartManualControl");

            menu.addModalDialog(dlgStartIsHome);
            menu.addModalDialog(dlgStartFindGPS);
            menu.addModalDialog(dlgStartHowToGetHA);
            menu.addModalDialog(dlgStartHAGetManual);
            menu.addModalDialog(dlgStartManualControl);

            // Set the first modal dialog on the menu system
            menu.activateDialog("StartIsHome");

            do
            {
                int keyState = getKeyState();

                // Console.Write("Key:{0} ", keyState);
                if (!menu.onPreviewKey(keyState))
                {
                    if (menu.processKeys(keyState))
                    {
                        while (getKeyState() != btnNONE)
                        {
                            ;
                        }
                    }
                }

                Console.CursorTop  = 1;
                Console.CursorLeft = 0;
                menu.updateDisplay();
            }while (true);
        }