-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
52 lines (46 loc) · 1.75 KB
/
Form1.cs
File metadata and controls
52 lines (46 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using SSXMultiTool.Utilities;
using SSXMultiTool.FileHandlers.LevelFiles.TrickyPS2;
namespace MiniLTGRebuilderForm
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void LTGRebuild_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog
{
Filter = "Map File (*.pbd)|*.pbd|All files (*.*)|*.*",
FilterIndex = 1,
RestoreDirectory = false
};
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog
{
Filter = "ltg File (*.ltg)|*.ltg|All files (*.*)|*.*",
FilterIndex = 1,
RestoreDirectory = false
};
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
PBDHandler pBDHandler = new PBDHandler();
pBDHandler.LoadPBD(openFileDialog.FileName);
LTGHandler handler = new LTGHandler();
handler.LoadLTG(openFileDialog1.FileName);
for (int i = 0; i < pBDHandler.Instances.Count; i++)
{
var TempInstance = pBDHandler.Instances[i];
TempInstance.LTGState = handler.FindIfInstaneState(i);
pBDHandler.Instances[i] = TempInstance;
}
handler.RegenerateLTG(pBDHandler);
handler.SaveLTGFile(openFileDialog1.FileName);
MessageBox.Show("LTG File Rebuilt");
}
}
}
}
}