This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapWarpDoorToolForm.cs
100 lines (80 loc) · 2.74 KB
/
MapWarpDoorToolForm.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
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace LEdit
{
public partial class MapWarpDoorToolForm : Form
{
MapEditForm parent;
L2MapHeader.WarpDoor door;
public L2MapHeader.WarpDoor WarpDoor { get { return door; } }
public MapWarpDoorToolForm(MapEditForm parent_window, L2MapHeader.WarpDoor warp_door)
{
InitializeComponent();
parent = parent_window;
door = warp_door;
cbDestMap.Items.Clear();
cbDestMap.Items.Add("0xFF - (diese)");
for (int i = 0; i < L2MapHeader.Count; i++)
cbDestMap.Items.Add("0x" + i.ToString("X2") + " - " + L2MapHeader.Get(i).Name.Value);
numX1.Value = door.x1;
numX2.Value = door.x2;
numY1.Value = door.y1;
numY2.Value = door.y2;
numericUpDown1.Value = door.unknown;
numDestX.Value = door.dest_x;
numDestY.Value = door.dest_y;
if (door.dest_map == 255)
cbDestMap.SelectedIndex = 0;
else
cbDestMap.SelectedIndex = door.dest_map + 1;
this.Text = "Warp-Tür 0x" + door.id.ToString("X2");
}
private void MapWarpDoorToolForm_Load(object sender, EventArgs e)
{
}
private void Apply()
{
door.x1 = (byte)numX1.Value;
door.y1 = (byte)numY1.Value;
door.x2 = (byte)numX2.Value;
door.y2 = (byte)numY2.Value;
door.unknown = (byte)numericUpDown1.Value;
door.dest_x = (byte)numDestX.Value;
door.dest_y = (byte)numDestY.Value;
if (cbDestMap.SelectedIndex == 0)
door.dest_map = 255;
else
door.dest_map = (byte)(cbDestMap.SelectedIndex - 1);
parent.RefreshView();
}
private void button1_Click(object sender, EventArgs e)
{
Apply();
}
private void MapWarpDoorToolForm_FormClosed(object sender, FormClosedEventArgs e)
{
parent.WarpDoorEditClosed(this);
}
private void toolStripButton3_Click(object sender, EventArgs e)
{
int x1, y1, x2, y2;
parent.GetSelection(out x1, out y1, out x2, out y2);
numX1.Value = x1;
numY1.Value = y1;
numX2.Value = x2;
numY2.Value = y2;
}
private void toolStripButton4_Click(object sender, EventArgs e)
{
numX1.Value = 255;
numY1.Value = 255;
numX2.Value = 255;
numY2.Value = 255;
}
}
}