Skip to content

Commit

Permalink
Further cleaning files
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpmartell committed Aug 29, 2024
1 parent 2b7ac7c commit 79aafd6
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 69 deletions.
16 changes: 8 additions & 8 deletions LittleWarGameClient/GameForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ internal static GameForm Instance
internal const string baseUrl = @"https://littlewargame.com/play";
private readonly SettingsHandler settings;
private readonly KeyboardHandler kbHandler;
private readonly VersionHandler vHandler;
private readonly AudioHandler audioMngr;
private readonly VersionHandler versionHandler;
private readonly AudioHandler audioHandler;
private FormWindowState PreviousWindowState;

internal int requestCallCounter = 0;
Expand All @@ -38,9 +38,9 @@ internal GameForm()
InitializeComponent();
loadingText.Font = new Font(FontHandler.lwgFont, 48F, FontStyle.Regular, GraphicsUnit.Point);
settings = new SettingsHandler();
audioMngr = new AudioHandler(Text);
audioHandler = new AudioHandler(Text);
kbHandler = new KeyboardHandler(settings);
vHandler = new VersionHandler(settings);
versionHandler = new VersionHandler(settings);
InitScreen();
InitWebView();
}
Expand Down Expand Up @@ -224,7 +224,7 @@ private void GameForm_FormClosing(object sender, FormClosingEventArgs e)
e.Cancel = true;
break;
case CloseReason.UserClosing:
audioMngr.DestroySession();
audioHandler.DestroySession();
webBrowser.Dispose();
Application.Exit();
break;
Expand Down Expand Up @@ -264,12 +264,12 @@ internal void AddonsLoadedPostLogic()

internal void ChangeVolume(float value)
{
audioMngr.ChangeVolume(value);
audioHandler.ChangeVolume(value);
}

internal async void VolumeChangePostLogic(float value)
{
audioMngr.ChangeVolume(value);
audioHandler.ChangeVolume(value);
settings.SetVolume(value);
await settings.SaveAsync();
}
Expand All @@ -295,7 +295,7 @@ private void webView_LoadingStateChanged(object sender, LoadingStateChangedEvent
requestCallWhereLoadingFinished = requestCallCounter;
var addonJS = System.IO.File.ReadAllText("js/addons.js");
webBrowser.ExecuteScriptAsync(addonJS);
ElementMessage.CallJSFunc(webBrowser, "init.function", $"\"{vHandler.CurrentVersion}\", {settings.GetMouseLock().ToString().ToLower()}, {settings.GetVolume()}");
ElementMessage.CallJSFunc(webBrowser, "init.function", $"\"{versionHandler.CurrentVersion}\", {settings.GetMouseLock().ToString().ToLower()}, {settings.GetVolume()}");
kbHandler.InitHotkeyNames((ChromiumWebBrowser)sender, settings);
}
}
Expand Down
5 changes: 0 additions & 5 deletions LittleWarGameClient/Handlers/AudioHandler.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using NAudio.CoreAudioApi;
using NAudio.CoreAudioApi.Interfaces;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;

namespace LittleWarGameClient.Handlers
{
Expand Down
6 changes: 0 additions & 6 deletions LittleWarGameClient/Handlers/FontHandler.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using LittleWarGameClient.Properties;
using System;
using System.Collections.Generic;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static nud2dlib.Windows.Forms.Win32;

namespace LittleWarGameClient.Handlers
{
Expand Down
4 changes: 1 addition & 3 deletions LittleWarGameClient/Handlers/KeyboardHandler.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Reflection.Metadata;
using System.Reflection;
using System.Reflection;
using CefSharp.WinForms;
using CefSharp;
using LittleWarGameClient.Helpers;
Expand Down
6 changes: 0 additions & 6 deletions LittleWarGameClient/Handlers/SettingsHandler.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using IniFile;
using LittleWarGameClient.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;

namespace LittleWarGameClient.Handlers
{
Expand Down
12 changes: 1 addition & 11 deletions LittleWarGameClient/Handlers/VersionHandler.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
using CefSharp;
using Octokit;
using System;
using System.Collections.Generic;
using Octokit;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
using System.Net.Http;
using System.Reflection;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;

namespace LittleWarGameClient.Handlers
{
Expand Down
7 changes: 1 addition & 6 deletions LittleWarGameClient/Helpers/PanelHelper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Reflection;

namespace LittleWarGameClient.Helpers
{
Expand Down
5 changes: 0 additions & 5 deletions LittleWarGameClient/Helpers/SettingsHelper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using IniFile;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LittleWarGameClient.Helpers
{
Expand Down
10 changes: 4 additions & 6 deletions LittleWarGameClient/Properties/Resources.Designer.cs

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

6 changes: 3 additions & 3 deletions LittleWarGameClient/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="LcdSolidFont" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LcdSolid-VPzB.ttf;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
<value>..\Assets\LcdSolid-VPzB.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="soldier" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\soldier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Assets\soldier.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="wolfRunning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\wolfRunning.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Assets\wolfRunning.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file removed LittleWarGameClient/Resources/LcdSolid-VPzB.ttf
Binary file not shown.
Binary file removed LittleWarGameClient/Resources/soldier.png
Binary file not shown.
Binary file removed LittleWarGameClient/Resources/wolfRunning.gif
Binary file not shown.
11 changes: 1 addition & 10 deletions LittleWarGameClient/SplashScreen.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using LittleWarGameClient.Handlers;
using LittleWarGameClient.Handlers;

namespace LittleWarGameClient
{
Expand Down

0 comments on commit 79aafd6

Please sign in to comment.