Skip to content

Commit

Permalink
Added Remove Instance Button.
Browse files Browse the repository at this point in the history
Some minor Ux changes to make room for new button, and to make controls line up better
  • Loading branch information
harliq committed Feb 7, 2020
1 parent dab9e11 commit f31c282
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 30 deletions.
66 changes: 47 additions & 19 deletions AceCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ public class AceCreator : PluginBase
{
private ChatMessages cm = new ChatMessages();
public HudCombo ChoiceJSON { get; set; }
public HudButton CommandConvertJSON { get; set; }
public HudButton ButtonOpenJSON { get; set; }

public HudCombo ChoiceSQL { get; set; }
public HudButton CommandConvertSQL { get; set; }
public HudButton ButtonOpenSQL { get; set; }

public HudButton CommandConvertJSON { get; set; }
public HudButton ButtonOpenJSON { get; set; }

public HudButton CommandRefreshFilesList { get; set; }
public HudTextBox TextboxCreateWCID { get; set; }
public HudButton ButtonCreateWCID { get; set; }
public HudButton ButtonCreateInvWCID { get; set; }
Expand All @@ -47,11 +46,14 @@ public class AceCreator : PluginBase
public HudButton ButtonExportSQL { get; set; }
public HudButton ButtonYotesWCIDLookUp { get; set; }

public HudButton ButtonDeleteItem { get; set; }

public HudStaticText LabelGetInfo { get; set; }

public HudButton ButtonDeleteItem { get; set; }
public HudButton ButtonRemoveInstace { get; set; }
public HudButton CommandRefreshFilesList { get; set; }
public HudButton ButtonGetInfo { get; set; }


public HudTextBox TextBoxPathJSON { get; set; }
public HudTextBox TextBoxPathSQL { get; set; }
public HudButton ButtonSavePaths { get; set; }
Expand Down Expand Up @@ -118,6 +120,13 @@ public void LoadWindow()
// Content Tab
ChoiceJSON = (HudCombo)view["ChoiceJSON"];
ChoiceJSON.Change += new EventHandler(ChoiceJSON_Change);

CommandConvertJSON = view != null ? (HudButton)view["CommandConvertJSON"] : new HudButton();
CommandConvertJSON.Hit += new EventHandler(ButtonConvertJSON_Click);

ButtonOpenJSON = view != null ? (HudButton)view["ButtonOpenJSON"] : new HudButton();
ButtonOpenJSON.Hit += new EventHandler(ButtonOpenJSON_Click);

ChoiceSQL = (HudCombo)view["ChoiceSQL"];
ChoiceSQL.Change += new EventHandler(ChoiceSQL_Change);

Expand All @@ -127,15 +136,6 @@ public void LoadWindow()
ButtonOpenSQL = view != null ? (HudButton)view["ButtonOpenSQL"] : new HudButton();
ButtonOpenSQL.Hit += new EventHandler(ButtonOpenSQL_Click);

CommandConvertJSON = view != null ? (HudButton)view["CommandConvertJSON"] : new HudButton();
CommandConvertJSON.Hit += new EventHandler(ButtonConvertJSON_Click);

ButtonOpenJSON = view != null ? (HudButton)view["ButtonOpenJSON"] : new HudButton();
ButtonOpenJSON.Hit += new EventHandler(ButtonOpenJSON_Click);

CommandRefreshFilesList = view != null ? (HudButton)view["CommandRefreshFilesList"] : new HudButton();
CommandRefreshFilesList.Hit += new EventHandler(ButtonRefreshFilesList_Click);

TextboxCreateWCID = (HudTextBox)view["TextboxCreateWCID"];

ButtonCreateWCID = view != null ? (HudButton)view["ButtonCreateWCID"] : new HudButton();
Expand All @@ -157,16 +157,24 @@ public void LoadWindow()
ButtonExportSQL = view != null ? (HudButton)view["ButtonExportSQL"] : new HudButton();
ButtonExportSQL.Hit += new EventHandler(ButtonExportSQL_Click);

ButtonYotesWCIDLookUp = view != null ? (HudButton)view["ButtonYotesWCIDLookUp"] : new HudButton();
ButtonYotesWCIDLookUp.Hit += new EventHandler(ButtonYotesWCIDLookUp_Click);

LabelGetInfo = (HudStaticText)view["LabelGetInfo"];

ButtonRemoveInstace = view != null ? (HudButton)view["ButtonRemoveInstace"] : new HudButton();
ButtonRemoveInstace.Hit += new EventHandler(ButtonRemoveInstace_Click);

ButtonDeleteItem = view != null ? (HudButton)view["ButtonDeleteItem"] : new HudButton();
ButtonDeleteItem.Hit += new EventHandler(ButtonDeleteItem_Click);

ButtonYotesWCIDLookUp = view != null ? (HudButton)view["ButtonYotesWCIDLookUp"] : new HudButton();
ButtonYotesWCIDLookUp.Hit += new EventHandler(ButtonYotesWCIDLookUp_Click);
CommandRefreshFilesList = view != null ? (HudButton)view["CommandRefreshFilesList"] : new HudButton();
CommandRefreshFilesList.Hit += new EventHandler(ButtonRefreshFilesList_Click);

LabelGetInfo = (HudStaticText)view["LabelGetInfo"];
ButtonGetInfo = view != null ? (HudButton)view["ButtonGetInfo"] : new HudButton();
ButtonGetInfo.Hit += new EventHandler(ButtonGetInfo_Click);


// Paths Tab
TextBoxPathJSON = (HudTextBox)view["TextboxPathJSON"];
TextBoxPathSQL = (HudTextBox)view["TextboxPathSQL"];
Expand Down Expand Up @@ -463,6 +471,7 @@ public void ButtonDeleteItem_Click(object sender, EventArgs e)
{
try
{
Globals.ButtonCommand = "/delete";
WO = CoreManager.Current.WorldFilter[CoreManager.Current.Actions.CurrentSelection];
aceItem.name = WO.Name;
aceItem.id = WO.Id;
Expand Down Expand Up @@ -510,6 +519,24 @@ public void ButtonOpenSQL_Click(object sender, EventArgs e)
catch (Exception ex) { Util.LogError(ex); }

}
public void ButtonRemoveInstace_Click(object sender, EventArgs e)
{

try
{
Globals.ButtonCommand = "/removeinst";

WO = CoreManager.Current.WorldFilter[CoreManager.Current.Actions.CurrentSelection];
aceItem.name = WO.Name;
aceItem.id = WO.Id;

Globals.Host.Actions.RequestId(Globals.Host.Actions.CurrentSelection);
CoreManager.Current.WorldFilter.ChangeObject += DeleteItemWaitForItemUpdate;
}
catch (Exception ex) { Util.LogError(ex); }

}

// Methods
private void GetInfoWaitForItemUpdate(object sender, ChangeObjectEventArgs e)
{
Expand All @@ -530,8 +557,9 @@ private void DeleteItemWaitForItemUpdate(object sender, ChangeObjectEventArgs e)
{
if (e.Changed.Id == aceItem.id)
{
Util.SendChatCommand("/delete");
Util.SendChatCommand(Globals.ButtonCommand);
CoreManager.Current.WorldFilter.ChangeObject -= DeleteItemWaitForItemUpdate;
Globals.ButtonCommand = "NONE";
}
}
catch (Exception ex) { Util.LogError(ex); }
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.3.4")]
[assembly: AssemblyFileVersion("1.0.4.1")]
[assembly: AssemblyFileVersion("1.0.4.5")]
19 changes: 9 additions & 10 deletions mainView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<control progid="DecalControls.FixedLayout" clipped="">
<control progid="DecalControls.StaticText" name="LabelJson" left="10" top="5" width="256" height="15" text="Select JSON File"/>
<control progid="DecalControls.Choice" name="ChoiceJSON" left="5" top="25" width="340" height="20"/>
<control progid="DecalControls.PushButton" name="CommandConvertJSON" left="10" top="50" width="80" height="20" text="Import JSON"/>
<control progid="DecalControls.PushButton" name="ButtonOpenJSON" left="110" top="50" width="80" height="20" text="Edit JSON"/>
<control progid="DecalControls.PushButton" name="CommandConvertJSON" left="10" top="50" width="90" height="20" text="Import JSON"/>
<control progid="DecalControls.PushButton" name="ButtonOpenJSON" left="120" top="50" width="70" height="20" text="Edit JSON"/>
<control progid="DecalControls.StaticText" name="LabelSQL" left="10" top="80" width="256" height="15" text="Select SQL File"/>
<control progid="DecalControls.Choice" name="ChoiceSQL" left="5" top="100" width="340" height="20"/>
<control progid="DecalControls.PushButton" name="CommandConvertSQL" left="10" top="125" width="80" height="20" text="Import SQL"/>
<control progid="DecalControls.PushButton" name="ButtonOpenSQL" left="110" top="125" width="80" height="20" text="Edit SQL"/>
<control progid="DecalControls.PushButton" name="CommandConvertSQL" left="10" top="125" width="90" height="20" text="Import SQL"/>
<control progid="DecalControls.PushButton" name="ButtonOpenSQL" left="120" top="125" width="70" height="20" text="Edit SQL"/>

<control progid="DecalControls.StaticText" name="LabelWCID" left="10" top="176" width="35" height="15" text="WCID"/>
<control progid="DecalControls.Edit" name="TextboxCreateWCID" left="50" top="174" width="60" height="16" imageportalsrc="4726" text=""/>
Expand All @@ -21,18 +21,17 @@
<control progid="DecalControls.StaticText" name="LabelJsonExport" left="10" top="205" width="100" height="15" text="JSON Export"/>
<control progid="DecalControls.StaticText" name="LabelExportJsonWCID" left="10" top="226" width="35" height="15" text="WCID"/>
<control progid="DecalControls.Edit" name="TextboxExportJsonWCID" left="50" top="224" width="60" height="16" imageportalsrc="4726" text=""/>
<control progid="DecalControls.PushButton" name="ButtonExportJSON" left="120" top="220" width="80" height="20" text="Export JSON"/>
<control progid="DecalControls.PushButton" name="ButtonExportJSON" left="120" top="220" width="70" height="20" text="Export JSON"/>

<control progid="DecalControls.StaticText" name="LabelSqlExport" left="10" top="260" width="100" height="15" text="SQL Export"/>
<control progid="DecalControls.StaticText" name="LabelExportSqlWCID" left="10" top="281" width="35" height="15" text="WCID"/>
<control progid="DecalControls.Edit" name="TextboxExportSQLWCID" left="50" top="279" width="60" height="16" imageportalsrc="4726" text=""/>
<control progid="DecalControls.PushButton" name="ButtonExportSQL" left="120" top="275" width="80" height="20" text="Export SQL"/>
<control progid="DecalControls.PushButton" name="ButtonExportSQL" left="120" top="275" width="70" height="20" text="Export SQL"/>



<control progid="DecalControls.PushButton" name="ButtonYotesWCIDLookUp" left="215" top="275" width="135" height="20" text="Lookup Selected on Yotes"/>
<control progid="DecalControls.PushButton" name="ButtonYotesWCIDLookUp" left="210" top="275" width="140" height="20" text="Lookup Selected on Yotes"/>

<control progid="DecalControls.StaticText" name="LabelGetInfo" left="5" top="345" width="340" height="50" text=""/>
<control progid="DecalControls.StaticText" name="LabelGetInfo" left="5" top="310" width="340" height="50" text=""/>
<control progid="DecalControls.PushButton" name="ButtonRemoveInstace" left="10" top="355" width="100" height="20" text="Remove Instance"/>
<control progid="DecalControls.PushButton" name="ButtonDeleteItem" left="10" top="385" width="100" height="20" text="Delete Selected"/>
<control progid="DecalControls.PushButton" name="CommandRefreshFilesList" left="130" top="385" width="100" height="20" text="Refresh File Lists"/>
<control progid="DecalControls.PushButton" name="ButtonGetInfo" left="250" top="385" width="100" height="20" text="GetInfo"/>
Expand Down

0 comments on commit f31c282

Please sign in to comment.