-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGuiWindow.cs
51 lines (39 loc) · 1.39 KB
/
GuiWindow.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
using UnityEngine;
using System.Collections.Generic;
using BrokeProtocolClient.modules;
using BrokeProtocolClient.settings;
using BrokeProtocolClient.utils;
namespace BrokeProtocolClient.UI
{
abstract class GuiWindow
{
protected static int rollingIndex;
public int windowIndex;
public Rect windowSpace;
public string windowTitle;
public float controlIndex;
public int columns = 1;
public int currentColumn = 0;
public int rows = 0;
public int currentRow = 0;
public int headerPad = 20;
public int pad = 5;
public int controlHeight = 20;
public int controlWidth = 200;
public GuiWindow(string name)
{
this.windowTitle = name;
windowSpace = new Rect(0, 0, (controlWidth + pad) * columns + pad, (controlHeight + pad) * controlIndex + headerPad);
}
protected abstract void init();
protected void ResizeWindowToFitControls()
{
windowSpace.width = (controlWidth + pad) * columns + pad;
windowSpace.height = (controlHeight + pad) * controlIndex + headerPad;
}
protected abstract void WindowCore();
protected abstract void WindowWrapper(int id);
public abstract void onRender();
public abstract void onUpdate();
}
}