private void UpdateButtons() { if (m_bRandom) { GUIControl.SelectControl(GetID, (int)Controls.CONTROL_RANDOM); } else { GUIControl.DeSelectControl(GetID, (int)Controls.CONTROL_RANDOM); } if (m_bXFade) { GUIControl.SelectControl(GetID, (int)Controls.CONTROL_XFADE); } else { GUIControl.DeSelectControl(GetID, (int)Controls.CONTROL_XFADE); } if (m_bKenBurns) { GUIControl.SelectControl(GetID, (int)Controls.CONTROL_KENBURNS); } else { GUIControl.DeSelectControl(GetID, (int)Controls.CONTROL_KENBURNS); } }
private bool OnInit() { _Settings.Load(); if (_Settings.Music) { GUIControl.SelectControl(GetID, (int)Controls.ToggleMusic); } else { GUIControl.DeSelectControl(GetID, (int)Controls.ToggleMusic); } if (_Settings.Sound) { GUIControl.SelectControl(GetID, (int)Controls.ToggleSound); } else { GUIControl.DeSelectControl(GetID, (int)Controls.ToggleSound); } m_wndTetris = GetControl((int)Controls.Tetris) as MyTetrisControl; int nScore = 0; int nLines = 0; int nLevel = 0; if (m_wndTetris != null) { nScore = m_wndTetris.Score; nLines = m_wndTetris.Lines; nLevel = m_wndTetris.Level; m_wndTetris.Sound = _Settings.Sound; m_wndTetris.Music = _Settings.Music; // we don't get told when the green (return to home window) button is hit so // we make it look like we correctly paused the game when it was hit here if (m_wndTetris.State == State.Running) { m_wndTetris.State = State.Paused; } } GUIPropertyManager.SetProperty("#tetris_score", nScore.ToString()); GUIPropertyManager.SetProperty("#tetris_lines", nLines.ToString()); GUIPropertyManager.SetProperty("#tetris_level", nLevel.ToString()); GUIPropertyManager.SetProperty("#tetris_highscore", _Settings.Highscore.ToString()); GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get((int)Strings.MyTetris)); return(true); }
protected override void OnPageLoad() { try { _Settings.Load(); ShowInvalid(); if (_Settings.Show) { GUIControl.SelectControl(GetID, ((int)SkinControlIDs.BTN_SHOW_INVALID_MOVES)); } else { GUIControl.DeSelectControl(GetID, ((int)SkinControlIDs.BTN_SHOW_INVALID_MOVES)); } if (_Settings.Block) { GUIControl.SelectControl(GetID, ((int)SkinControlIDs.BTN_BLOCK_INVALID_MOVES)); } else { GUIControl.DeSelectControl(GetID, ((int)SkinControlIDs.BTN_BLOCK_INVALID_MOVES)); } for (int i = 1; i < 4; i++) { GUIPropertyManager.SetProperty("#numberplace.name" + i, " "); GUIPropertyManager.SetProperty("#numberplace.score" + i, " "); } if (gameRunning) { ResumeTimer(); } UpdateButtonStates(); base.OnPageLoad(); } catch (Exception e1) { Log.Error("GUINumberPlace: Exception occured - {0}", e1.Message); } }