-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLogEntryWindow.cs
More file actions
50 lines (39 loc) · 1.45 KB
/
Copy pathLogEntryWindow.cs
File metadata and controls
50 lines (39 loc) · 1.45 KB
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
using UnityEngine;
namespace PersistentTrails
{
class LogEntryWindow : Tac.Window<LogEntryWindow>
{
private TrackManager trackManager;
private string labelText;
private string descriptionText;
public LogEntryWindow(TrackManager trackManager) : base ("Create new Log Entry")
{
this.trackManager = trackManager;
labelText = "Log Entry";
descriptionText = "something happened here";
windowPos = new Rect(150, 350, 300, 100);
}
protected override void DrawWindowContents(int windowID)
{
GUILayout.BeginVertical(); // BEGIN outer container
GUILayout.BeginHorizontal();
GUILayout.Label("Label:");
labelText = GUILayout.TextField(labelText);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
GUILayout.Label("Description:");
descriptionText = GUILayout.TextField(descriptionText);
GUILayout.EndHorizontal();
GUILayout.BeginHorizontal();
if (GUILayout.Button("OK")) {
trackManager.AddLogEntry(labelText, descriptionText);
Save(new ConfigNode(GetConfigNodeName()));
SetVisible(false);
}
if (GUILayout.Button("Cancel"))
SetVisible(false);
GUILayout.EndHorizontal();
GUILayout.EndVertical();
}
}
}