Exemple #1
0
        public static void DoLoops(GameObject[] Buttons, GameObject[] Col1, GameObject[] Col2, GameObject[] Col3)
        {
            for (int i = 0; i < Buttons.Length; i++)
            {
                GameObject item = Buttons[i];

                WindowManager.AddElementToWindow(item, SIncLibUI.Window, new Rect(1, (i + 7) * 32, 150, 32),
                                                 new Rect(0, 0, 0, 0));
            }

            for (int i = 0; i < Col1.Length; i++)
            {
                GameObject item = Col1[i];

                WindowManager.AddElementToWindow(item, SIncLibUI.Window, new Rect(161, (i + 7) * 32, 150, 32),
                                                 new Rect(0, 0, 0, 0));
            }

            for (int i = 0; i < Col2.Length; i++)
            {
                GameObject item = Col2[i];

                WindowManager.AddElementToWindow(item, SIncLibUI.Window, new Rect(322, (i + 7) * 32, 150, 32),
                                                 new Rect(0, 0, 0, 0));
            }

            for (int i = 0; i < Col3.Length; i++)
            {
                GameObject item = Col3[i];

                WindowManager.AddElementToWindow(item, SIncLibUI.Window, new Rect(483, (i + 7) * 32, 150, 32),
                                                 new Rect(0, 0, 0, 0));
            }
        }
        internal void Update(Command cmd)
        {
            foreach (var item in playerTextList)
            {
                UnityEngine.Object.DestroyImmediate(item);
            }
            playerTextList.Clear();

            Player          p  = new Player();
            BinaryFormatter bf = new BinaryFormatter();

            p.companyName = cmd.source;
            p.lvl         = cmd.year * (cmd.money / 100000);

            foreach (var item in playerList)
            {
                UnityEngine.UI.Text label = WindowManager.SpawnLabel();
                label.text = item.companyName + " | " + item.lvl;
                playerTextList.Add(label);
            }
            for (int i = 0; i < playerList.Count; i++)
            {
                WindowManager.AddElementToWindow(playerTextList[i].gameObject, mainWindow, new UnityEngine.Rect(0, 32f * i, 250f, 32f), new UnityEngine.Rect(0, 0, 0, 0));
            }

            throw new NotImplementedException();
        }
Exemple #3
0
        public void CreateWindow()
        {
            Window = WindowManager.SpawnWindow();
            Window.InitialTitle   = Window.TitleText.text = Window.NonLocTitle = title;
            Window.MinSize.x      = 670;
            Window.MinSize.y      = 800;
            Window.name           = "SIncLibMarketResearch";
            Window.MainPanel.name = "SIncLibAMarketResearchPanel";

            if (Window.name == "SIncLibMarketResearch")
            {
                Window.GetComponentsInChildren <Button>()
                .SingleOrDefault(x => x.name == "CloseButton")
                .onClick.AddListener(() => shown = false);
            }

            _softwareList = WindowManager.SpawnList();
            SetupSoftwareColumnDefinition(_softwareList);
            _softwareList.Items.Clear();
            _softwareList.Items.AddRange(GameSettings.Instance.MyCompany.Products);
            _softwareList.Initialize();

            WindowManager.AddElementToWindow(_softwareList.gameObject, Window, new Rect(10, 40, -20, 200),
                                             new Rect(0, 0, 1, 0));
        }
Exemple #4
0
        public static void AddLabel(string text, Rect labelRect, GUIWindow window)
        {
            Text label = WindowManager.SpawnLabel();

            label.text = text;
            WindowManager.AddElementToWindow(label.gameObject, window, labelRect, new Rect(0, 0, 0, 0));
        }
Exemple #5
0
        public static void AddLabel(String Text, Rect Label)
        {
            Text x = WindowManager.SpawnLabel();

            x.text = "<= This cell is universal for\nwinice, Stock, Active Users";
            WindowManager.AddElementToWindow(x.gameObject, Main.win, Label, new Rect(0, 0, 0, 0));
        }
        public override void OnActivate()
        {
            bool firstTimeLaunch = !SettingsHandler.Has("firstTimeLaunch");

            if (firstTimeLaunch)
            //if (true)
            {
                GUIWindow firstTimeWindow = WindowManager.SpawnWindow();
                firstTimeWindow.Show();
                firstTimeWindow.SetTitle("FirstTimeWindowTitle".LocDef("First time? Neat!"));
                firstTimeWindow.ShowCentered = true;
                firstTimeWindow.MinSize      = new Vector2(Screen.width / 2 - 5f, 32 + 32 + 5 + 5 + 5);
                Text description = WindowManager.SpawnLabel();
                description.text = GetSteamUsernameText();
                Text description2 = WindowManager.SpawnLabel();
                description2.text = "FirstTimeWindowDescription2".LocDef("The wiki also contains useful info on how to configure your server, set passwords on your server, and lots more! It also contains some useful infomation on how to debug/fix problems related to multiplayer.");
                Button openWikiButton = WindowManager.SpawnButton();
                openWikiButton.GetComponentInChildren <Text>().text = "FirstTimeWindow_OpenWiki".LocDef("Open Wiki");
                openWikiButton.onClick.AddListener(OpenWiki);
                Button closeWindowButton = WindowManager.SpawnButton();
                closeWindowButton.GetComponentInChildren <Text>().text = "FirstTimeWindow_OK".LocDef("Ok");
                closeWindowButton.onClick.AddListener(() => firstTimeWindow.gameObject.SetActive(false));
                firstTimeWindow.SizeButton.SetActive(false);
                WindowManager.AddElementToWindow(description.gameObject, firstTimeWindow, new Rect(5, 15, (Screen.width / 2) - 15f, 32), Rect.zero);
                WindowManager.AddElementToWindow(openWikiButton.gameObject, firstTimeWindow, new Rect(5, (32 * 2) + 25, (Screen.width / 2) - 15f, 60f), Rect.zero);
                WindowManager.AddElementToWindow(closeWindowButton.gameObject, firstTimeWindow, new Rect(5, (32 * 2) + 90, (Screen.width / 2) - 15f, 60f), Rect.zero);
                WindowManager.AddElementToWindow(description2.gameObject, firstTimeWindow, new Rect(5, 42 + 5, (Screen.width / 2) - 15f, 32), Rect.zero);
                SettingsHandler.Set("firstTimeLaunch", false);
            }
        }
Exemple #7
0
        public static void AddInputBox(string Text, Rect InputBox, UnityAction <string> Action)
        {
            InputField x = WindowManager.SpawnInputbox();

            x.text = Text;
            x.onValueChanged.AddListener(Action);
            WindowManager.AddElementToWindow(x.gameObject, SIncLibUI.Window, InputBox, new Rect(0, 0, 0, 0));
        }
Exemple #8
0
        public static void AddInputBox(string text, Rect rectInputBox, UnityAction <string> action, GUIWindow window)
        {
            InputField inputBox = WindowManager.SpawnInputbox();

            inputBox.text = text;
            inputBox.onValueChanged.AddListener(action);
            WindowManager.AddElementToWindow(inputBox.gameObject, window, rectInputBox, new Rect(0, 0, 0, 0));
        }
Exemple #9
0
        public static void AddButton(string Text, Rect Button, UnityAction Action)
        {
            Button x = WindowManager.SpawnButton();

            x.GetComponentInChildren <Text>().text = Text;
            x.onClick.AddListener(Action);
            WindowManager.AddElementToWindow(x.gameObject, SettingsWindow.Window, Button, new Rect(0, 0, 0, 0));
        }
Exemple #10
0
        public static void AddButton(String Text, Rect Button, UnityAction Action)
        {
            Button x = WindowManager.SpawnButton();

            x.GetComponentInChildren <UnityEngine.UI.Text>().text = Text;
            x.onClick.AddListener(Action);
            WindowManager.AddElementToWindow(x.gameObject, Main.win, Button, new Rect(0, 0, 0, 0));
        }
Exemple #11
0
        public static void AddButton(string text, Rect rectButton, UnityAction action, GUIWindow window)
        {
            Button button = WindowManager.SpawnButton();

            button.GetComponentInChildren <Text>().text = text;
            button.onClick.AddListener(action);
            WindowManager.AddElementToWindow(button.gameObject, window, rectButton, new Rect(0, 0, 0, 0));
        }
Exemple #12
0
        public static Button AddButton(string Text, Rect Button, UnityAction Action)
        {
            Button x = WindowManager.SpawnButton();

            x.GetComponentInChildren <UnityEngine.UI.Text>().text = Text;
            x.onClick.AddListener(Action);
            WindowManager.AddElementToWindow(x.gameObject, SIncLibUI.Window, Button, new Rect(0, 0, 0, 0));
            return(x);
        }
Exemple #13
0
        public static void AddToggle(string Text, Rect rect, bool isOn, UnityAction <bool> Action)
        {
            Toggle toggle = WindowManager.SpawnCheckbox();

            toggle.GetComponentInChildren <UnityEngine.UI.Text>().text = Text;
            toggle.isOn = isOn;
            toggle.onValueChanged.AddListener(Action);
            WindowManager.AddElementToWindow(toggle.gameObject, SIncLibUI.Window, rect, new Rect(0, 0, 0, 0));
        }
Exemple #14
0
        public static void CreateGameObjects(int column, int skipRows, GameObject[] gameObjects, GUIWindow window)
        {
            for (int i = 0; i < gameObjects.Length; i++)
            {
                GameObject item = gameObjects[i];

                WindowManager.AddElementToWindow(item, window,
                                                 new Rect(column, (i + skipRows) * Constants.ELEMENT_HEIGHT, Constants.ELEMENT_WIDTH, Constants.ELEMENT_HEIGHT),
                                                 new Rect(0, 0, 0, 0));
            }
        }
Exemple #15
0
		public static void CreateGameObjects(int column, GameObject[] gameObjects, GUIWindow window, bool isComboBox = false)
		{
			for (int i = 0; i < gameObjects.Length; i++)
			{
				GameObject item = gameObjects[i];

				WindowManager.AddElementToWindow(item, window,
						new Rect(column, (i - (isComboBox ? 1 : 0)) * Constants.ELEMENT_HEIGHT + (isComboBox && i % 2 == 0 ? 16 : 0), Constants.ELEMENT_WIDTH, Constants.ELEMENT_HEIGHT),
						new Rect(0, 0, 0, 0));
			}
		}
Exemple #16
0
        public static void AddLabel(string Text, Rect Label, GUIWindow window = null)
        {
            if (window == null)
            {
                window = SIncLibUI.Window;
            }

            Text x = WindowManager.SpawnLabel();

            x.text = Text;
            WindowManager.AddElementToWindow(x.gameObject, window, Label, new Rect(0, 0, 0, 0));
        }
        public void CreateWindow()
        {
            Window = WindowManager.SpawnWindow();
            Window.InitialTitle   = Window.TitleText.text = Window.NonLocTitle = title;
            Window.MinSize.x      = 670;
            Window.MinSize.y      = 800;
            Window.name           = "SIncLibAutoDev";
            Window.MainPanel.name = "SIncLibAutoDevPanel";

            if (Window.name == "SIncLibAutoDev")
            {
                Window.GetComponentsInChildren <Button>()
                .SingleOrDefault(x => x.name == "CloseButton")
                .onClick.AddListener(() => shown = false);
            }

            Utils.AddLabel("Dev Tasks", new Rect(10, 10, 250, 35), Window);

            _devList = WindowManager.SpawnList();
            SetupDevColumnDefinition(_devList);
            AssignDevItems();

            WindowManager.AddElementToWindow(_devList.gameObject, Window, new Rect(10, 40, -20, 200),
                                             new Rect(0, 0, 1, 0));

            Utils.AddLabel("Support Tasks", new Rect(10, 250, 250, 35), Window);

            _supportList = WindowManager.SpawnList();
            SetupSupportColumnDefinition(_supportList);
            AssignSupportItems();

            WindowManager.AddElementToWindow(_supportList.gameObject, Window, new Rect(10, 280, -20, 200),
                                             new Rect(0, 0, 1, 0));

            Utils.AddLabel("Marketing Tasks", new Rect(10, 500, 250, 35), Window);

            _marketList = WindowManager.SpawnList();
            SetupMarketColumnDefinition(_marketList);
            AssignMarketingItems();

            WindowManager.AddElementToWindow(_marketList.gameObject, Window, new Rect(10, 530, -20, 200),
                                             new Rect(0, 0, 1, 0));
        }
Exemple #18
0
 public void Place(GameObject go)
 {
     WindowManager.AddElementToWindow(go, Parent, Pos, new Rect(0, 0, 0, 0));
 }
 public static void AddElement(this GUIWindow parent, GameObject element, Rect position, Rect anchors)
 {
     WindowManager.AddElementToWindow(element, parent, position, anchors);
 }