Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dhkim0800 committed May 17, 2019
0 parents commit 8fafdd1
Show file tree
Hide file tree
Showing 18 changed files with 4,077 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/PUBGSettingsCopier/bin
/.vs
/PUBGSettingsCopier/obj
25 changes: 25 additions & 0 deletions PUBGSettingsCopier.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.572
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PUBGSettingsCopier", "PUBGSettingsCopier\PUBGSettingsCopier.csproj", "{9D242979-E36F-4799-AAEC-9BCB8247623F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9D242979-E36F-4799-AAEC-9BCB8247623F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D242979-E36F-4799-AAEC-9BCB8247623F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D242979-E36F-4799-AAEC-9BCB8247623F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D242979-E36F-4799-AAEC-9BCB8247623F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {20D31D61-4137-4F43-8C69-69F8C27B1657}
EndGlobalSection
EndGlobal
21 changes: 21 additions & 0 deletions PUBGSettingsCopier/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="PUBGSettingsCopier.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<applicationSettings>
<PUBGSettingsCopier.Properties.Settings>
<setting name="isLuopis" serializeAs="String">
<value>False</value>
</setting>
<setting name="Version" serializeAs="String">
<value>1.1</value>
</setting>
</PUBGSettingsCopier.Properties.Settings>
</applicationSettings>
</configuration>
298 changes: 298 additions & 0 deletions PUBGSettingsCopier/Form1.Designer.cs

Large diffs are not rendered by default.

171 changes: 171 additions & 0 deletions PUBGSettingsCopier/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;

namespace PUBGSettingsCopier {
public partial class Form1 : Form {
public Form1() {
Properties.Settings.Default.Reload();
Properties.Settings.Default.Save();
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e) {
label6.Text = "";
panel1.BackColor = Color.FromArgb(219, 219, 219);
Text += " " + Properties.Settings.Default.Version;
if (Properties.Settings.Default.isLuopis) {
Button b = new Button();
b.Size = new Size(ClientSize.Width - 20, 30);
b.Location = new Point(10, ClientSize.Height - b.Height - 10);
b.Visible = true;
b.FlatStyle = FlatStyle.Flat;
b.BackColor = Color.Orange;
b.Font = new Font("맑은 고딕", 12, FontStyle.Bold);
b.Name = "LuopisButton";
b.Text = "배그 꿀팁&&정보&&유출 - 유튜브 루오피스 바로가기";
b.Click += new EventHandler(delegate (object sender2, EventArgs e2) {
Process.Start("https://www.youtube.com/luopis");
});
toolTip1.SetToolTip(b, "본 프로그램은 \"유튜브 루오피스\"와 함께합니다.");
b.Visible = true;
Console.WriteLine(b.Size + " " + b.Location);
Controls.Add(b);
}

//Styles
Color tmp = Color.FromArgb(50, 50, 50);
button1.ForeColor = Color.Black;
button2.ForeColor = Color.Black;
button1.FlatAppearance.BorderColor = tmp;
button2.FlatAppearance.BorderColor = tmp;
tmp = Color.FromArgb(16, 16, 16);
button3.FlatAppearance.BorderColor = tmp;
button1.FlatAppearance.BorderSize = 2;
button2.FlatAppearance.BorderSize = 2;
button3.FlatAppearance.BorderSize = 2;
tmp = Color.FromArgb(209, 209, 209);
button1.BackColor = tmp;
button2.BackColor = tmp;
tmp = Color.FromArgb(58, 58, 58);
button3.BackColor = tmp;
backColors.Add(button1, button1.BackColor);
backColors.Add(button2, button2.BackColor);
backColors.Add(button3, button3.BackColor);
}

private const string dtxt1 = "정상 작동!";
private const string dtxt2 = "배그 설정파일이 없어서 내보내기 불가";
private const string dtxt3 = "저장된 설정파일이 없어서 가져오기 불가";
private const string dtxt4 = "배그도 안 해봤고 저장도 안 해보셨네요.";
Dictionary<Button, Color> backColors = new Dictionary<Button, Color>();
private void Timer1_Tick(object sender, EventArgs e) {
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
path = path + @"\TslGame\Saved\Config\WindowsNoEditor\GameUserSettings.ini";
bool fe = File.Exists("GameSettings.ini");
if (File.Exists(path) && fe) {
button2.Enabled = true;
button2.BackColor = backColors[button2];
button1.Enabled = true;
button1.BackColor = backColors[button1];
label4.Text = dtxt1;
} else if (fe) {
button1.Enabled = false;
button1.BackColor = ControlPaint.Dark(backColors[button1]);
button2.Enabled = true;
button2.BackColor = backColors[button2];
label4.Text = dtxt2;
} else if (File.Exists(path)) {
button2.Enabled = false;
button2.BackColor = ControlPaint.Dark(backColors[button2]);
button1.Enabled = true;
button1.BackColor = backColors[button1];
label4.Text = dtxt3;
} else {
button1.Enabled = false;
button1.BackColor = ControlPaint.Dark(backColors[button1]);
button2.Enabled = false;
button2.BackColor = ControlPaint.Dark(backColors[button2]);
label4.Text = dtxt4;
}

button3.Enabled = fe;
if (fe) {
button3.BackColor = backColors[button3];
} else {
button3.BackColor = ControlPaint.Dark(backColors[button3]);
}
}

private void Button1_Click(object sender, EventArgs e) {
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
path = path + @"\TslGame\Saved\Config\WindowsNoEditor\GameUserSettings.ini";
try {
File.Copy(path, "GameSettings.ini", true);
label6.Text = "성공적으로 내보냈습니다!";
HandleMessage();
} catch (Exception ex) {
MessageBox.Show("파일 내보내기 중 오류가 발생하였습니다.\r\n오류 정보: " + ex.GetType().Name + " - " + ex.Message, "오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void Button2_Click(object sender, EventArgs e) {
string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
path = path + @"\TslGame\Saved\Config\WindowsNoEditor\GameUserSettings.ini";
try {
File.Copy("GameSettings.ini", path, true);
label6.Text = "성공적으로 가져왔습니다!";
HandleMessage();
} catch (Exception ex) {
MessageBox.Show("파일 가져오기 중 오류가 발생하였습니다.\r\n오류 정보: " + ex.GetType().Name + " - " + ex.Message, "오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void button3_Click(object sender, EventArgs e) {
try {
File.Delete("GameSettings.ini");
label6.Text = "성공적으로 삭제했습니다!";
HandleMessage();
} catch (Exception ex) {
MessageBox.Show("파일 삭제 중 오류가 발생하였습니다.\r\n오류 정보: " + ex.GetType().Name + " - " + ex.Message, "오류", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

long end = 0;
private void HandleMessage() {
if (end == 0) {
end = Environment.TickCount + 1500;
Thread trd = new Thread(new ThreadStart(delegate () {
//TODO
while (end > Environment.TickCount) ;
end = 0;
Invoke(new Action(delegate () {
label6.Text = "";
}));
}));
trd.IsBackground = true;
trd.Start();
} else {
end = Environment.TickCount + 1500;
}
}

private void button4_Click(object sender, EventArgs e) {
Form2 f2 = new Form2(Location);
f2.StartPosition = FormStartPosition.CenterScreen;
f2.ShowDialog();
}

private void panel1_MouseDown(object sender, MouseEventArgs e) {
Random r = new Random();
Func<int> fc = new Func<int>(delegate () {
return (int)(r.NextDouble() * 256);
});
panel1.BackColor = Color.FromArgb(fc(), fc(), fc());
}
}
}
Loading

0 comments on commit 8fafdd1

Please sign in to comment.