Skip to content

Commit

Permalink
Added two new options and related prompt message adjustments.
Browse files Browse the repository at this point in the history
1.Added CheatGridGroupRefreshThreshold and DisplayChangesListWhenSaving options.
*CheatGridGroupRefreshThreshold: To prevent excessive wait times during GroupRefresh, the GridView's GroupRefresh mechanism is activated only when the number of cheats is less than this value. Default is 10000.
*DisplayChangesListWhenSaving: Determines whether to display the list of change options when saving in Option windows. Default enabled.

2.Use a notification window instead of throwing an error when executing the Hex view or Add button in the Cheat window without a Process.

3.Corrected the save message after modifying options to "New settings have been saved."
  • Loading branch information
avan06 committed Dec 8, 2023
1 parent b43371c commit 678201e
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 16 deletions.
20 changes: 16 additions & 4 deletions PS4CheaterNeo/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public partial class Main : Form
private bool VerifySectionWhenLock;
private bool VerifySectionWhenRefresh;
private bool CheatAutoRefreshShowStatus;
private uint CheatGridGroupRefreshThreshold;

public class CheatRow
{
Expand Down Expand Up @@ -53,6 +54,7 @@ public Main()
AutoRefreshTimer.Interval = (int)Properties.Settings.Default.CheatAutoRefreshTimerInterval.Value;
VerifySectionWhenLock = Properties.Settings.Default.VerifySectionWhenLock.Value;
VerifySectionWhenRefresh = Properties.Settings.Default.VerifySectionWhenRefresh.Value;
CheatGridGroupRefreshThreshold = Properties.Settings.Default.CheatGridGroupRefreshThreshold.Value;
CheatGridView.GroupByEnabled = Properties.Settings.Default.CheatGridViewGroupByEnabled.Value;

Text += " " + Application.ProductVersion; //Assembly.GetExecutingAssembly().GetName().Version.ToString(); // Assembly.GetEntryAssembly().GetName().Version.ToString();
Expand Down Expand Up @@ -98,7 +100,7 @@ public void ApplyUI()
CheatGridViewLock.DefaultCellStyle.ForeColor = MainCheatGridCellForeColor; //Color.White;
CheatGridViewDescription.DefaultCellStyle.BackColor = MainCheatGridCellBackColor; //Color.FromArgb(64, 64, 64);
CheatGridViewDescription.DefaultCellStyle.ForeColor = MainCheatGridCellForeColor; //Color.White;
if (cheatGridRowList.Count < 100000 && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
if (cheatGridRowList.Count < CheatGridGroupRefreshThreshold && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
}
catch (Exception ex)
{
Expand Down Expand Up @@ -278,7 +280,7 @@ private void ToolStripOpen_Click(object sender, EventArgs e)
CheatGridViewRowCountUpdate();
}
}
if (cheatGridRowList.Count < 100000 && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
if (cheatGridRowList.Count < CheatGridGroupRefreshThreshold && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
CheatGridView.ResumeLayout();
SaveCheatDialog.FileName = OpenCheatDialog.FileName;
SaveCheatDialog.FilterIndex = OpenCheatDialog.FilterIndex;
Expand Down Expand Up @@ -660,6 +662,11 @@ private void ToolStripAdd_Click(object sender, EventArgs e)
}
catch (Exception ex)
{
if (ex.Message == "No Process currently")
{
InputBox.MsgBox("ToolStripAdd_Click", ex.Message, "Process isn't connected. Please connect first");
return;
}
MessageBox.Show(ex.ToString(), ex.Source + ":ToolStripAdd_Click", MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
}
Expand Down Expand Up @@ -710,6 +717,11 @@ private void ToolStripHexView_Click(object sender, EventArgs e)
}
catch (Exception ex)
{
if (ex.Message == "No Process currently")
{
InputBox.MsgBox("ToolStripHexView_Click", ex.Message, "Process isn't connected. Please connect first");
return;
}
MessageBox.Show(ex.ToString(), ex.Source + ":ToolStripHexView_Click", MessageBoxButtons.OK, MessageBoxIcon.Hand);
}
}
Expand Down Expand Up @@ -1231,7 +1243,7 @@ private void CheatGridView_CellContentClick(object sender, DataGridViewCellEvent
cheatGridRowList.RemoveAt(e.RowIndex);
CheatGridView.RowCount = cheatGridRowList.Count;
CheatGridView.Refresh();
if (cheatGridRowList.Count < 100000 && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
if (cheatGridRowList.Count < CheatGridGroupRefreshThreshold && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
CheatGridView.SuspendLayout();
break;
case (int)ChertCol.CheatListLock:
Expand Down Expand Up @@ -1529,7 +1541,7 @@ private void CheatGridMenuDelete_Click(object sender, EventArgs e)
CheatGridView.RowCount = cheatGridRowList.Count;
CheatGridView.VirtualMode = true;
CheatGridView.Refresh();
if (cheatGridRowList.Count < 100000 && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
if (cheatGridRowList.Count < CheatGridGroupRefreshThreshold && CheatGridView.GroupByEnabled) CheatGridView.GroupRefresh();
CheatGridView.ResumeLayout();
CheatGridView.CellValidating += CheatGridView_CellValidating;
rows = null;
Expand Down
4 changes: 2 additions & 2 deletions PS4CheaterNeo/Option.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Drawing;
using System.Drawing;
using System.Windows.Forms;

namespace PS4CheaterNeo
Expand All @@ -19,6 +18,7 @@ public Option(Main mainForm)
optionTreeView1.BackColor = Properties.Settings.Default.UiBackColor.Value;
optionTreeView1.ForeColorLeftView = Properties.Settings.Default.UiForeColor.Value;
optionTreeView1.BackColorLeftView = Properties.Settings.Default.UiBackColor.Value;
optionTreeView1.DisplayChangesListWhenSaving = Properties.Settings.Default.DisplayChangesListWhenSaving.Value;

optionTreeView1.InitSettings(Properties.Settings.Default);
}
Expand Down
4 changes: 2 additions & 2 deletions PS4CheaterNeo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,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("1.0.1.2")]
[assembly: AssemblyFileVersion("1.0.1.2")]
[assembly: AssemblyVersion("1.0.1.3")]
[assembly: AssemblyFileVersion("1.0.1.3")]
29 changes: 28 additions & 1 deletion PS4CheaterNeo/Properties/Settings.Designer.cs

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

6 changes: 6 additions & 0 deletions PS4CheaterNeo/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@
<Setting Name="CheatGridViewGroupByEnabled" Type="OptionTreeView.Option&lt;bool&gt;" Scope="User">
<Value Profile="(Default)">True|1_General|2_UI|Determines whether to enable the GroupByEnabled feature in CheatGridView. \nWhen enabled, Cheat items will be grouped. \nIf you have a large number of Cheat items, \nyou may consider disabling this feature to speed up Cheat loading. \nAfter setting this, you need to restart the program for it to take effect. \nDefault enabled</Value>
</Setting>
<Setting Name="CheatGridGroupRefreshThreshold" Type="OptionTreeView.Option&lt;uint&gt;" Scope="User">
<Value Profile="(Default)">10000|1_General|2_UI|To prevent excessive wait times during GroupRefresh, \nthe GridView's GroupRefresh mechanism is activated only when the number of cheats is less than this value. \nDefault is 10000.</Value>
</Setting>
<Setting Name="PS4DBGMutexFactor" Type="OptionTreeView.Option&lt;byte&gt;" Scope="User">
<Value Profile="(Default)">3|1_General|3_PS4Tool|It is not recommended to adjust this value, and changes take effect only after a restart. \nThe Mutex factor determines the number of connections that PS4DBG can occupy during initialization. \nFor ReadMemory, the number of connections is from 0 to (but not including) mutexFactor. \nFor WriteMemory, the number of connections is from mutexFactor to (but not including) 2*mutexFactor. \nDefault value is 3.</Value>
</Setting>
<Setting Name="DisplayChangesListWhenSaving" Type="OptionTreeView.Option&lt;bool&gt;" Scope="User">
<Value Profile="(Default)">True|1_General|4_Option|Determines whether to display the list of change options when saving in Option windows. \nDefault enabled</Value>
</Setting>
<Setting Name="CheatCellDirtyValueCommit" Type="OptionTreeView.Option&lt;bool&gt;" Scope="User">
<Value Profile="(Default)">True|2_Cheat|Cheat|Determine whether to automatically write to PS4 when editing cheat values in UpDown</Value>
</Setting>
Expand Down
16 changes: 13 additions & 3 deletions PS4CheaterNeo/common/InputBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public static void MsgBox(string title, string promptText, string value, int tex
form.Show();
}

public static DialogResult Show(string title, string promptText, ref string value, int textHeight = 20, InputBoxValidation validation = null, int boxWidth = 400, bool showCancelBtn = true, bool handleNewLine = true)
public static DialogResult Show(string title, string promptText, ref string value, int textHeight = 20, InputBoxValidation validation = null, int boxWidth = 400, bool showBtn = true, bool handleNewLine = true)
{
TextBox textBox = new TextBox();
Form form = CreateForm(title, promptText, value, textHeight, validation, boxWidth, showCancelBtn, handleNewLine, textBox);
Form form = CreateForm(title, promptText, value, textHeight, validation, boxWidth, showBtn, handleNewLine, textBox);
DialogResult dialogResult = form.ShowDialog();
value = textBox.Text;
return dialogResult;
Expand Down Expand Up @@ -69,6 +69,17 @@ private static Form CreateForm(string title, string promptText, string value, in
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
form.CancelButton = buttonCancel;
}
else
{
labelYOffset -= 28;
textBox.ReadOnly = true;
textBox.BackColor = Color.Silver;
}
if (textBox.Text != null)
{
textBox.SelectionStart = textBox.Text.Length;
textBox.ScrollToCaret();
}

form.ClientSize = new Size(boxWidth, textHeight + 55 + labelYOffset);
form.Controls.AddRange(new Control[] { label, textBox });
Expand All @@ -92,7 +103,6 @@ private static Form CreateForm(string title, string promptText, string value, in
}
};
}

return form;
}
}
Expand Down
Binary file modified PS4CheaterNeo/lib/OptionTreeView.dll
Binary file not shown.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PS4CheaterNeo is a program to find game cheat codes, and it is based on [`ps4debug`](https://github.com/jogolden/ps4debug) and [`.Net Framework 4.8`](https://support.microsoft.com/en-us/topic/microsoft-net-framework-4-8-offline-installer-for-windows-9d23f658-3b97-68ab-d013-aa3c3e7495e0).

Currently in `version 1.0.1.2`
Currently in `version 1.0.1.3`


## Table of Contents
Expand Down Expand Up @@ -87,15 +87,15 @@ Currently in `version 1.0.1.2`
> path\to\PS4CheaterNeo\payloads\ps4debug.bin
> path\to\PS4CheaterNeo\payloads\\[FW version]\ps4debug.bin
- It can be downloaded at the following URL(`Only ps4debug 6.72 has been tested`).
- It can be downloaded at the following URL(`Only ps4debug 6.72 and ctn123 version has been tested`).

> [ps4debug 5.05 by jogolden](https://github.com/jogolden/ps4debug/releases)
> [ps4debug 6.72 by GiantPluto](https://github.com/GiantPluto/ps4debug/releases)
> [ps4debug 7.02 by ChendoChap](https://github.com/ChendoChap/ps4debug/tags)
> [ps4debug 7.55 by Joonie86](https://github.com/Joonie86/ps4debug/releases)
> [ps4debug 9.00 by Karo](https://twitter.com/i/web/status/1471590847707856905)
> [ps4debug all firmware (5.0X, 6.72, 7.02, 7.5X, 9.00) by ctn123](https://github.com/ctn123/PS4_Cheater/releases/)
> [ps5debug Coded by ctn123 & SiSTRo](https://github.com/GoldHEN/ps5debug/releases)
> [ps4debug all firmware (5.0X, 6.72, 7.02, 7.5X, 9.00) by ctn123](https://github.com/ctn123/PS4_Cheater/releases/)
> [ps5debug Coded by ctn123 & SiSTRo](https://github.com/GoldHEN/ps5debug/releases)

## Cheat window [🔼](#table-of-contents)
Expand Down Expand Up @@ -524,8 +524,12 @@ Determines whether to enable `collapsible split container` ui in `Query and HexE
Determines the opacity of the window, the maximum is 1 (opaque), `Default is 0.95`. (0.9.7.7)
- `CheatGridViewGroupByEnabled`:
Determines whether to enable the GroupByEnabled feature in CheatGridView. When enabled, Cheat items will be grouped. If you have a large number of Cheat items, you may consider disabling this feature to speed up Cheat loading. After setting this, you need to restart the program for it to take effect. `Default enabled` (0.9.9.6)
- `CheatGridGroupRefreshThreshold`:
To prevent excessive wait times during GroupRefresh, the GridView's GroupRefresh mechanism is activated only when the number of cheats is less than this value. `Default is 10000`. (1.0.1.3)
- `PS4DBGMutexFactor`:
It is not recommended to adjust this value, and changes take effect only after a restart. The Mutex factor determines the number of connections that PS4DBG can occupy during initialization. For ReadMemory, the number of connections is from 0 to (but not including) mutexFactor. For WriteMemory, the number of connections is from mutexFactor to (but not including) 2*mutexFactor. `Default value is 3` (0.9.9.2)
- `DisplayChangesListWhenSaving`:
Determines whether to display the list of change options when saving in Option windows. `Default enabled`. (1.0.1.3)

### Cheat
- `CheatLock`:
Expand Down

0 comments on commit 678201e

Please sign in to comment.