Skip to content

Commit c5f1411

Browse files
committed
U can now change the time and the picture position
1 parent 9584836 commit c5f1411

3 files changed

Lines changed: 114 additions & 28 deletions

File tree

ThemePacker/MainForm.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public partial class ThemePacker : Form
2121
private string _path;
2222
private int _currentPic;
2323
private bool _isFolderBased;
24+
private OptionDialogBox _opb;
2425

2526
private EventHandler _btnNextClick;
2627

@@ -193,10 +194,11 @@ private void BtnLike_Click(object sender, EventArgs e)
193194

194195
private void BtnGenerate_Click(object sender, EventArgs e)
195196
{
196-
OptionDialogBox opb = new OptionDialogBox();
197-
opb.ShowDialog();
198-
opb.Focus();
199-
Generate();
197+
_opb = new OptionDialogBox();
198+
if (_opb.ShowDialog() == DialogResult.OK)
199+
{
200+
Generate();
201+
}
200202
}
201203

202204
public void Generate()
@@ -221,6 +223,9 @@ public void Generate()
221223
//read and replace
222224
string text = File.ReadAllText("temp\\super.theme");
223225
text = text.Replace("DisplayName=Tinderspirobot", "DisplayName=" + fileName);
226+
text = text.Replace("Interval=1000", "Interval=" + _opb.TimeChange);
227+
text = text.Replace("TileWallpaper=1", "TileWallpaper="+ _opb.TileWallpaper);
228+
text = text.Replace("WallpaperStyle=0", "WallpaperStyle=" + _opb.WallPaperStyle);
224229
File.WriteAllText("temp\\super.theme", text);
225230

226231
CabInfo cab = new CabInfo(saveFileDialog.FileName);

ThemePacker/OptionDialogBox.Designer.cs

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

ThemePacker/OptionDialogBox.cs

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.ComponentModel;
44
using System.Data;
5+
using System.Diagnostics;
56
using System.Drawing;
67
using System.Linq;
78
using System.Text;
@@ -12,6 +13,9 @@ namespace ThemePacker
1213
{
1314
public partial class OptionDialogBox : Form
1415
{
16+
public string TimeChange { get; private set; }
17+
public string TileWallpaper { get; private set; }
18+
public string WallPaperStyle { get; private set; }
1519
public OptionDialogBox()
1620
{
1721
InitializeComponent();
@@ -22,11 +26,74 @@ private void OptionDialogBox_Load(object sender, EventArgs e)
2226
this.MaximizeBox = false;
2327
this.MinimizeBox = false;
2428
this.FormBorderStyle = FormBorderStyle.FixedDialog;
29+
cbPicPos.SelectedItem = "Tile";
30+
cbTimeChange.SelectedItem = "1 minute";
2531
}
2632

2733
private void BtnGenerateFromDB_Click(object sender, EventArgs e)
2834
{
29-
35+
this.DialogResult = DialogResult.OK;
36+
this.Close();
37+
}
38+
39+
private void CbPicPos_SelectedIndexChanged(object sender, EventArgs e)
40+
{
41+
string wallpaper = cbPicPos.SelectedItem.ToString();
42+
switch (wallpaper)
43+
{
44+
case "Fill":
45+
TileWallpaper = "0";
46+
WallPaperStyle = "10";
47+
break;
48+
case "Fit":
49+
TileWallpaper = "0";
50+
WallPaperStyle = "6";
51+
break;
52+
case "Stretch":
53+
TileWallpaper = "0";
54+
WallPaperStyle = "2";
55+
break;
56+
case "Tile":
57+
TileWallpaper = "1";
58+
WallPaperStyle = "0";
59+
break;
60+
case "Center":
61+
TileWallpaper = "0";
62+
WallPaperStyle = "0";
63+
break;
64+
}
65+
}
66+
67+
private void CbTimeChange_SelectedIndexChanged(object sender, EventArgs e)
68+
{
69+
string time = cbTimeChange.SelectedItem.ToString();
70+
switch (time)
71+
{
72+
case "10 seconds":
73+
TimeChange = "10000";
74+
break;
75+
case "30 seconds":
76+
TimeChange = "30000";
77+
break;
78+
case "1 minute":
79+
TimeChange = "60000";
80+
break;
81+
case "5 minutes":
82+
TimeChange = "300000";
83+
break;
84+
case "10 minutes":
85+
TimeChange = "600000";
86+
break;
87+
case "20 minutes":
88+
TimeChange = "1200000";
89+
break;
90+
case "30 minutes":
91+
TimeChange = "1800000";
92+
break;
93+
case "1 hour":
94+
TimeChange = "3600000";
95+
break;
96+
}
3097
}
3198
}
3299
}

0 commit comments

Comments
 (0)