-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemEditor.cs
83 lines (77 loc) · 3.21 KB
/
ItemEditor.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BDO_Item_Sorter
{
public partial class ItemEditor : Form
{
int itemID = 0;
public ItemEditor()
{
InitializeComponent();
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
}
private void ItemEditor_Load(object sender, EventArgs e)
{
if (MainMenu.sessionActive == true)
catDrop.Enabled = false;
for (int i = 0; i < MainMenu.menuCategoriesIndex; i++)
catDrop.Items.Add(MainMenu.menuCategories[i]);
catDrop.SelectedIndex = MainMenu.menuCategoriesIndex - 1;
nameText.Text = null;
for (int row = 0; row < 8; row++)
{
for (int col = 0; col < 8; col++)
{
if (MainMenu.itemClicked[row, col] == true)
{
itemID = MainMenu.itemID[MainMenu.gridItemID[row, col]];
nameText.Text = MainMenu.itemName[itemID];
for (int i = 0; i < MainMenu.menuCategoriesIndex; i++)
{
if (MainMenu.menuCategories[i] == MainMenu.itemCategory[itemID])
{
catDrop.SelectedIndex = i;
break;
}
}
if (MainMenu.itemIgnored[itemID] == true)
ignoredBox.Checked = true;
if (MainMenu.itemProblematic[itemID] == true)
problematicBox.Checked = true;
break;
}
}
}
}
private void ItemEditor_FormClosed(object sender, FormClosedEventArgs e)
{
if (catDrop.SelectedIndex != -1)
MainMenu.lineEditor(Convert.ToString(itemID) + ',' + nameText.Text + ',' + catDrop.Text + ',' + Convert.ToString(ignoredBox.Checked) + ',' + Convert.ToString(problematicBox.Checked), Directory.GetCurrentDirectory() + "\\Item Attributions.csv", itemID);
else
MainMenu.lineEditor(Convert.ToString(itemID) + ',' + nameText.Text + ',' + "(none)" + ',' + Convert.ToString(ignoredBox.Checked) + ',' + Convert.ToString(problematicBox.Checked), Directory.GetCurrentDirectory() + "\\Item Attributions.csv", itemID);
}
private void doneButton_Click(object sender, EventArgs e)
{
this.Close();
}
private void ItemEditor_FormClosing(object sender, FormClosingEventArgs e)
{
if (nameText.Text.Contains(',') == true)
{
MessageBox.Show("The name cannot contain commas (\",\")!", "Illegal character", MessageBoxButtons.OK, MessageBoxIcon.Warning);
e.Cancel = true;
return;
}
}
}
}