private void AnimClick(ConResource pButton) { if (pButton.CurSprite != pButton.NumSprites - 1) { pButton.CurSprite++; _text.FlushForRedraw(); pButton.DrawToScreen(NoMask); _text.DrawToScreen(WithMask); _system.GraphicsManager.UpdateScreen(); Delay(150); if (_controlPanel == null) return; pButton.CurSprite--; _text.FlushForRedraw(); pButton.DrawToScreen(NoMask); _text.DrawToScreen(WithMask); _system.GraphicsManager.UpdateScreen(); } }
private void DoToggleFx(ConResource pButton) { SystemVars.Instance.SystemFlags ^= SystemFlags.FxOff; if (SystemVars.Instance.SystemFlags.HasFlag(SystemFlags.FxOff)) { pButton.CurSprite = 0; _statusBar.SetToText(0x7000 + 87); } else { pButton.CurSprite = 2; _statusBar.SetToText(0x7000 + 86); } // TODO: configuration //ConfMan.setBool("sfx_mute", SystemVars.SystemFlags.HasFlag(SystemFlags.FX_OFF) != 0); pButton.DrawToScreen(WithMask); _system.GraphicsManager.UpdateScreen(); }
private void ToggleMusic(ConResource pButton) { SystemVars.Instance.SystemFlags ^= SystemFlags.MusOff; if (SystemVars.Instance.SystemFlags.HasFlag(SystemFlags.MusOff)) { _skyMusic.StartMusic(0); pButton.CurSprite = 0; _statusBar.SetToText(0x7000 + 89); } else { _skyMusic.StartMusic(SystemVars.Instance.CurrentMusic); pButton.CurSprite = 2; _statusBar.SetToText(0x7000 + 88); } // TODO: configuration // ConfMan.setBool("music_mute", (SkyEngine::_systemVars.systemFlags & SF_MUS_OFF) != 0); pButton.DrawToScreen(WithMask); _system.GraphicsManager.UpdateScreen(); }
private void ShowSprites(byte[][] nameSprites, bool allowSave) { var drawResource = new ConResource(null, 1, 0, 0, 0, 0, 0, _system, _screenBuf); for (ushort cnt = 0; cnt < MaxOnScreen; cnt++) { drawResource.SetSprite(nameSprites[cnt]); drawResource.SetXy(GameNameX, (ushort)(GameNameY + cnt * PanCharHeight)); if (ServiceLocator.Platform.ToStructure<DataFileHeader>(nameSprites[cnt], 0).flag != 0) { // name is highlighted for (ushort cnty = (ushort)(GameNameY + cnt * PanCharHeight); cnty < GameNameY + (cnt + 1) * PanCharHeight - 1; cnty++) { _screenBuf.Set(cnty * Screen.GameScreenWidth + GameNameX, 37, PanLineWidth); } drawResource.DrawToScreen(WithMask); if (allowSave) { drawResource.SetSprite(nameSprites[MaxOnScreen]); drawResource.SetXy((ushort)(GameNameX + _enteredTextWidth + 1), (ushort)(GameNameY + cnt * PanCharHeight + 4)); drawResource.DrawToScreen(WithMask); } _system.GraphicsManager.CopyRectToScreen(_screenBuf, (GameNameY + cnt * PanCharHeight) * Screen.GameScreenWidth + GameNameX, Screen.GameScreenWidth, GameNameX, GameNameY + cnt * PanCharHeight, PanLineWidth, PanCharHeight); } else drawResource.DrawToScreen(NoMask); } }