public void BeginMenuGame()
    {
        if (_controlMenu == null)
        {
            _controlMenu = new ControlMenu();
            _controlMenu._btBag.onClick.Add((EventContext context) =>
            {
                Debug.Log("On click on Bag");
                // context.StopPropagation();
                ShowBag();
            });
            // _controlMenu._coin.text = TriggerGame.WorldFlag["Coin"].ToString() + " " + DefineAON.CoinName;
            TriggerGame.Instance.WorldFlag.AddEventListener(_controlMenu._coin, "Coin", () => {
                _controlMenu._coin.text = TriggerGame.Instance.WorldFlag["Coin"].ToString() + " " + DefineAON.CoinName;
            });

            TriggerGame.Instance.WorldFlag.AddEventListener(_controlMenu._stamina, "Stamina", () => {
                _controlMenu._stamina.text = TriggerGame.Instance.WorldFlag["Stamina"].ToString();
            });

            TriggerGame.Instance.WorldFlag.AddEventListener(_controlMenu._reputation, "Reputation", () => {
                _controlMenu._reputation.text = TriggerGame.Instance.WorldFlag["Reputation"].ToString();
            });
        }
        _controlMenu.ShowOn(_mainView);
    }
Beispiel #2
0
        public void TestMethod1()
        {
            List <string> items = new List <string>();

            items.Add("prvi");
            items.Add("drugi");
            items.Add("Treci");
            items.Add("4");
            items.Add("5");
            items.Add("6");
            items.Add("7");
            items.Add("8");
            items.Add("9");
            items.Add("10");
            items.Add("11");
            items.Add("12");
            items.Add("13");

            ControlMenuItems controlMenuItems = new ControlMenuItems(items);

            controlMenuItems[2].HaveChildren = true;


            ControlMenu cm = new ControlMenu();

            cm.Execute("Caption is here:", controlMenuItems, 1, 2, ControlMenu_OnExecute);

            //cm.Execute("Caption is here:", controlMenuItems, 5, 7);
        }
Beispiel #3
0
        public override void Update()
        {
            if (!Owner._Object.AmOwner)
            {
                return;
            }

            if (!HudManager.Instance)
            {
                return;
            }

            if (Owner._Object.inVent || Owner._Object.Data.IsDead || MeetingHud.Instance ||
                !MindControlButton.isActiveAndEnabled || MindControlButton.isCoolingDown)
            {
                ControlMenu?.CloseMenu();
            }

            DrawButtons();

            if (MindControlledPlayer != null)
            {
                return;
            }

            ControlMenu.Update();
            if (Input.GetMouseButtonDown(1))
            {
                PerformKill(CrucioButton);
            }
        }
 public void EndMenuGame()
 {
     if (_controlMenu == null)
     {
         return;
     }
     _controlMenu.Dispose();
     _controlMenu = null;
 }
 public void Resume()
 {
     pauseMenuUI.SetActive(false);
     ControlMenu.SetActive(false);
     OptionsMenu.SetActive(false);
     Time.timeScale = 1f;
     GameIsPaused   = false;
     FindObjectOfType <AudioManager>().Play("ButtonClick");
 }
Beispiel #6
0
    protected virtual void BuildControlMenus()
    {
        ControlMenus[ControlStore.MENU_BASE].MenuItems.Add(new ControlMenuItem(ControlStore.MENU_CONVERT_UNIT, ControlStore.MENU_CONVERT_UNIT));
        ControlMenus[ControlStore.MENU_BASE].MenuItems.Add(new ControlMenuItem(ControlStore.STOP));

        ControlMenu convertMenu = new ControlMenu();
        foreach(CreatableUnit creatableUnit in GameUtil.GetAllCurrentUnitTypes(Owner)) {
            convertMenu.MenuItems.Add(new ControlMenuItem(creatableUnit, ControlStore.MENU_BASE));
        }
        ControlMenus.Add(ControlStore.MENU_CONVERT_UNIT, convertMenu);
    }
Beispiel #7
0
 public void Awake()
 {
     if (ControlMenu.singleton == null)
     {
         ControlMenu.singleton = this;
         DontDestroyOnLoad(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Beispiel #8
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (DataGridViewRow rows in dgvControl.Rows)
         {
             ControlMenu.Save(rows.Cells["ControlName"].Value.ToString(), rows.Cells["ControlText"].Value.ToString());
         }
         MessageBox.Show("Controls has saved", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #9
0
        static void Main(string[] args)
        {
            Console.WriteLine("Task 3 , Note program");
            Console.WriteLine("Program where you can note some info ");
            Console.WriteLine("Student of PM academy Zinchenko Bohdan");
            List <Note> readFile;

            try
            {
                readFile = JsonConvert.DeserializeObject <List <Note> >(File.ReadAllText(path: "Data.json"));
            }
            catch
            {
                readFile = new List <Note>();
            }

            var menuControl = new ControlMenu(readFile);

            menuControl.FirstMenu();
        }
Beispiel #10
0
        public void ToggleMindControlMenu()
        {
            if (MindControlButton.isCoolingDown)
            {
                return;
            }

            if (!MindControlButton.isActiveAndEnabled)
            {
                return;
            }

            if (Owner._Object.Data.IsDead)
            {
                return;
            }

            if (Owner._Object.inVent)
            {
                return;
            }

            ControlMenu?.ToggleMenu();
        }
    protected void BuildControlMenus()
    {
        ControlMenus[ControlStore.MENU_BASE].MenuItems.Add(new ControlMenuItem(ControlStore.MENU_UNITS, ControlStore.MENU_UNITS));
        ControlMenus[ControlStore.MENU_BASE].MenuItems.Add(new ControlMenuItem(ControlStore.MENU_TECHS, ControlStore.MENU_TECHS));
        if(GetComponent<BuildingStatus>() != null && GetComponent<BuildingStatus>().powerRequired > 0) {
            ControlMenus[ControlStore.MENU_BASE].MenuItems.Add(new ControlMenuItem(ControlStore.TOGGLE_POWER));
        }

        ControlMenu createUnitMenu = new ControlMenu();
        foreach(CreatableUnit unit in units) {
            createUnitMenu.MenuItems.Add(new ControlMenuItem(unit));
        }
        createUnitMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_BACK, ControlStore.MENU_BASE));
        ControlMenus.Add(ControlStore.MENU_UNITS, createUnitMenu);

        ControlMenu createTechMenu = new ControlMenu();
        foreach(CreatableTech tech in techs) {
            createTechMenu.MenuItems.Add(new ControlMenuItem(tech, true));
        }
        createTechMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_BACK, ControlStore.MENU_BASE));
        ControlMenus.Add(ControlStore.MENU_TECHS, createTechMenu);
    }
Beispiel #12
0
 public void EnterControlMenu()
 {
     currentGameState = GameState.ControlMenu;
     control_menu     = new ControlMenu(this);
 }
Beispiel #13
0
    protected void BuildControlMenus()
    {
        Controllable.ControlMenus[ControlStore.MENU_BASE].MenuItems.Add(new ControlMenuItem(ControlStore.MENU_BUILDINGS, ControlStore.MENU_BUILDINGS));

        ControlMenu createBuildingMenu = new ControlMenu();
        foreach(CreatableBuilding building in Game.PlayerInput.buildings) {
            createBuildingMenu.MenuItems.Add(new ControlMenuItem(building, ControlStore.MENU_CANCEL));
        }
        createBuildingMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_BACK, ControlStore.MENU_BASE));
        Controllable.ControlMenus.Add(ControlStore.MENU_BUILDINGS, createBuildingMenu);

        ControlMenu cancelCreateMenu = new ControlMenu();
        cancelCreateMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_CANCEL, ControlStore.MENU_BUILDINGS));
        Controllable.ControlMenus.Add(ControlStore.MENU_CANCEL, cancelCreateMenu);
    }
Beispiel #14
0
    // Start is called before the first frame update
    void Start()
    {
        options = new MenuInfo(35, 15, 20, 1,
                               new KeyValuePair <string, IOptionType>("Test Option", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Testing another", new TextOption(new List <string>()
        {
            "Options", "Attackpower", "Automatic"
        })),
                               new KeyValuePair <string, IOptionType>("tester", new TextOption(new List <string>()
        {
            "Hello", "Is it me", "you are", "looking", "for"
        })),
                               new KeyValuePair <string, IOptionType>("Controls", new ButtonOption(() => { ControlMenu.Reload(); Menu.AddMenu(ControlMenu); return(false); })),
                               new KeyValuePair <string, IOptionType>("Test Option 1", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Test Option 2", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Test Option 3 ", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Test Option 4", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Test Option 5", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Test Option 6", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        })),
                               new KeyValuePair <string, IOptionType>("Test Option 8", new TextOption(new List <string>()
        {
            "A", "Longer A", "B", "C"
        }))
                               );
        NewGame = new MenuInfo(35, 15, 20, 1,
                               new KeyValuePair <string, IOptionType>("Start Game", new ButtonOption(StartGame)),
                               new KeyValuePair <string, IOptionType>("Difficulty", new TextOption(new List <string>()
        {
            "Baby", "Normal", "Blood Tower", "Impossible"
        })),
                               new KeyValuePair <string, IOptionType>("Start Item", new TextOption(new List <string>()
        {
            "Torch", "Random Ring", "Dagger"
        })),
                               new KeyValuePair <string, IOptionType>("Base Skill", new TextOption(new List <string>()
        {
            "Slash", "Jump", "Heal Poison"
        }))
                               );

        Credits = new TextPrintable(new List <string>()
        {
            "Theos", "Demidemon", "MCR"
        }, 20, 15, 3, 2, 1);

        ControlMenu = new ControlMenu(35, 15, 20, 1);

        MainMenu = new MenuInfo(
            35, 15, 20, 1,
            new KeyValuePair <string, IOptionType>("New Game", new ButtonOption(() => { Menu.AddMenu(NewGame); return(false); })),
            new KeyValuePair <string, IOptionType>("Settings", new ButtonOption(() => { Menu.AddMenu(options); return(false); })),
            new KeyValuePair <string, IOptionType>("Credits", new ButtonOption(() => { Menu.AddMenu(Credits); return(false); }))
            );

        Menu = new SelectableList(MainMenu);

        text = GetComponent <Text>();
    }
Beispiel #15
0
    protected void BuildControlMenus()
    {
        ControlMenu basePlayerMenu = new ControlMenu();
        basePlayerMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_BUILDINGS, ControlStore.MENU_BUILDINGS));
        ControlMenus.Add(ControlStore.MENU_BASE, basePlayerMenu);

        ControlMenu createBuildingMenu = new ControlMenu();
        foreach(CreatableBuilding building in buildings) {
            createBuildingMenu.MenuItems.Add(new ControlMenuItem(building, ControlStore.MENU_CANCEL));
        }
        createBuildingMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_BACK, ControlStore.MENU_BASE));
        ControlMenus.Add(ControlStore.MENU_BUILDINGS, createBuildingMenu);

        ControlMenu cancelCreateMenu = new ControlMenu();
        cancelCreateMenu.MenuItems.Add(new ControlMenuItem(ControlStore.MENU_CANCEL, ControlStore.MENU_BUILDINGS));
        ControlMenus.Add(ControlStore.MENU_CANCEL, cancelCreateMenu);

        CurrentControlMenu = ControlMenus[ControlStore.MENU_BASE];
    }