Exemplo n.º 1
0
    IEnumerator RunShowSideMenu()
    {
        SideMenu         sideMenu    = SideMenu.Instance;
        LargeCubeCluster cubeCluster = LargeCubeCluster.Instance;

        sideMenu.ShowBackground(true);  //Fades in background...

        //Wait sometime after background fades in...
        yield return(new WaitForSeconds(1.5f));

        sideMenu.ShowJoinConversation(true);
        CubeCluster.HidePlayerCubes = false; //Show player cubes, in cube cluster...
        sideMenu.ShowCameraView(true);       //Fades in cube cluster view...

        yield return(new WaitForSeconds(m_cubeWaitTime));

        cubeCluster.ShowCluster(true);    //Slides in cube cluster...

        yield return(new WaitForSeconds(1f));

        sideMenu.ShowTakePoll(true);

        yield return(new WaitForSeconds(3f));

        Player.ShowPointPoll = true;
        AppManager.State     = AppManager.AppState.CAN_TAKE_POLL;
        PanelManager.Instance.ClearAllPanels();
    }
Exemplo n.º 2
0
        /// <summary>
        /// Handles changes in edited components (hides/shows side menu when necessary)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnEditedComponentChanged(object sender, EditedComponentChangedEventArgs args)
        {
            switch (args.Change)
            {
            case EditedComponentChanged.NullToComponent:
            case EditedComponentChanged.NoChange:
            case EditedComponentChanged.ComponentToComponent:
            {
                // Show the edit menu if it wasn't shown
                if (SideMenu.GetSelectedContentIndex() != 1)
                {
                    SideMenu.SetSelectedContentFromIndex(1);
                }

                SideMenu.IsOpen = true;
            }
            break;

            case EditedComponentChanged.ComponentToNull:
            {
                // Hide the menu
                SideMenu.IsOpen = false;
            }
            break;
            }
        }
Exemplo n.º 3
0
        private void Menu_Shown(object sender, EventArgs e)
        {
            SubMenus[0] = panel_SubMenu_Zákazky;
            SubMenus[1] = panel_SubMenu_Zamestnanci;
            SubMenus[2] = panel_SubMenu_Dochádzka;
            SubMenus[3] = panel_SubMenu_Odberatelia;


            //skrytie sub menu (dalšie buttony pod hlavným button)
            SideMenu.skryťSubMenu(SubMenus);

            //vytvoríme objekt okna a zobrazíme ho ako dialóg
            Form_Prihlásenie frmLogin = new Form_Prihlásenie();
            DialogResult     odpoved  = frmLogin.ShowDialog();

            //ak odpoveď nášho dialógu nebola OK, zatvoríme aplikáciu
            if (odpoved != DialogResult.OK)
            {
                Application.Exit();
            }
            else
            {
                label_Prihlásenie.Visible = false;
            }
        }
Exemplo n.º 4
0
 private void Initialize(string TextTemplate, delMenuClicked Callback, SideMenu Parent, string List)
 {
     _TextTemplate = TextTemplate;
     ClickedMethod = Callback;
     ParentMenu = Parent;
     CorrespondingList = List;
 }
Exemplo n.º 5
0
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            BindingExpression usernameValidation = userNameField.GetBindingExpression(TextBox.TextProperty);

            usernameValidation.UpdateSource();
            if (!usernameValidation.HasValidationError)
            {
                BindingExpression passwordValidation = pbPassword.GetBindingExpression(PasswordBoxAssistant.BoundPassword);
                passwordValidation.UpdateSource();
                if (passwordValidation.HasValidationError)
                {
                    lbHelpPassword.Content    = passwordValidation.ValidationError.ErrorContent;
                    lbHelpPassword.Foreground = new SolidColorBrush(Color.FromArgb(255, 244, 67, 54));
                }
                else
                {
                    lbHelpPassword.Content    = "Unesite lozinku";
                    lbHelpPassword.Foreground = new SolidColorBrush(Color.FromArgb(255, 144, 144, 144));
                    EntityFactory.User        = user.SelectByUsername(userNameField.Text);
                    if (EntityFactory.User.type.Equals(UserType.regular.ToString()))
                    {
                        SideMenu userControl = new SideMenu();
                        userControl.mainContent.Content = new DailyNotes();
                        Content = userControl;
                    }
                    else
                    {
                        Content = new UserAccounts();
                    }
                }
            }
        }
Exemplo n.º 6
0
    /// <summary>
    /// Open side menu by reference, and close the current active one.
    /// </summary>
    /// <param name="sideMenuName"></param>
    public void OpenSideMenu(SideMenu sideMenu)
    {
        SideMenu lastSM  = CurActiveSideMenu;
        bool     foundIt = false;

        foreach (SideMenu sM in AllSideMenus)
        {
            if (sM == sideMenu)
            {
                sM.ChangeVisibility(true);
                CurActiveSideMenu = sM;
                foundIt           = true;
            }
        }

        if (lastSM && lastSM != CurActiveSideMenu)
        {
            lastSM.ChangeVisibility(false);
        }

        if (!foundIt)
        {
            Debug.LogError("There's no side menu named \"" + sideMenu.name + "\" inside Menu Manager's  \"All Side Menus\" list.", gameObject);
        }
    }
Exemplo n.º 7
0
    public override void Open()
    {
        MenuWindow.instance.currentWindow = this;
        sideMenu  = MenuWindow.instance.sideMenu;
        menuGuide = MenuWindow.instance.menuGuide;

        UserSelect();
    }
Exemplo n.º 8
0
 /// <summary>
 /// Close the current active side menu if found.
 /// </summary>
 public void CloseSideMenu()
 {
     if (CurActiveSideMenu)
     {
         CurActiveSideMenu.ChangeVisibility(false);
         CurActiveSideMenu = null;
     }
 }
Exemplo n.º 9
0
        private async Task DeleteScript(IGrimoireRunner scriptRunner)
        {
            ClearEvents();
            AppMode = AppMode.None;
            await SideMenu.Reload();

            ConfirmDeleteModal = true;
            await InvokeAsync(() => StateHasChanged());
        }
Exemplo n.º 10
0
        private async Task EndEdit()
        {
            ClearEvents();
            AppMode = AppMode.None;
            await SideMenu.Reload();

            ConfirmEditModal = true;
            await InvokeAsync(() => StateHasChanged());
        }
Exemplo n.º 11
0
        public App()
        {
            InitializeComponent();

            WebStuffDSte.InitDSte();

            MainPage = new SideMenu();

//            NavigationPage.SetHasBackButton(MainPage, false);
        }
Exemplo n.º 12
0
 // Use this for initialization
 void Start()
 {
     mainMenu           = new SideMenu("SideMenu_Main", true);
     defaultMenu        = new SideMenu("SideMenu_Default", true);
     loginMenu          = new SideMenu("SideMenu_Login");
     registerMenu       = new SideMenu("SideMenu_Register");
     showMenuButton     = GameObject.FindGameObjectWithTag("SideMenu_ShowMenu").GetComponent <Button>();
     showMenuButtonText = showMenuButton.GetComponentInChildren(typeof(Text)).GetComponent <Text>();
     SetMenuText();
 }
Exemplo n.º 13
0
        private async Task ShowError(string message, Exception ex)
        {
            LastError       = message;
            LastErrorDetail = ex.Message;
            LogService.Log(ex);
            ErrorModal = true;
            AppMode    = AppMode.None;
            await SideMenu.Reload();

            await InvokeAsync(() => StateHasChanged());
        }
Exemplo n.º 14
0
        private void ButtonClose_Click(object sender, RoutedEventArgs e)
        {
            Storyboard storyboard = new Storyboard();

            DoubleAnimation daWidth = new DoubleAnimation(SideMenu.ActualWidth, 0, new Duration(TimeSpan.FromSeconds(0.4)));

            storyboard.Children.Add(daWidth);

            Storyboard.SetTarget(daWidth, SideMenu);
            Storyboard.SetTargetProperty(daWidth, new PropertyPath(WidthProperty));

            SideMenu.BeginStoryboard(storyboard);
        }
Exemplo n.º 15
0
    List <SideMenu> GetSideMenusInCanvas(Transform canvas)
    {
        List <SideMenu> allSideMenus = new List <SideMenu>();

        foreach (Transform c in canvas)
        {
            SideMenu cSideMenu = c.GetComponent <SideMenu>();
            if (cSideMenu)
            {
                allSideMenus.Add(cSideMenu);
            }

            allSideMenus.AddRange(GetSideMenusInCanvas(c));
        }
        return(allSideMenus);
    }
Exemplo n.º 16
0
    public override void _Ready()
    {
        grid           = GetTree().GetRoot().GetNode("Game/Grid") as Grid;
        turnManager    = GetNode("/root/TurnManager") as TurnManager;
        movementCursor = GetNode("MovementCursor") as MovementCursor;
        playerInput    = GetNode("PlayerInput") as PlayerInput;
        stats          = GetNode("Stats") as Stats;
        inventory      = GetNode("Inventory") as Inventory;
        equipment      = GetNode("Equipment") as EquipmentHolder;

        turnManager.Turns.Add(this);

        SideMenu sideMenu = GetTree().GetRoot().GetNode("Game/CanvasLayer/GUI/SideMenu") as SideMenu;

        sideMenu.SetGUIOnGameStart(this);
    }
Exemplo n.º 17
0
        private void btnRegistration_Click(object sender, RoutedEventArgs e)
        {
            BindingExpression firstNameValidation = nameBox.GetBindingExpression(TextBox.TextProperty);

            firstNameValidation.UpdateSource();

            BindingExpression lastNameValidation = surnameBox.GetBindingExpression(TextBox.TextProperty);

            lastNameValidation.UpdateSource();

            BindingExpression usernameValidation = usernameBox.GetBindingExpression(TextBox.TextProperty);

            usernameValidation.UpdateSource();

            BindingExpression passwordValidation = pbPassword.GetBindingExpression(PasswordBoxAssistant.BoundPassword);

            passwordValidation.UpdateSource();
            if (passwordValidation.HasValidationError)
            {
                lbHelpPassword.Content    = passwordValidation.ValidationError.ErrorContent;
                lbHelpPassword.Foreground = new SolidColorBrush(Color.FromArgb(255, 244, 67, 54));
            }
            else
            {
                lbHelpPassword.Content    = "Unesite lozinku";
                lbHelpPassword.Foreground = new SolidColorBrush(Color.FromArgb(255, 144, 144, 144));
            }

            List <bool> errors = new List <bool>()
            {
                firstNameValidation.HasValidationError,
                lastNameValidation.HasValidationError,
                usernameValidation.HasValidationError,
                passwordValidation.HasValidationError
            };

            if (!errors.Contains(true))
            {
                var  password = BCrypt.Net.BCrypt.HashPassword(pbPassword.Password, pbPassword.Password.ToString().Length);
                user newUser  = EntityFactory.CreateUser(nameBox.Text.First().ToString().ToUpper() + nameBox.Text.Substring(1),
                                                         surnameBox.Text.First().ToString().ToUpper() + surnameBox.Text.Substring(1), usernameBox.Text, password, UserType.regular);
                user.Insert(newUser);
                EntityFactory.User = newUser;
                Content            = new SideMenu();
            }
        }
Exemplo n.º 18
0
            public static SideMenu Create(IReadOnlyDictionary <FF8String, FF8String> pairs)
            {
                var r = new SideMenu
                {
                    _helpStr = new FF8String[pairs.Count],
                    _widths  = new int[pairs.Count]
                };
                byte pos = 0;

                foreach (var pair in pairs)
                {
                    r._helpStr[pos] = pair.Value;
                    var rectangle = Memory.Font.RenderBasicText(pair.Key, 0, 0, skipdraw: true);
                    r._widths[pos] = rectangle.Width;
                    if (rectangle.Width > r._largestWidth)
                    {
                        r._largestWidth = rectangle.Width;
                    }
                    if (rectangle.Height > r._largestHeight)
                    {
                        r._largestHeight = rectangle.Height;
                    }
                    r._totalWidth  += rectangle.Width;
                    r._totalHeight += rectangle.Height;
                    r._avgWidth     = r._totalWidth / (pos + 1);
                    r._avgHeight    = r._totalHeight / (pos + 1);
                    pos++;
                }
                r.Init(pairs.Count, 1, new IGMDataItem.Box {
                    Pos = new Rectangle {
                        Width = 226, Height = 492, X = 843 - 226
                    }
                }, 1, pairs.Count);
                pos = 0;
                foreach (var pair in pairs)
                {
                    r.ITEM[pos, 0] = new IGMDataItem.Text {
                        Data = pair.Key, Pos = new Rectangle(r.SIZE[pos].X, r.SIZE[pos].Y, 0, 0)
                    };
                    pos++;
                }

                r.Cursor_Status |= (Cursor_Status.Enabled | Cursor_Status.Vertical | Cursor_Status.Horizontal);
                return(r);
            }
Exemplo n.º 19
0
    IEnumerator StartPoll()
    {
        SideMenu         sideMenu      = SideMenu.Instance;
        LargeCubeCluster cubeCluster   = LargeCubeCluster.Instance;
        float            pollCountdown = StartupSettings.Instance.PollPrepareCountdown;

        float timer = pollCountdown;

        //Hide "Join Conversation text"...
        sideMenu.ShowJoinConversation(false);
        sideMenu.ShowTakePoll(false);
        CubeCluster.HidePlayerCubes = true;

        Player.ShowHashtag       = false;
        Player.ShowMoveIcon      = false;
        Player.ShowColor         = true;
        Player.ShowInactiveColor = false;

        //Explode cube...
        yield return(new WaitForSeconds(m_exploadWaitTime));

        Player.ShowTakePollText = true;
        cubeCluster.Explode();

        //Show "Let's Get Started" text...
        sideMenu.ShowGetStarted(true);

        //Show countdown cube...
        yield return(new WaitForSeconds(m_exploadRunTime));

        sideMenu.ShowCameraView(false); //Fading out cube cluster

        yield return(new WaitForSeconds(m_pollWaitTime));

        cubeCluster.DestroyCluster();
        cubeCluster.CreateCluster();

        Player.CountdownValue     = (int)pollCountdown;
        Player.ShowCountdownValue = true;
        StartCoroutine(Player.RunCountdown(null));

        yield return(new WaitForSeconds(pollCountdown + 1f));

        PollManager.Instance.StartNextPoll();
    }
Exemplo n.º 20
0
    //Poll starts here...
    IEnumerator RunPoll()
    {
        ContentManager content  = ContentManager.Instance;
        CubeSpawner    spawner  = CubeSpawner.Instance;
        SideMenu       sideMenu = SideMenu.Instance;

        CenterScreen centerScreen = CenterScreen.Instance;
        CenterMenu   centerMenu   = CenterMenu.Instance;
        LeftMenu     leftMenu     = LeftMenu.Instance;
        RightMenu    rightMenu    = RightMenu.Instance;

        yield return(new WaitForSeconds(m_pollWindowWaitTime));

        Player.ShowMoveCubeText = true;
        rightMenu.ShowBackground(true);
        centerMenu.ShowBackground(true);
        leftMenu.ShowBackground(true);

        yield return(new WaitForSeconds(1.2f));

        //Set poll question and responses...
        m_pollQuestionCounter = (m_pollQuestionCounter + 1) %
                                content.PollAList.Count;
        m_poll = content.PollAList[m_pollQuestionCounter];
        content.OpenConnection();
        m_answerInfo = (AOrBAnswerInfo)content.GetPollAnswersA(m_poll.Question_Id);
        content.CloseConnection();

        centerScreen.HeaderText.text        = m_poll.Question;
        centerMenu.ActivePollAAnswer.text   = m_poll.Answer_a;
        centerMenu.InactivePollAAnswer.text = m_poll.Answer_a;
        rightMenu.ActivePollAAnswer.text    = m_poll.Answer_b;
        rightMenu.InactivePollAAnswer.text  = m_poll.Answer_b;

        yield return(new WaitForSeconds(m_showPollWaitTime));

        centerScreen.ShowHeader(true);
        centerMenu.ShowPollA(true);
        rightMenu.ShowPollA(true);
        PanelManager.Instance.ClearPanel(1);
        PanelManager.Instance.ClearPanel(2);
        m_yesNoActive = true;

        StartCoroutine(RunPollCountdown());
    }
Exemplo n.º 21
0
        private void lstMenu_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (e.SelectedItem == null)
            {
                return;
            }
            Theme    CurTheme    = new Theme();
            SideMenu itemClicked = e.SelectedItem as SideMenu;
            var      type        = Type.GetType("KeertanPothi.Views." + itemClicked.ViewName);

            Detail = new NavigationPage(Activator.CreateInstance(type) as Page)
            {
                BarBackgroundColor = Color.FromHex(CurTheme.HeaderColor),
                BarTextColor       = Color.White,
            };
            IsPresented          = false;
            lstMenu.SelectedItem = null;
        }
Exemplo n.º 22
0
        private void CreateMenu()
        {
            _menu = new SideMenu(SLWIOC.Get <IAuthManager>());
            _menu.MenuItemTapped   += _menu_MenuItemTapped;
            _menu.IsVisible         = false;
            _menu.TranslationX      = -MENU_WIDTH;
            _menu.BackgroundColor   = AppStyle.MenuBarBackground.ToXamFormsColor();
            _menu.WidthRequest      = MENU_WIDTH;
            _menu.HorizontalOptions = LayoutOptions.Start;
            _menu.SetValue(Grid.RowProperty, 1);

            _pageMenuMask = new Grid()
            {
                BackgroundColor = Xamarin.Forms.Color.Black, Opacity = 0.50
            };
            _pageMenuMask.SetValue(Grid.RowProperty, 1);
            _pageMenuMask.IsVisible = false;
        }
Exemplo n.º 23
0
        private SideMenuInfo CovertToSideMenuInfo(TreeMenu treeMenu, Collection <SideMenu> nodes, string rootcode, string username)
        {
            if (treeMenu.PGM_ID.StartsWith("Warehouse"))
            {
                return(ConvertToWarehouses(treeMenu));
            }
            if (treeMenu.PGM_ID == "TMALL" && treeMenu.SubMenus != null)
            {
                foreach (var channel in treeMenu.SubMenus)
                {
                    string channelName = channel.PGM_ID;
                    foreach (var action in channel.SubMenus)
                    {
                        action.PGM_ID = channelName + action.PGM_ID;
                    }
                }
            }
            SideMenu node = nodes.Count(p => p.Code == treeMenu.PGM_ID) > 1
                ? nodes.FirstOrDefault(p => p.Code == treeMenu.PGM_ID && p.ParentCode == rootcode)
                : nodes.FirstOrDefault(p => p.Code == treeMenu.PGM_ID);

            if (node == null)
            {
                return(null);
            }
            SideMenuInfo result = SideMenuInfo.CreateFrom(node);

            result.Name    = treeMenu.PGM_NM;
            result.Type    = SideItemType.Page;
            result.BadgeId = node.Code.Replace(" ", "");
            result.Badge   = ReadBadge(node.Code, username);
            if (treeMenu.SubMenus != null && treeMenu.SubMenus.Length > 0)
            {
                foreach (var info in treeMenu.SubMenus.Select(temp => CovertToSideMenuInfo(temp, nodes, rootcode, username)).Where(info => info != null))
                {
                    result.ChildNodes.Add(info);
                }
            }
            return(result);
        }
Exemplo n.º 24
0
    IEnumerator RunHideSideMenu()
    {
        SideMenu         sideMenu    = SideMenu.Instance;
        LargeCubeCluster cubeCluster = LargeCubeCluster.Instance;

        sideMenu.ShowTakePoll(false);
        yield return(new WaitForSeconds(1f));

        cubeCluster.ShowCluster(false);
        yield return(new WaitForSeconds(m_cubeWaitTime));

        sideMenu.ShowCameraView(false);
        CubeCluster.HidePlayerCubes = true;
        sideMenu.ShowJoinConversation(false);
        sideMenu.ShowBackground(false);  //Fade out background...

        yield return(new WaitForSeconds(1f));

        PollManager.Instance.ResetTwitter();

        AppManager.State = AppManager.AppState.ATTRACT_CUBES;
    }
Exemplo n.º 25
0
        public MainWindow()
        {
            InitializeComponent();
            AdditionalInitializeComponent();
            VisualInitializeComponent();

            var loginWindow = new LoginWindow();

            loginWindow.ShowDialog();

            if (!loginWindow.DialogResult.HasValue || loginWindow.DialogResult != true)
            {
                Close();
                return;
            }
            Login          = loginWindow.GetLogin();
            SideMenu.Login = Login;
            SideMenu.LvlVisual();
            TopMenu.Login = Login;
            TopMenu.LvlVisual();

            PageSwitcher.Switch(new StartPage()); // Страница по умолчанию
        }
Exemplo n.º 26
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //Initialize Uielements
            var newBaseGame = new BaseGame();
            var newSideMenu = new SideMenu();

            newBaseGame.Initialize(GraphicsDevice, new ContentManager(Content.ServiceProvider, Content.RootDirectory));
            newSideMenu.Initialize(GraphicsDevice, new ContentManager(Content.ServiceProvider, Content.RootDirectory),
                                   newBaseGame);

            _uiElements.Add(newBaseGame);
            _uiElements.Add(newSideMenu);

            //Set width and Height of application
            _graphicsDeviceManager.PreferredBackBufferHeight = newBaseGame.CellCountY * newBaseGame.CellSize + 1;
            _graphicsDeviceManager.PreferredBackBufferWidth  = newBaseGame.CellCountX * newBaseGame.CellSize + 1 + 250;
            _graphicsDeviceManager.ApplyChanges();

            //Set mouse visibility to true
            IsMouseVisible = true;

            base.Initialize();
        }
Exemplo n.º 27
0
    void Start()
    {
        overlay = new DetailsOverlay(baseDir);
        overlay.CloseInfo += () => {showOverlay = false;};

        cameraControls = new CameraControls(baseDir);
        cameraControls.TakeScreenShot += () => TakeScreenShot();

        upperMenu = new UpperMenu(baseDir);
        upperMenu.CancelDelete += () => CancelDeleteFn();
        upperMenu.DeleteBtn += () => DeleteButtonFn();
        upperMenu.searchClick += () => searchClickHandler();
        upperMenu.ClearBtn += () => {ClearBtn(); ResetManipulation();};
        upperMenu.InfoClick += () => InfoClick();
        upperMenu.textChange += (newText) => setSearchText(newText);

        sideMenu = new SideMenu(baseDir);
        sideMenu.SpawnFurniture += (furniture) => spawnFurniture(furniture);
        sideMenu.ShowInfo += (furniture) => showInfo(furniture);
        sideMenu.CategoryClick += () => {upperMenu.resetSearchBar();};

        SSLogoTex = (Texture2D)Resources.Load(baseDir + "Screenshot/SNAPSHOT_cornerlogo_02");
    }
Exemplo n.º 28
0
    IEnumerator RunPollCountdown()
    {
        ContentManager   content          = ContentManager.Instance;
        PanelManager     panelManager     = PanelManager.Instance;
        CenterScreen     centerScreen     = CenterScreen.Instance;
        SideMenu         sideMenu         = SideMenu.Instance;
        CenterMenu       centerMenu       = CenterMenu.Instance;
        RightMenu        rightMenu        = RightMenu.Instance;
        LeftMenu         leftMenu         = LeftMenu.Instance;
        LargeCubeCluster largeCubeCluster = LargeCubeCluster.Instance;
        SmallCubeCluster smallCubeCluster = SmallCubeCluster.Instance;
        EqualCubeCluster equalCubeCluster = EqualCubeCluster.Instance;

        float pollCountdown = StartupSettings.Instance.PollCountdown;

        PlayerManager playerManager = PlayerManager.Instance;
        var           activePlayers = playerManager.ActivePlayers;

        yield return(new WaitForSeconds(m_beforeCountdownTime));

        //Wait for show icon above to go away...
        yield return(new WaitForSeconds(1f));

        Player.ShowMoveCubeText   = false;
        Player.CountdownValue     = (int)pollCountdown;
        Player.ShowCountdownValue = true;

        StartCoroutine(Player.RunCountdown(null));
        yield return(new WaitForSeconds(pollCountdown + 1f));

        Player.ShowCountdownValue = false;
        yield return(new WaitForSeconds(1f));

        m_yesNoActive = false;
        rightMenu.ShowActiveNo(false);
        centerMenu.ShowActiveYes(false);
        rightMenu.HideInactiveNo(false);
        centerMenu.HideInactiveYes(false);

        {   //Poll results start here...
            bool leftHasNotChanged  = true;
            bool rightHasNotChanged = true;

            foreach (Player player in playerManager.ActivePlayers)
            {
                if (panelManager.ContainsPlayer(player, 1))      //center panel...
                {
                    leftHasNotChanged     = false;
                    m_answerInfo.answerA += 1;
                }
                else if (panelManager.ContainsPlayer(player, 2))     //right panel...
                {
                    rightHasNotChanged    = false;
                    m_answerInfo.answerB += 1;
                }
            }

            bool largeIsRight = m_answerInfo.answerA < m_answerInfo.answerB;
            bool smallIsRight = m_answerInfo.answerA > m_answerInfo.answerB;

            //Filters players from cube clusters they didn't vote for...
            FilterActivePlayers(largeIsRight, smallIsRight);

            centerScreen.MoveUpHeader(true);
            centerMenu.MoveDownYes(true);
            rightMenu.MoveDownNo(true);

            yield return(new WaitForSeconds(1f));

            CubeCluster.HidePlayerCubes = false;
            Player.ShowColor            = false;

            float total        = m_answerInfo.answerA + m_answerInfo.answerB;
            int   leftPercent  = (int)((m_answerInfo.answerA / total) * 100);
            int   rightPercent = (int)((m_answerInfo.answerB / total) * 100);

            centerMenu.StartPollAPercentCountdown(m_percentCountdownTime, leftPercent);
            rightMenu.StartPollAPercentCountdown(m_percentCountdownTime, rightPercent);

            largeCubeCluster.InstantShowCluster();
            smallCubeCluster.InstantShowCluster();
            equalCubeCluster.InstantShowCluster();

            if (largeIsRight)
            {
                centerMenu.ShowSmallResults(true);
                rightMenu.ShowLargeResults(true);
            }
            else if (smallIsRight)
            {
                centerMenu.ShowLargeResults(true);
                rightMenu.ShowSmallResults(true);
            }
            else    //They are equal...
            {
                rightMenu.ShowLargeResults(true);
                centerMenu.ShowEqualResults(true);
            }

            yield return(new WaitForSeconds(m_percentCountdownTime));

            yield return(new WaitForSeconds(2f));

            if (leftHasNotChanged)
            {
                centerMenu.HideLargePercent(true);
                centerMenu.HideSmallPercent(true);

                if (largeIsRight)
                {
                    smallCubeCluster.Explode();
                }
                else if (smallIsRight)
                {
                    largeCubeCluster.Explode();
                }
                else
                {
                    equalCubeCluster.Explode();
                }
            }
            if (rightHasNotChanged)
            {
                rightMenu.HideLargePercent(true);
                rightMenu.HideSmallPercent(true);

                if (largeIsRight)
                {
                    largeCubeCluster.Explode();
                }
                else if (smallIsRight)
                {
                    smallCubeCluster.Explode();
                }
                else
                {
                    largeCubeCluster.Explode();
                }
            }

            yield return(new WaitForSeconds(StartupSettings.Instance.AfterPollATimeout));

            centerMenu.ShowLargeResults(false);
            centerMenu.ShowSmallResults(false);
            centerMenu.ShowEqualResults(false);
            rightMenu.ShowLargeResults(false);
            rightMenu.ShowSmallResults(false);
            rightMenu.ShowEqualResults(false);

            //Updating poll answers and starting takeaway...
            content.OpenConnection();
            content.PutPollAnswers(m_answerInfo);
            PollManager.Instance.StartTakeaway(m_poll.Question_Id);
            content.CloseConnection();

            yield return(new WaitForSeconds(2f));

            centerMenu.HideLargePercent(false);
            rightMenu.HideLargePercent(false);
            centerMenu.HideSmallPercent(false);
            rightMenu.HideSmallPercent(false);

            largeCubeCluster.DestroyCluster();
            largeCubeCluster.CreateCluster();
            smallCubeCluster.DestroyCluster();
            smallCubeCluster.CreateCluster();
            equalCubeCluster.DestroyCluster();
            equalCubeCluster.CreateCluster();

            //Cleanup...
            largeCubeCluster.FilteredPlayers.Clear();
            smallCubeCluster.FilteredPlayers.Clear();
            equalCubeCluster.FilteredPlayers.Clear();
        }

        //Cleanup...
        Player.ShowColor          = false;
        Player.ShowInactiveColor  = true;
        Player.ShowCountdownValue = false;
        Player.ShowMoveIcon       = true;
        StartCoroutine(Player.ShowHashtagOverTime(m_hashtagShowTime));

        sideMenu.ShowBackground(false);
        rightMenu.ShowBackground(false);
        centerMenu.ShowBackground(false);
        leftMenu.ShowBackground(false);
        centerScreen.ShowHeader(false);
        centerMenu.ShowPollA(false);
        rightMenu.ShowPollA(false);

        //Wait some time for animations above to take effect...
        yield return(new WaitForSeconds(1.5f));

        centerScreen.ResetHeader();
        centerMenu.ResetYesAnimator();
        rightMenu.ResetNoAnimator();

        yield return(new WaitForSeconds(1.5f));

        //Allow streaming cubes to start streaming in again...
        //TODO: Should be AppState.TAKE_AWAY...
        AppManager.State = AppManager.AppState.ATTRACT_CUBES;
        PanelManager.Instance.ClearAllPanels();
    }
Exemplo n.º 29
0
 public SideMenuItem(delMenuClicked Callback, string TextTemplate, SideMenu Parent, string List)
 {
     Initialize(TextTemplate, Callback, Parent, List);
 }
Exemplo n.º 30
0
 private void buttonZobrazOdpracovaneDni_Click(object sender, EventArgs e)
 {
     SideMenu.zobrazChildForm(new Form_ZobraziťOdpracovanéDni(), panel_ChildForm);
 }
Exemplo n.º 31
0
 private void buttonZapisOdpracovanyDen_Click(object sender, EventArgs e)
 {
     SideMenu.zobrazChildForm(new Form_ZapísaťOdpracovanýDeň(), panel_ChildForm);
 }
Exemplo n.º 32
0
 private void buttonZobrazitZamestnancov_Click(object sender, EventArgs e)
 {
     SideMenu.zobrazChildForm(new Form_ZobraziťZamestnancov(), panel_ChildForm);
 }
Exemplo n.º 33
0
 private void buttonVlozitNovehoZamestnanca_Click(object sender, EventArgs e)
 {
     SideMenu.zobrazChildForm(new Form_PridaťZamestnanca(), panel_ChildForm);
 }
Exemplo n.º 34
0
        private List<SideMenu> CreateSideMenu(string currentController, string currentAction)
        {
            var sideMenus = new List<SideMenu>
            {
                new SideMenu{ Name="首页", Url="/Home/Index", IconClass = "icon-home", IsActive = currentController == "Home"},
                new SideMenu{Name="我的考试", Url="/Exam/Index", IconClass  ="icon-pencil", IsActive = currentController == "Exam",
                    ChildMenus = new List<SideChildMenu>{
                        new SideChildMenu{ Name="我的任务考试", Url = "/Exam/MyTask", IsActive = currentAction == "MyTask" && currentController == "Exam"},
                        new SideChildMenu{ Name="我的推荐考试", Url = "/Exam/MyRec", IsActive = currentAction == "MyRec" && currentController == "Exam"},
                        new SideChildMenu{ Name="成绩查询", Url = "/Exam/Query", IsActive = currentAction == "Query" && currentController == "Exam"}
                    }},
                new SideMenu{Name="我的学习", Url="/Learn/Index", IconClass  ="icon-file", IsActive = currentController == "Learn",
                    ChildMenus = new List<SideChildMenu>{
                        new SideChildMenu{ Name="最新课程", Url = "/Learn/NewCourse", IsActive = currentAction == "NewCourse" && currentController == "Learn"},
                        new SideChildMenu{ Name="课程浏览", Url = "/Learn/Course", IsActive = currentAction == "Course" && currentController == "Learn"},
                        new SideChildMenu{ Name="我的收藏", Url = "/Learn/Fav", IsActive = currentAction == "Fav" && currentController == "Learn"},
                        new SideChildMenu{ Name="已学习课程", Url = "/Learn/Studied", IsActive = currentAction == "Studied" && currentController == "Learn"}
                    }},
                 new SideMenu{Name="我的信息", Url="/Info/Index", IconClass  ="icon-user", IsActive = currentController == "Info",
                    ChildMenus = new List<SideChildMenu>{
                        new SideChildMenu{ Name="系统通知", Url = "/Info/SysInfo", IsActive = currentAction == "SysInfo" && currentController == "Info"},
                        new SideChildMenu{ Name="我的建议", Url = "/Info/Suggest", IsActive = currentAction == "Suggest" && currentController == "Info"},
                        new SideChildMenu{ Name="行业信息", Url = "/Info/Industry", IsActive = currentAction == "Industry" && currentController == "Info"}
                    }}
            };

            //添加我的网点,根据权限
            var menus = AuthService.GetMenusByUserName(User.Identity.Name);
            var mySiteMenu = menus.Where(m => m.Id == 9).FirstOrDefault();
            if (mySiteMenu != null)
            {
                var siteMenu = new SideMenu { Name = "我的网点", Url = "/Site/Index", IconClass = "icon-screenshot", IsActive = currentController == "Site" && currentAction == "Index" };
                var sideChildMenus = new List<SideChildMenu>();
                var subSiteMenus = menus.Where(m => m.ParentId == 0);
                foreach (var subSite in subSiteMenus)
                {
                    var sideMenu = new SideChildMenu { Name = subSite.Name, Url = subSite.Url, IsActive = currentController == "Site" && subSite.Url.IndexOf(currentAction) > "Site".Length };
                    sideChildMenus.Add(sideMenu);
                }
                siteMenu.ChildMenus = sideChildMenus;

                sideMenus.Add(siteMenu);
            }

            return sideMenus;
        }