-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathTabLandBlock.cs
121 lines (98 loc) · 3.72 KB
/
TabLandBlock.cs
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text.RegularExpressions;
using Decal.Adapter;
using Decal.Adapter.Wrappers;
using MyClasses.MetaViewWrappers;
using VirindiViewService;
using VirindiViewService.Controls;
namespace AceCreator
{
public partial class AceCreator : PluginBase
{
public HudCombo ChoiceLandblockJSON { get; set; }
public HudButton ButtonImportLandblockJSON { get; set; }
public HudButton ButtonEditLandblockJSON { get; set; }
public HudCombo ChoiceLandblockSQL { get; set; }
public HudButton ButtonImportLandblockSQL { get; set; }
public HudButton ButtonEditLandblockSQL { get; set; }
public HudButton ButtonReloadLandblock { get; set; }
public HudButton ButtonClearCache { get; set; }
public HudButton ButtonGetCurrentLandblock { get; set; }
public HudButton ButtonExportLandblock { get; set; }
public HudTextBox TextboxCurrentLandblock { get; set; }
// Button Events
public void ButtonImportLandblockJSON_Click(object sender, EventArgs e)
{
try
{
string wcid = ((HudStaticText)ChoiceLandblockJSON[ChoiceLandblockJSON.Current]).Text.Replace(".json", "");
Util.SendChatCommand(@"/import-json " + wcid + " landblock");
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonImportLandblockSQL_Click(object sender, EventArgs e)
{
try
{
string wcid = ((HudStaticText)ChoiceLandblockSQL[ChoiceLandblockSQL.Current]).Text.Replace(".sql", "");
Util.SendChatCommand(@"/import-sql " + wcid + " landblock");
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonEditLandblockJSON_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start(Globals.PathLandBlockJSON + @"\" + ((HudStaticText)ChoiceLandblockJSON[ChoiceLandblockJSON.Current]).Text);
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonEditLandblockSQL_Click(object sender, EventArgs e)
{
try
{
System.Diagnostics.Process.Start(Globals.PathLandBlockSQL + @"\" + ((HudStaticText)ChoiceLandblockSQL[ChoiceLandblockSQL.Current]).Text);
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonReloadLandblock_Click(object sender, EventArgs e)
{
try
{
Util.SendChatCommand("/reload-landblock");
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonClearCache_Click(object sender, EventArgs e)
{
try
{
Util.SendChatCommand("/clearcache");
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonGetCurrentLandblock_Click(object sender, EventArgs e)
{
Globals.ButtonCommand = "GetLandblock";
try
{
Util.SendChatCommand("/myloc");
}
catch (Exception ex) { Util.LogError(ex); }
}
public void ButtonExportLandblock_Click(object sender, EventArgs e)
{
try
{
Util.SendChatCommand("/export-sql landblock " + TextboxCurrentLandblock.Text);
}
catch (Exception ex) { Util.LogError(ex); }
LoadLandBlockJSONChoiceList();
LoadLandBlockSQLChoiceList();
}
}
}