Graphics Options (#775)

* Add Graphics Options

* ScreenVersion 3

* Add Graphics Options

* Add Graphics Options

* Check for Cover Size change

* Minor Adjustments

* Corrected ScreenVersion

* Add Graphics Options

* Add Graphics Options

* Add Graphics Options

* Add Graphics Options

* Add Graphical Options

* Minor correction

* Add Graphics Options

* Add Graphics Options

* Add Graphics Options
This commit is contained in:
Edi316 authored and GitHub committed 2025-04-28 18:59:23 +02:00
1 parent f17635e075
commit 037e421bbb
8 files changed
+387 -21

No files matched your search

+1 -1
View File
@@ -452,7 +452,7 @@ namespace Vocaluxe.Base
case "TextureQuality":
return "TextureQuality: " + CHelper.ListStrings(Enum.GetNames(typeof(ETextureQuality)));
case "CoverSize":
return "CoverSize (pixels): 32, 64, 128, 256, 512, 1024 (default: 128)";
return "CoverSize (pixels): 32, 64, 128, 256, 512, 1024 (default: 512)";
case "NumScreens":
return "Number of screens to use. 1 - 6 (default: 1)";
case "ScreenW":
+13 -1
View File
@@ -90,6 +90,18 @@ namespace Vocaluxe
// Create data folder
Directory.CreateDirectory(CSettings.DataFolder);
// Delete CoverDB.sqlite if marker exists (cover size changed)
string flagPath = Path.Combine(CSettings.DataFolder, "DeleteCoverDB.flag");
string coverDbPath = Path.Combine(CSettings.DataFolder, CSettings.FileNameCoverDB);
if (File.Exists(flagPath))
{
if (File.Exists(coverDbPath))
File.Delete(coverDbPath); // Delete the database
File.Delete(flagPath); // Remove the marker so it doesn't repeat
}
// Init Log
CLog.Init(CSettings.FolderNameLogs,
CSettings.FileNameMainLog,
@@ -503,4 +515,4 @@ namespace Vocaluxe
return true;
}
}
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ namespace Vocaluxe.Screens
// Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion
{
get { return 2; }
get { return 3; }
}
private const string _ButtonOptionsBack = "ButtonOptionsBack";
+66 -5
View File
@@ -1,4 +1,4 @@
#region license
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
@@ -15,7 +15,9 @@
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Windows.Forms;
using System.IO;
using Vocaluxe.Base;
using VocaluxeLib;
using VocaluxeLib.Menu;
@@ -27,20 +29,28 @@ namespace Vocaluxe.Screens
// Version number for theme files. Increment it, if you've changed something on the theme files!
protected override int _ScreenVersion
{
get { return 2; }
get { return 3; }
}
private const string _SelectSlideLyricStyle = "SelectSlideLyricStyle";
private const string _SelectSlideLyricsPosition = "SelectSlideLyricsPosition";
private const string _SelectSlideTextureQuality = "SelectSlideTextureQuality";
private const string _SelectSlideCoverSize = "SelectSlideCoverSize";
private const string _SelectSlideFullScreen = "SelectSlideFullScreen";
private const string _SelectSlideStretch = "SelectSlideStretch";
private const string _TextWarningRestart = "TextWarningRestart";
private const string _StaticWarningRestart = "StaticWarningRestart";
private const string _ButtonExit = "ButtonExit";
private static readonly string[] CoverSizes = { "32", "64", "128", "256", "512", "1024" };
public override void Init()
{
base.Init();
_ThemeButtons = new string[] {_ButtonExit};
_ThemeSelectSlides = new string[] {_SelectSlideLyricStyle, _SelectSlideLyricsPosition};
_ThemeSelectSlides = new string[] {_SelectSlideLyricStyle, _SelectSlideLyricsPosition, _SelectSlideTextureQuality, _SelectSlideCoverSize, _SelectSlideFullScreen, _SelectSlideStretch};
_ThemeTexts = new string[] {_TextWarningRestart};
_ThemeStatics = new string[] {_StaticWarningRestart};
}
public override void LoadTheme(string xmlPath)
@@ -48,6 +58,22 @@ namespace Vocaluxe.Screens
base.LoadTheme(xmlPath);
_SelectSlides[_SelectSlideLyricStyle].SetValues<ELyricStyle>((int)CConfig.Config.Theme.LyricStyle);
_SelectSlides[_SelectSlideLyricsPosition].SetValues<ELyricsPosition>((int)CConfig.Config.Game.LyricsPosition);
_SelectSlides[_SelectSlideTextureQuality].SetValues<ETextureQuality>((int)CConfig.Config.Graphics.TextureQuality);
_SelectSlides[_SelectSlideCoverSize].AddValues(CoverSizes);
int currentCoverSize = CConfig.Config.Graphics.CoverSize;
int index = Array.IndexOf(CoverSizes, currentCoverSize.ToString());
_SelectSlides[_SelectSlideCoverSize].Selection = index;
_SelectSlides[_SelectSlideFullScreen].SetValues<EOffOn>((int)CConfig.Config.Graphics.FullScreen);
_SelectSlides[_SelectSlideFullScreen].Selection = (int)CConfig.Config.Graphics.FullScreen;
_SelectSlides[_SelectSlideStretch].SetValues<EOffOn>((int)CConfig.Config.Graphics.Stretch);
_SelectSlides[_SelectSlideStretch].Selection = (int)CConfig.Config.Graphics.Stretch;
_Texts[_TextWarningRestart].Visible = false;
_Statics[_StaticWarningRestart].Visible = false;
}
public override bool HandleInput(SKeyEvent keyEvent)
@@ -118,7 +144,42 @@ namespace Vocaluxe.Screens
{
CConfig.Config.Game.LyricsPosition = (ELyricsPosition)_SelectSlides[_SelectSlideLyricsPosition].Selection;
CConfig.Config.Theme.LyricStyle = (ELyricStyle)_SelectSlides[_SelectSlideLyricStyle].Selection;
// Detect Texture quality change
ETextureQuality _currentTextureQuality = CConfig.Config.Graphics.TextureQuality;
ETextureQuality _newTextureQuality = (ETextureQuality)_SelectSlides[_SelectSlideTextureQuality].Selection;
if (_currentTextureQuality != _newTextureQuality)
{
_Texts[_TextWarningRestart].Visible = true;
_Statics[_StaticWarningRestart].Visible = true;
CConfig.Config.Graphics.TextureQuality = _newTextureQuality;
}
else
{
CConfig.Config.Graphics.TextureQuality = _newTextureQuality;
}
// Detect Cover size change
string selectedValue = CoverSizes[_SelectSlides[_SelectSlideCoverSize].Selection];
int currentCoverSize = CConfig.Config.Graphics.CoverSize;
int newCoverSize = int.Parse(selectedValue);
if (currentCoverSize != newCoverSize)
{
string flagPath = Path.Combine(CSettings.DataFolder, "DeleteCoverDB.flag");
File.Create(flagPath).Dispose();
_Texts[_TextWarningRestart].Visible = true;
_Statics[_StaticWarningRestart].Visible = true;
CConfig.Config.Graphics.CoverSize = newCoverSize;
}
else
{
CConfig.Config.Graphics.CoverSize = newCoverSize;
}
CConfig.Config.Graphics.FullScreen = (EOffOn)_SelectSlides[_SelectSlideFullScreen].Selection;
CConfig.Config.Graphics.Stretch = (EOffOn)_SelectSlides[_SelectSlideStretch].Selection;
CConfig.SaveConfig();
}
}
}
}