2023-02-16 04:12:22 +00:00
|
|
|
|
using LibW4M.Data.Highscores;
|
|
|
|
|
using LibW4M.Data.Teams;
|
|
|
|
|
using LibW4M.Data.X;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace W4Gui.Tabs.VariablesTab
|
|
|
|
|
{
|
|
|
|
|
public partial class VectorVariablesTab : TabEntry
|
|
|
|
|
{
|
|
|
|
|
public VectorVariablesTab()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.variablesList.List.Selected += variablesList_Selected;
|
|
|
|
|
this.variablesList.List.Unselected += variablesList_Unselected;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SaveFromControl()
|
|
|
|
|
{
|
|
|
|
|
if (this.variablesList.List.IsItemSelected)
|
|
|
|
|
variablesList_Unselected(null, null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void LoadIntoControl()
|
|
|
|
|
{
|
|
|
|
|
this.variablesList.List.LoadArray(DataManager.SaveFile.XDataBank.VectorResourceDetails);
|
|
|
|
|
variablePanel.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void variablesList_Unselected(object? sender, EventArgs? e)
|
|
|
|
|
{
|
|
|
|
|
VectorResourceDetail variableData = DataManager.SaveFile.XDataBank.VectorResourceDetails[variablesList.List.LastSelected] as VectorResourceDetail;
|
|
|
|
|
variablePanel.SaveResourceData(ref variableData);
|
|
|
|
|
variablesList.List.UpdateName(variablesList.List.LastSelected, variableData.FriendlyName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void variablesList_Selected(object? sender, EventArgs? e)
|
|
|
|
|
{
|
|
|
|
|
VectorResourceDetail variableData = DataManager.SaveFile.XDataBank.VectorResourceDetails[variablesList.List.CurrentlySelected] as VectorResourceDetail;
|
|
|
|
|
variablePanel.LoadResourceData(variableData);
|
|
|
|
|
variablePanel.Enabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void variablesList_NewButton(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException("Adding new variables from here not implemented yet ;)");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void variablesList_DelButton(object sender, EventArgs e)
|
|
|
|
|
{
|
2023-03-07 07:49:53 +00:00
|
|
|
|
int sel = variablesList.List.CurrentlySelected;
|
|
|
|
|
VectorResourceDetail variableData = DataManager.SaveFile.XDataBank.VectorResourceDetails[sel] as VectorResourceDetail;
|
|
|
|
|
DataManager.SaveFile.XDataBank.Delete(variableData);
|
|
|
|
|
variablesList.List.Delete(sel);
|
2023-02-16 04:12:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|