Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Created class to manage all properties (Globals.cs),
Browse files Browse the repository at this point in the history
Hotfixed Minimise bug where if minimise after redemption was enabled then you couldn't bring SMITE to the foreground.
  • Loading branch information
Lumbridge committed Apr 8, 2018
1 parent 123198a commit 43a735b
Show file tree
Hide file tree
Showing 81 changed files with 247 additions and 98 deletions.
Binary file modified .vs/MixerSmiteCodeRedeemer/v14/.suo
Binary file not shown.
Binary file modified Dolphin Script/bin/Debug/DolphinScript.dll
Binary file not shown.
Binary file modified Dolphin Script/bin/Debug/DolphinScript.pdb
Binary file not shown.
Binary file modified Dolphin Script/bin/Release/DolphinScript.dll
Binary file not shown.
Binary file modified Dolphin Script/bin/Release/DolphinScript.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ C:\Users\Ry208444\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Debug\D
C:\Users\Ry208444\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Debug\Dolphin Script.csproj.CoreCompileInputs.cache
C:\Users\Ry208444\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Debug\DolphinScript.dll
C:\Users\Ry208444\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Debug\DolphinScript.pdb
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Debug\Dolphin Script.csprojResolveAssemblyReference.cache
Binary file not shown.
Binary file modified Dolphin Script/obj/Debug/DolphinScript.dll
Binary file not shown.
Binary file modified Dolphin Script/obj/Debug/DolphinScript.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Release\Do
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Release\Dolphin Script.csproj.GenerateResource.Cache
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Release\DolphinScript.dll
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Release\DolphinScript.pdb
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\Dolphin Script\obj\Release\Dolphin Script.csprojResolveAssemblyReference.cache
Binary file not shown.
Binary file modified Dolphin Script/obj/Release/DolphinScript.dll
Binary file not shown.
Binary file modified Dolphin Script/obj/Release/DolphinScript.pdb
Binary file not shown.
Binary file not shown.
Binary file modified MixerChatAPI/bin/Debug/MixerChat.dll
Binary file not shown.
Binary file modified MixerChatAPI/bin/Debug/MixerChat.pdb
Binary file not shown.
Binary file modified MixerChatAPI/bin/Release/MixerChat.dll
Binary file not shown.
Binary file modified MixerChatAPI/bin/Release/MixerChat.pdb
Binary file not shown.
Binary file modified MixerChatAPI/obj/Debug/MixerChat.dll
Binary file not shown.
Binary file modified MixerChatAPI/obj/Debug/MixerChat.pdb
Binary file not shown.
Binary file modified MixerChatAPI/obj/Release/MixerChat.dll
Binary file not shown.
Binary file modified MixerChatAPI/obj/Release/MixerChat.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\MixerChatAPI\bin\Release\WebS
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\MixerChatAPI\bin\Release\Newtonsoft.Json.xml
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\MixerChatAPI\obj\Release\MixerChat.dll
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\MixerChatAPI\obj\Release\MixerChat.pdb
C:\Users\ryans\Source\Repos\SmiteMixerCodeRedeemer\MixerChatAPI\obj\Release\MixerChatAPI.csprojResolveAssemblyReference.cache
Binary file modified SmiteMixerCodeGrabberCLI/bin/Debug/DolphinScript.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Debug/DolphinScript.pdb
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Debug/MixerChat.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Debug/MixerChat.pdb
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Debug/SmiteMixerListener.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Debug/SmiteMixerListener.pdb
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Release/DolphinScript.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Release/DolphinScript.pdb
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Release/MixerChat.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Release/MixerChat.pdb
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Release/SmiteMixerListener.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/bin/Release/SmiteMixerListener.pdb
Binary file not shown.
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/obj/Debug/SmiteMixerListener.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/obj/Debug/SmiteMixerListener.pdb
Binary file not shown.
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/obj/Release/SmiteMixerListener.dll
Binary file not shown.
Binary file modified SmiteMixerCodeGrabberCLI/obj/Release/SmiteMixerListener.pdb
Binary file not shown.
3 changes: 3 additions & 0 deletions SmiteMixerCodeGrabberGUI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<setting name="minimiseAfterRedeeming" serializeAs="String">
<value>False</value>
</setting>
<setting name="shouldMinimise" serializeAs="String">
<value>False</value>
</setting>
</SmiteMixerCodeGrabberGUI.Properties.Settings>
</userSettings>
</configuration>
34 changes: 26 additions & 8 deletions SmiteMixerCodeGrabberGUI/Classes/Automation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,33 @@
using static DolphinScript.Lib.Backend.WindowControl;

using static SmiteMixerCodeGrabberGUI.Classes.AllCodes;
using static SmiteMixerCodeGrabberGUI.Classes.Globals;

namespace SmiteMixerCodeGrabberGUI.Classes
{
class Automation
{
public static void RedeemSingle(SmiteCode sc)
public static void RedeemSingle(SmiteCode code)
{
// get the event list and pass it the code we want it to type
//
var loop = GetRedeemLoop(sc.GetCode());
var loop = GetRedeemLoop(code.GetCode());

foreach (var ev in loop)
if(IsRunning)
ev.DoEvent();

if(IsRunning)
sc.SetIsRedeemed(true);
if (IsRunning)
{
code.SetIsRedeemed(true);
shouldMinimise = true;
}

if (minimiseAfterRedeeming && shouldMinimise)
{
MinimiseSMITEClient();
shouldMinimise = false;
}
}

public static void RedeemAllActive()
Expand All @@ -40,10 +50,18 @@ public static void RedeemAllActive()
if(IsRunning)
ev.DoEvent();

if(IsRunning)
if (IsRunning)
{
code.SetIsRedeemed(true);
shouldMinimise = true;
}
}
}
if (minimiseAfterRedeeming && shouldMinimise)
{
MinimiseSMITEClient();
shouldMinimise = false;
}
}

[STAThread]
Expand All @@ -52,7 +70,7 @@ public static List<ScriptEvent> GetRedeemLoop(string code)
System.Windows.Forms.Clipboard.SetText("/claimpromotion " + code);
List<ScriptEvent> SlowTypingScript = new List<ScriptEvent>()
{
new MouseMoveToAreaOnWindow() { ClickArea = new RECT(), WindowToClickTitle = Properties.Settings.Default.smiteWindowTitle },
new MouseMoveToAreaOnWindow() { ClickArea = new RECT(), WindowToClickTitle = smiteWindowTitle },
GetPause(1.0, 1.5),
GetEnterKeyClick(),
GetPause(1.0, 1.5),
Expand All @@ -68,7 +86,7 @@ public static List<ScriptEvent> GetRedeemLoop(string code)

static MoveWindowToFront GetMoveWindowToFront()
{
return new MoveWindowToFront() { WindowToClickTitle = Properties.Settings.Default.smiteWindowTitle };
return new MoveWindowToFront() { WindowToClickTitle = smiteWindowTitle };
}

static RandomPauseInRange GetPause(double min, double max)
Expand All @@ -78,7 +96,7 @@ static RandomPauseInRange GetPause(double min, double max)

static MouseMoveToAreaOnWindow GetMouseMoveToWindow(RECT clickArea)
{
return new MouseMoveToAreaOnWindow() { ClickArea = clickArea, WindowToClickTitle = Properties.Settings.Default.smiteWindowTitle };
return new MouseMoveToAreaOnWindow() { ClickArea = clickArea, WindowToClickTitle = smiteWindowTitle };
}

static MouseClick GetLeftMouseClick()
Expand Down
93 changes: 93 additions & 0 deletions SmiteMixerCodeGrabberGUI/Classes/Globals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SmiteMixerCodeGrabberGUI.Classes
{
class Globals
{
public static bool AFKMode { get; set; }
public static bool shouldMinimise { get; set; }
public static string smiteWindowTitle { get; set; }

public static bool notificationSetting
{
get { return Properties.Settings.Default.notificationSetting; }
set
{
Properties.Settings.Default.notificationSetting = value;
SaveSettings();
}
}
public static bool whitelistOnly
{
get { return Properties.Settings.Default.whitelistOnly; }
set
{
Properties.Settings.Default.whitelistOnly = value;
SaveSettings();
}
}
public static int codeLength
{
get { return Properties.Settings.Default.codeLength; }
set
{
Properties.Settings.Default.codeLength = value;
SaveSettings();
}
}
public static string codesStartWith
{
get { return Properties.Settings.Default.codesStartWith; }
set
{
Properties.Settings.Default.codesStartWith = value;
SaveSettings();
}
}
public static System.Collections.Specialized.StringCollection whitelistedUsernames
{
get { return Properties.Settings.Default.whitelistedUsernames; }
set
{
Properties.Settings.Default.whitelistedUsernames = value;
SaveSettings();
}
}
public static string notificationSoundFilePath
{
get { return Properties.Settings.Default.notificationSoundFilePath; }
set
{
Properties.Settings.Default.notificationSoundFilePath = value;
SaveSettings();
}
}
public static bool notificationSound
{
get { return Properties.Settings.Default.notificationSound; }
set
{
Properties.Settings.Default.notificationSound = value;
SaveSettings();
}
}
public static bool minimiseAfterRedeeming
{
get { return Properties.Settings.Default.minimiseAfterRedeeming; }
set
{
Properties.Settings.Default.minimiseAfterRedeeming = value;
SaveSettings();
}
}

private static void SaveSettings()
{
Properties.Settings.Default.Save();
}
}
}
2 changes: 1 addition & 1 deletion SmiteMixerCodeGrabberGUI/Classes/MetaInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace SmiteMixerCodeGrabberGUI.Classes
{
public static class MetaInfo
{
public static string Version = "v1.0.7";
public static string Version = "v1.0.7.1";

public static string GetMetaInfoConsole()
{
Expand Down
2 changes: 1 addition & 1 deletion SmiteMixerCodeGrabberGUI/MainForm.Designer.cs

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

Loading

0 comments on commit 43a735b

Please sign in to comment.