Skip to content

Commit 0b0d2d2

Browse files
committed
去除金币,修复bug
1 parent 06e376b commit 0b0d2d2

File tree

7 files changed

+21
-84
lines changed

7 files changed

+21
-84
lines changed

TimeControl/AppController.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ public AppController(ListBox listBox, Timer timer)
2525
apps = TimeControlFile.ReadFromXML();
2626
}
2727
else
28+
{
2829
Directory.CreateDirectory(TimeControlFile.TimeFileDirectory);
30+
Save();
31+
}
2932
Refresh();
3033
}
3134

TimeControl/ControlPanel.Designer.cs

Lines changed: 12 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TimeControl/ControlPanel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public partial class ControlPanel : Form
2020
private bool isClosable = false;//指示当前是否可以关闭
2121
private string unlockPasswordHash = "";//密码哈希值,用作比对
2222
private AppController appController;//列表、计时控制器
23-
private GameController gameController;
2423
public ControlPanel(bool hide)
2524
{
2625
InitializeComponent();
@@ -37,7 +36,6 @@ public ControlPanel(bool hide)
3736

3837
appController = new(usageBox, processMonitorTimer);
3938
fileSaveTimer.Start();
40-
gameController = new(coinLabel);
4139

4240
if (File.Exists(TimeControlFile.WhiteAppLocation))
4341
whiteProcessBox.Text = File.ReadAllText(TimeControlFile.WhiteAppLocation);
@@ -67,7 +65,6 @@ private void StartLock(string unlockPasswordHash, string processLocation, int mi
6765
}).Wait();
6866
Dllimport.SwitchDesktop(nowDesktop);
6967
Dllimport.CloseDesktop(newDesktop);
70-
gameController.AddCoin(Convert.ToInt32(timeBox.Value) / 60);
7168
}
7269
private void NotifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)//打开界面
7370
{

TimeControl/GameController.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

TimeControl/Lock.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TimeControl/Lock.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public Lock(string unlockPasswordHash, string processLocation)
4343

4444
Init(unlockPasswordHash, processLocation);
4545
}
46-
private void Init(string unlockPasswordHash,string processLocation)
46+
private void Init(string unlockPasswordHash, string processLocation)
4747
{
4848
if (string.IsNullOrEmpty(unlockPasswordHash))
4949
{ usePassword = false; }
@@ -55,16 +55,15 @@ private void Init(string unlockPasswordHash,string processLocation)
5555
private void Timer_Tick(object sender, EventArgs e)
5656
{
5757
TimeSpan timeSpan = DateTime.Now - startTime;
58-
timeLabel.Text =
58+
timeLabel.Text =
5959
@$"{timeSpan.Hours}:{timeSpan.Minutes}:{timeSpan.Seconds}/{targetTimeSpan.Hours}:{targetTimeSpan.Minutes}:{targetTimeSpan.Seconds}";
60-
if(timeSpan>=targetTimeSpan)
60+
if (timeSpan >= targetTimeSpan)
6161
{
62-
timer.Stop();
6362
unlockLabel.Visible = true;
6463
progressBar.Value = progressBar.Maximum;
65-
return;
6664
}
67-
progressBar.Value = (int)timeSpan.TotalSeconds;
65+
else
66+
progressBar.Value = (int)timeSpan.TotalSeconds;
6867
Process[] processes = Process.GetProcessesByName("Taskmgr");
6968
foreach (Process process in processes)
7069
{

TimeControl/TimeControlFile.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public static class TimeControlFile
1616
public static readonly string WhiteAppLocation = BaseLocation + "\\WhiteApp.txt";//应用白名单保存
1717
public static readonly string TimeFileDirectory = BaseLocation
1818
+ "\\TCTimeData";
19-
public static readonly string GameData = BaseLocation + "\\GameData.txt";
2019
public static readonly string LogFile = BaseLocation + "\\Log.txt";
2120
public static readonly string TempTimeFile = BaseLocation + "\\Temp.txt";
2221
public static void SaveToXML(List<App> apps)

0 commit comments

Comments
 (0)