-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWarningWindowLoad.cs
More file actions
36 lines (30 loc) · 1.07 KB
/
WarningWindowLoad.cs
File metadata and controls
36 lines (30 loc) · 1.07 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
using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System.Linq;
using System;
namespace FFRMapEditorMono
{
public class LoadMapWarningWindow : WarningWindow
{
public LoadMapWarningWindow(Texture2D _window, SpriteFont _font, Texture2D _buttonTexture, Point resolution)
{
Type = WarningType.LoadMap;
windowTexture = _window;
font = _font;
Show = false;
zoom = 3.0f;
windowWidth = 28 * 8;
windowDimensions = new(windowWidth, 100);
warningText = "*** Warning *** \n\nYou have unsaved changes.";
var windowHeight = warningText.Count(c => c == '\n') * 8 + 64;
windowDimensions = new Vector2(windowWidth, windowHeight);
buttons = new()
{
new(font, "Load a new map anyway", _buttonTexture, new() { new EditorTask(EditorTasks.FileLoadMap, (int)WarningSetting.Disabled), new EditorTask(EditorTasks.LoadMapWarningClose, 10) }),
new(font, "Return to editor", _buttonTexture, new() { new EditorTask(EditorTasks.LoadMapWarningClose, 10) })
};
UpdatePosition(resolution);
}
}
}