Skip to content

Commit

Permalink
GUI: Add countdown setttings
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Dec 30, 2022
1 parent 47f827f commit e4b08af
Show file tree
Hide file tree
Showing 2 changed files with 232 additions and 3 deletions.
207 changes: 207 additions & 0 deletions GUI/PropertyWindow/PropertyWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions GUI/PropertyWindow/PropertyWindow.Games.cs
Expand Up @@ -17,28 +17,33 @@
using System.Threading;
using System.Windows.Forms;
using MCGalaxy.Games;
using MCGalaxy.Modules.Games.Countdown;
using MCGalaxy.Modules.Games.CTF;
using MCGalaxy.Modules.Games.LS;
using MCGalaxy.Modules.Games.ZS;
using MCGalaxy.Modules.Games.TW;

namespace MCGalaxy.Gui {
public partial class PropertyWindow : Form {
GamesHelper lsHelper, zsHelper, ctfHelper, twHelper;
namespace MCGalaxy.Gui
{
public partial class PropertyWindow : Form
{
GamesHelper lsHelper, zsHelper, ctfHelper, twHelper, cdHelper;

void LoadGameProps() {
string[] allMaps = LevelInfo.AllMapNames();
LoadZSSettings(allMaps);
LoadCTFSettings(allMaps);
LoadLSSettings(allMaps);
LoadTWSettings(allMaps);
LoadCDSettings(allMaps);
}

void SaveGameProps() {
SaveZSSettings();
SaveCTFSettings();
SaveLSSettings();
SaveTWSettings();
SaveCDSettings();
}

GamesHelper GetGameHelper(IGame game) {
Expand Down Expand Up @@ -282,6 +287,23 @@ public partial class PropertyWindow : Form {

twCurCfg.Save(twCurMap);
twHelper.UpdateMapConfig(twCurMap);
}


void LoadCDSettings(string[] allMaps) {
cdHelper = new GamesHelper(
CountdownGame.Instance, cd_cbStart, cd_cbMap, cd_cbMain,
cd_btnStart, cd_btnStop, cd_btnEnd,
cd_btnAdd, cd_btnRemove, cd_lstUsed, cd_lstNotUsed);
cdHelper.Load(allMaps);
}

void SaveCDSettings() {
try {
cdHelper.Save();
} catch (Exception ex) {
Logger.LogError("Error saving Countdown settings", ex);
}
}
}
}

0 comments on commit e4b08af

Please sign in to comment.