Пример #1
0
    private void Awake()
    {
        _mainMenu     = _ui.GetMainMenu();
        _selectionBar = _ui.GetSelectionBar();

        //Подписываем все кнопки в игре на методы этого класса
        _mainMenu.GetButtonTapToPlay().onClick.AddListener(ButtonPressedTapToPlay);
        _selectionBar.GetRightButton().onClick.AddListener(ButtonPressedRightSelectionBar);
        _selectionBar.GetLeftButton().onClick.AddListener(ButtonPressedLeftSelectionBar);
        _selectionBar.GetOneButton().onClick.AddListener(ButtonPressedLeftSelectionBar);
    }
Пример #2
0
        public GameUI(GameController input, CameraMover cameraMover)
            : base(input.Level)
        {
            this.InputCtl           = input;
            this.cameraMover        = cameraMover;
            this.tools              = new Dictionary <UIElement, Tool>();
            this.players            = new Dictionary <UIElement, IPlayer>();
            this.registeredForHover = new HashSet <UIElement>();

            gameUI = UI.LoadLayout(Level.PackageManager.GetXmlFile("UI/GameLayout.xml", true),
                                   Level.PackageManager.GetXmlFile("UI/GameUIStyle.xml", true));
            UI.Root.AddChild(gameUI);
            gameUI.Visible = false;

            CustomWindow             = new CustomElementsWindow((Window)gameUI.GetChild("CustomWindow"), UI, Game.ResourceCache);
            CustomWindow.HoverBegin += UIHoverBegin;
            CustomWindow.HoverEnd   += UIHoverEnd;

            expansionWindow = new ExpansionWindow((Window)gameUI.GetChild("ExpansionWindow"));
            expansionWindow.Hide();
            expansionWindow.HoverBegin += UIHoverBegin;
            expansionWindow.HoverEnd   += UIHoverEnd;

            toolSelection               = new ExpandingSelector((CheckBox)gameUI.GetChild("ToolSelector"), expansionWindow);
            toolSelection.HoverBegin   += UIHoverBegin;
            toolSelection.HoverEnd     += UIHoverEnd;
            toolSelection.Selected     += ToolSelected;
            playerSelection             = new ExpandingSelector((CheckBox)gameUI.GetChild("PlayerSelector"), expansionWindow);
            playerSelection.HoverBegin += UIHoverBegin;
            playerSelection.HoverEnd   += UIHoverEnd;
            playerSelection.Selected   += PlayerSelected;

            SelectionBar             = new SelectionBar(gameUI);
            SelectionBar.HoverBegin += UIHoverBegin;
            SelectionBar.HoverEnd   += UIHoverEnd;

            minimap             = new UIMinimap((Button)gameUI.GetChild("Minimap"), this, cameraMover, Level);
            minimap.HoverBegin += UIHoverBegin;
            minimap.HoverEnd   += UIHoverEnd;
        }
Пример #3
0
    private void InitializeSearchHistory()
    {
        bool exceptionFlag = false;

        if (Application["SEARCH_HISTORY"] != null)
        {
            searchList = Application["SEARCH_HISTORY"] as SelectionBar;
        }
        else
        {
            // Initialize
            searchList = new SelectionBar(10, "SBA.aspx");

            // Get the list from the Profile system.
            StringCollection searchHistory = null;

            try
            {
                if (Profile.ControlCenterProfile.IsProfileActive)
                {
                    BCCModuleProperty props = Profile.ControlCenterProfile.ModuleFilter[SiteMap.CurrentNode.Description];

                    if (props != null)
                    {
                        searchHistory = props.ModuleDictionary[BCCUIHelper.Constants.SEARCH_HISTORY_KEY];

                        foreach (string searchKeyword in searchHistory)
                        {
                            searchList.Add(searchKeyword);
                        }
                    }
                    else
                    {
                        exceptionFlag = true;
                    }
                }
            }
            catch
            {
                exceptionFlag = true;
            }

            if (exceptionFlag || !(searchList.Count > 0))
            {
                searchList.Add("bound");
                searchList.Add("assembly:");
            }

            Application["SEARCH_HISTORY"] = searchList;
        }

        if (searchList != null)
        {
            searchTerms = searchList.ToSearchTerms();
        }
        else
        {
            searchTerms = "disabled";
        }
    }
Пример #4
0
 private void setReferencesInMenuScene()
 {
     menu         = GameObject.FindObjectOfType <CurvedMenuController>();
     selectionBar = GameObject.FindObjectOfType <SelectionBar>();
 }
Пример #5
0
    private void InitializeView()
    {
        // Initialize - cannot take more than 10 values.
        SelectionBar searchList = new SelectionBar(5, "DSI.aspx");
        StringCollection applicationList = null;
        StringCollection appList = null;

        // Check whether the Profile is active and then proceed.
        if (Profile.ControlCenterProfile.IsProfileActive)
        {
            try
            {
                BCCModuleProperty props = Profile.ControlCenterProfile.ModuleFilter[SiteMap.CurrentNode.Description];
                applicationList = props.ModuleDictionary[BCCUIHelper.Constants.APP_LIST_KEY];
            }
            catch
            {
                // Ignore errors from Profile system
            }
        }

        if (applicationList != null && applicationList.Count > 0)
        {
            appList = dataAccess.RetrieveAllApplications(applicationList);
        }
        else
        {
            appList = dataAccess.RetrieveAllApplications();
        }

        foreach (String applicationName in appList)
        {
            searchList.Add(applicationName);
        }

        if (searchList != null)
        {
            searchTerms = searchList.ToSearchTerms();
        }
        else
        {
            searchTerms = "<empty>";
        }
    }
Пример #6
0
    private void InitializeSearchHistory()
    {
        StringCollection ssoAppList = null;
        string ssoConnectionString = string.Empty;
        // Initialize - cannot take more than 10 values.
        searchList = new SelectionBar(9, "BASSO.aspx");

        // Use filters here.
        // Check whether the Profile is active and then proceed.
        if (Profile.ControlCenterProfile.IsProfileActive)
        {
            try
            {
                BCCModuleProperty props = Profile.ControlCenterProfile.ModuleFilter[SiteMap.CurrentNode.Description];
                ssoAppList = props.ModuleDictionary[BCCUIHelper.Constants.APP_LIST_KEY];
                ssoConnectionString = props.ModuleKeys[BCCUIHelper.Constants.SSO_CONNECTION_KEY];
            }
            catch
            {
                // Ignore errors from Profile system
            }
        }

        foreach (string applicationName in SSOConfigHelper.ListApp(ssoConnectionString))
        {
            if (ssoAppList != null && ssoAppList.Count > 0)
            {
                if (ssoAppList.Contains(applicationName))
                {
                    searchList.Add(applicationName);
                }

                // This is for the datalist view on the right side.
                dlSSOAppList.DataSource = ssoAppList;
                dlSSOAppList.DataBind();
                dlSSOAppList.Visible = true;

            }
            else
            {
                searchList.Add(applicationName);
            }
        }

        if (searchList != null)
        {
            searchTerms = searchList.ToSearchTerms();
        }
        else
        {
            searchTerms = "none";
        }
    }