Skip to content

Commit

Permalink
Merge branch 'alpha16'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbnq committed Sep 15, 2024
2 parents f825780 + 0583392 commit a13dc52
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 29 deletions.
5 changes: 3 additions & 2 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static class Program
{
public static mbCrosshair mainCrosshair;
public static int mbFrameDelay = 16; // in ms, for glass hud, default 60fps
public static float mbVersion = 0.080f;
public static float mbVersion = 0.082f;

[DllImport("user32.dll")]
static extern bool SetProcessDPIAware();
Expand Down Expand Up @@ -56,6 +56,7 @@ static void Main()
// Update the main display after settings have loaded
controlPanel.updateMainCrosshair();

// trigger autosave
controlPanel.FormClosing += (sender, e) =>
{
if (controlPanel.AutoSaveOnExitChecked)
Expand All @@ -64,7 +65,7 @@ static void Main()
}
};

Application.Run(controlPanel); // This will run the main display and overlay together
Application.Run(controlPanel);
}
}
}
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.7.8")]
[assembly: AssemblyFileVersion("0.0.7.8")]
[assembly: AssemblyVersion("0.0.8.2")]
[assembly: AssemblyFileVersion("0.0.8.2")]
9 changes: 9 additions & 0 deletions RED.mbnq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,12 @@
<Compile Include="core\mbControlPanel.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="core\mbAboutForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="core\mbAboutForm.Designer.cs">
<DependentUpon>mbAboutForm.cs</DependentUpon>
</Compile>
<Compile Include="glass\glassControls.cs" />
<Compile Include="glass\glassRmbMenu.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -278,6 +284,9 @@
<Compile Include="core\mbSaveLoad.cs" />
<Compile Include="core\mbSounds.cs" />
<Compile Include="core\mbZoomMode.cs" />
<EmbeddedResource Include="core\mbAboutForm.resx">
<DependentUpon>mbAboutForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
Expand Down
37 changes: 37 additions & 0 deletions core/mbAboutForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

/*
www.mbnq.pl 2024
https://mbnq.pl/
mbnq00 on gmail
*/

using System;
using System.Diagnostics;

namespace RED.mbnq.core
{
public partial class mbAboutForm : MaterialSkin.Controls.MaterialForm
{
public mbAboutForm()
{
var materialSkinManager = MaterialSkin.MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);

this.FormClosing += (sender, e) => Sounds.PlayClickSoundOnce();

InitializeAboutForm();
}
private void materialLabel5_Click(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo("https://www.mbnq.pl") { UseShellExecute = true });
Sounds.PlayClickSoundOnce();
}
private void materialLabel6_Click(object sender, EventArgs e)
{
Process.Start(new ProcessStartInfo("https://github.com/mbnq/red.pro") { UseShellExecute = true });
Sounds.PlayClickSoundOnce();
}
}
}
47 changes: 23 additions & 24 deletions core/mbControlPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mbnq00 on gmail
using System.Runtime.InteropServices;
using System.Net.Http;
using System.Security.Cryptography.X509Certificates;
using RED.mbnq.core;

namespace RED.mbnq
{
Expand All @@ -30,7 +31,7 @@ public class ControlPanel : MaterialSkin.Controls.MaterialForm
public bool mHideCrosshair = false;
public int mSettingsLoaded = 0;

private Button centerButton, loadChangePngButton, removePngButton;
private Button centerButton, loadChangePngButton, removePngButton, debugTestButton;
private FlowLayoutPanel mbPanelForTab1, mbPanelForTab2, mbPanelForTab3;
private TabPage mbTab1, mbTab2, mbTab3;
private CheckBox mbAutoSaveCheckbox, mbDebugonCheckbox, mbAOnTopCheckBox, mbHideCrosshairCheckBox, mbDisableSoundCheckBox, mbEnableZoomModeCheckBox, mbEnableFlirCheckBox, mbDarkModeCheckBox, mbAntiCapsCheckBox;
Expand All @@ -43,7 +44,7 @@ public class ControlPanel : MaterialSkin.Controls.MaterialForm
public MaterialSlider colorR, colorG, colorB, size, transparency, offsetX, offsetY, zoomLevel;
public mbProgressBar mbProgressBar0;
public mbCrosshair mbCrosshairDisplay;
public string mbMaterialThemeType;
public static string mbMaterialThemeType;

public string mbUserFilesPath = Path.Combine(SaveLoad.SettingsDirectory);

Expand All @@ -66,7 +67,6 @@ public class ControlPanel : MaterialSkin.Controls.MaterialForm
#region ControlPanel Init
public ControlPanel()
{
InitializeTabs();
InitializeComponent();
UpdateButtons();

Expand Down Expand Up @@ -218,13 +218,14 @@ private void ControlPanel_Shown(object sender, EventArgs e)
}
#endregion

#region Tabs

/* --- --- Tabs --- --- */

private void InitializeTabs()
#region GUI
private void InitializeComponent()
{
mControlWidth = this.ClientSize.Width - mControlDefSpacer;
// -------------------------------------------------------

#region Tabs
/* --- --- Tabs --- --- */
mbTabControl = new MaterialTabControl
{
Dock = DockStyle.Fill, // we need this
Expand Down Expand Up @@ -262,15 +263,7 @@ private void InitializeTabs()
tab.Text = tab.Text.ToUpper();
}

}

#endregion

#region GUI
private void InitializeComponent()
{
mControlWidth = this.ClientSize.Width - mControlDefSpacer;
// -------------------------------------------------------
#endregion

#region FlowLayoutPanels

Expand Down Expand Up @@ -330,6 +323,7 @@ Button CreateButton(string buttonText, int width, EventHandler clickHandler)
centerButton = CreateButton("Center", mControlWidth, CenterButton_Click);
loadChangePngButton = CreateButton("Load PNG", mControlWidth, loadChangePngButton_Click);
removePngButton = CreateButton("Remove PNG", mControlWidth, removePngButton_Click);
debugTestButton = CreateButton("Debug Test", mControlWidth, debugTestButton_Click); debugTestButton.Visible = true;

// Add the buttons to the respective panels
mbPanelForTab1.Controls.Add(centerButton);
Expand Down Expand Up @@ -418,19 +412,15 @@ void mbSysDropDown_SelectedIndexChanged(object sender, EventArgs e)
}
}
}


// ---


mbMbToolsDropDown = new MaterialComboBox
{
Width = (mCPWidth - (mControlDefSpacer / 2) + 3),
DropDownStyle = ComboBoxStyle.DropDownList,
MaxDropDownItems = 10
};


mbMbToolsDropDown.Items.Add("Test Ping");
mbMbToolsDropDown.Items.Add("My IP");
mbMbToolsDropDown.Items.Add("Verify System Files");
Expand Down Expand Up @@ -470,7 +460,6 @@ void mbMbToolsDropDown_SelectedIndexChanged(object sender, EventArgs e)
}
}


// ---

mbPanelForTab3.Controls.Add(new MaterialSkin.Controls.MaterialLabel { Text = "System Tools:", AutoSize = true, Margin = new Padding(0, 10, 0, 10) });
Expand Down Expand Up @@ -510,7 +499,7 @@ MaterialSwitch CreateCheckBox(string text, bool isEnabled, EventHandler checkedC
mbAutoSaveCheckbox = CreateCheckBox("Save on Exit", true, mbAutoSaveOnExit_CheckedChanged);
mbDebugonCheckbox = CreateCheckBox("Debug", true, mbDebugonCheckbox_CheckedChanged);
mbAOnTopCheckBox = CreateCheckBox("Always on Top", true, mbAOnTopCheckBox_CheckedChanged);
mbHideCrosshairCheckBox = CreateCheckBox("Crosshair", true, mbHideCrosshairCheckBox_CheckedChanged);
mbHideCrosshairCheckBox = CreateCheckBox("Hide Crosshair", true, mbHideCrosshairCheckBox_CheckedChanged);
mbDisableSoundCheckBox = CreateCheckBox("Sounds", true, mbDisableSoundCheckBox_CheckedChanged);
mbEnableZoomModeCheckBox = CreateCheckBox("Sniper Mode", true, mbEnableZoomModeCheckBox_CheckedChanged);
mbEnableFlirCheckBox = CreateCheckBox("FLIR", mbnqFLIR.mbEnableFlirLogic, mbEnableFlirCheckBox_CheckedChanged);
Expand Down Expand Up @@ -563,6 +552,9 @@ MaterialSwitch CreateCheckBox(string text, bool isEnabled, EventHandler checkedC
mbPanelForTab2.Controls.Add(mbAOnTopCheckBox);
mbPanelForTab2.Controls.Add(mbAutoSaveCheckbox);
mbPanelForTab2.Controls.Add(mbDebugonCheckbox);

mbPanelForTab2.Controls.Add(debugTestButton);

mbTab2.Controls.Add(mbPanelForTab2);

/* --- --- --- Tab 3 goes here --- --- --- */
Expand Down Expand Up @@ -892,6 +884,7 @@ private void mbTestPing_Click(object sender, EventArgs e)
/* --- --- --- Buttons Code --- --- --- */
public void UpdateButtons()
{
if (mIsDebugOn) { debugTestButton.Visible = true; } else { debugTestButton.Visible = false; }
removePngButton.Enabled = File.Exists(Path.Combine(SaveLoad.SettingsDirectory, "RED.custom.png"));
}

Expand Down Expand Up @@ -971,6 +964,11 @@ private void removePngButton_Click(object sender, EventArgs e)
Sounds.PlayClickSoundOnce();
UpdateButtons();
}
private void debugTestButton_Click(object sender, EventArgs e)
{
Sounds.PlayClickSoundOnce();
UpdateButtons();
}

#endregion

Expand All @@ -989,10 +987,12 @@ private void mbDebugonCheckbox_CheckedChanged(object sender, EventArgs e)
if (mbDebugonCheckbox.Checked)
{
mIsDebugOn = true;
UpdateButtons();
}
else
{
mIsDebugOn = false;
UpdateButtons();
}
}
private void mbAOnTopCheckBox_CheckedChanged(object sender, EventArgs e)
Expand Down Expand Up @@ -1342,7 +1342,6 @@ public bool mbAntiCapsCheckBoxChecked
get => mbAntiCapsCheckBox.Checked;
set => mbAntiCapsCheckBox.Checked = value;
}

public int ColorRValue { get => colorR.Value; set => colorR.Value = value; }
public int ColorGValue { get => colorG.Value; set => colorG.Value = value; }
public int ColorBValue { get => colorB.Value; set => colorB.Value = value; }
Expand Down
9 changes: 8 additions & 1 deletion core/mbRmbMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ mbnq00 on gmail
*/

using MaterialSkin.Controls;
using RED.mbnq.core;
using System;
using System.Diagnostics;
using System.Drawing.Text;
using System.IO;
using System.Windows.Forms;

Expand Down Expand Up @@ -105,7 +107,12 @@ private void NewCaptureRegionMenuItem_Click(object sender, EventArgs e)
}
private void saveMenuItem_Click(object sender, EventArgs e) => SaveLoad.SaveSettings(controlPanel, false);
private void loadMenuItem_Click(object sender, EventArgs e) => SaveLoad.LoadSettings(controlPanel, false);
private void AboutMenuItem_Click(object sender, EventArgs e) => Process.Start(new ProcessStartInfo("https://www.mbnq.pl") { UseShellExecute = true });
private void AboutMenuItem_Click(object sender, EventArgs e)
{
mbAboutForm aboutBox = new mbAboutForm();
aboutBox.Show();
// Process.Start(new ProcessStartInfo("https://www.mbnq.pl") { UseShellExecute = true });
}
private void CloseMenuItem_Click(object sender, EventArgs e) => Application.Exit();
public void LoadCustomPNG_Click(object sender, EventArgs e)
{
Expand Down

0 comments on commit a13dc52

Please sign in to comment.