} // end of SetXButton() public override void Update(ref Matrix parentMatrix) { // Check for input but only if selected. if (selected) { GamePadInput pad = GamePadInput.GetGamePad0(); if (Actions.Select.WasPressed) { Actions.Select.ClearAllWasPressedState(); onSetNextLevel(); } if (Actions.X.WasPressed) { Actions.X.ClearAllWasPressedState(); NextLevel = null; if (onClear != null) { onClear(); } } } //load thumbnail if it hasn't loaded yet if (nextLevel != null && !nextLevel.Thumbnail.IsLoaded) { if (nextLevel.ThumbnailBytes == null) { string texFilename = BokuGame.Settings.MediaPath + Utils.FolderNameFromFlags(nextLevel.Genres) + nextLevel.WorldId.ToString(); Stream texStream = Storage4.TextureFileOpenRead(texFilename); if (texStream != null) { nextLevel.Thumbnail.Texture = Storage4.TextureLoad(texStream); Storage4.Close(texStream); } } else { MemoryStream stream = new MemoryStream(nextLevel.ThumbnailBytes); nextLevel.Thumbnail.Texture = Storage4.TextureLoad(stream); nextLevel.ThumbnailBytes = null; } } //refresh the render target RefreshTexture(); base.Update(ref parentMatrix); } // end of UIGridModularCheckboxElement Update()