Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
BulletinDialog.cs
浏览该文件的文档.
1
using
System.Xml.Linq;
2
using
Engine
;
3
4
namespace
Game
{
5
public
class
BulletinDialog
:
Dialog
{
6
public
LabelWidget
m_titleLabel
;
7
8
public
LabelWidget
m_contentLabel
;
9
10
public
LabelWidget
m_timeLabel
;
11
12
public
LabelWidget
m_buttonLabel
;
13
14
public
ButtonWidget
m_okButton
;
15
16
public
ButtonWidget
m_editButton
;
17
18
public
ButtonWidget
m_updateButton
;
19
20
public
ScrollPanelWidget
m_scrollPanel
;
21
22
public
float
m_areaLength
= 0;
23
24
public
Action
Action
;
25
26
public
Action<LabelWidget, LabelWidget>
Action2
;
27
28
public
Action<LabelWidget, LabelWidget>
Action3
;
29
30
public
BulletinDialog
(
string
title,
31
string
content,
32
string
time,
33
Action
action,
34
Action<LabelWidget, LabelWidget>
action2,
35
Action<LabelWidget, LabelWidget>
action3) {
36
XElement node =
ContentManager
.
Get
<XElement>(
"Dialogs/BulletinDialog"
);
37
LoadContents
(
this
, node);
38
m_okButton
=
Children
.Find<
ButtonWidget
>(
"OkButton"
);
39
m_editButton
=
Children
.Find<
ButtonWidget
>(
"EditButton"
);
40
m_updateButton
=
Children
.Find<
ButtonWidget
>(
"UpdateButton"
);
41
m_titleLabel
=
Children
.Find<
LabelWidget
>(
"Title"
);
42
m_contentLabel
=
Children
.Find<
LabelWidget
>(
"Content"
);
43
m_timeLabel
=
Children
.Find<
LabelWidget
>(
"Time"
);
44
m_buttonLabel
=
Children
.Find<
LabelWidget
>(
"ButtonLabel"
);
45
m_scrollPanel
=
Children
.Find<
ScrollPanelWidget
>(
"ScrollPanel"
);
46
m_buttonLabel.Text =
LanguageControl
.
Ok
;
47
m_okButton.IsVisible =
false
;
48
m_titleLabel.Text = title;
49
m_contentLabel.Text = content;
50
m_timeLabel.Text = time;
51
Action
= action;
52
Action2
= action2;
53
Action3
= action3;
54
m_editButton.IsVisible =
false
;
55
m_updateButton.IsVisible =
false
;
56
}
57
58
public
override
void
Update
() {
59
float
length =
MathUtils
.
Max
(
m_scrollPanel
.m_scrollAreaLength -
m_scrollPanel
.ActualSize.Y, 0f);
60
if
(
m_scrollPanel
.ScrollPosition >= length * 0.8f
61
&&
m_scrollPanel
.m_scrollAreaLength != 0) {
62
m_okButton.IsVisible =
true
;
63
}
64
if
(
m_okButton
.IsClicked) {
65
Action
?.Invoke();
66
DialogsManager
.
HideDialog
(
this
);
67
}
68
if
(
m_editButton
.IsClicked) {
69
Action2
?.Invoke(
m_titleLabel
,
m_contentLabel
);
70
}
71
if
(
m_updateButton
.IsClicked) {
72
Action3
?.Invoke(
m_titleLabel
,
m_contentLabel
);
73
DialogsManager
.
HideDialog
(
this
);
74
}
75
}
76
}
77
}
Engine.MathUtils
定义
MathUtils.cs:2
Engine.MathUtils.Max
static int Max(int x1, int x2)
定义
MathUtils.cs:18
Game.BulletinDialog.m_buttonLabel
LabelWidget m_buttonLabel
定义
BulletinDialog.cs:12
Game.BulletinDialog.m_okButton
ButtonWidget m_okButton
定义
BulletinDialog.cs:14
Game.BulletinDialog.Action3
Action< LabelWidget, LabelWidget > Action3
定义
BulletinDialog.cs:28
Game.BulletinDialog.m_titleLabel
LabelWidget m_titleLabel
定义
BulletinDialog.cs:6
Game.BulletinDialog.Action2
Action< LabelWidget, LabelWidget > Action2
定义
BulletinDialog.cs:26
Game.BulletinDialog.m_editButton
ButtonWidget m_editButton
定义
BulletinDialog.cs:16
Game.BulletinDialog.Update
override void Update()
定义
BulletinDialog.cs:58
Game.BulletinDialog.m_updateButton
ButtonWidget m_updateButton
定义
BulletinDialog.cs:18
Game.BulletinDialog.Action
Action Action
定义
BulletinDialog.cs:24
Game.BulletinDialog.m_contentLabel
LabelWidget m_contentLabel
定义
BulletinDialog.cs:8
Game.BulletinDialog.BulletinDialog
BulletinDialog(string title, string content, string time, Action action, Action< LabelWidget, LabelWidget > action2, Action< LabelWidget, LabelWidget > action3)
定义
BulletinDialog.cs:30
Game.BulletinDialog.m_timeLabel
LabelWidget m_timeLabel
定义
BulletinDialog.cs:10
Game.BulletinDialog.m_scrollPanel
ScrollPanelWidget m_scrollPanel
定义
BulletinDialog.cs:20
Game.BulletinDialog.m_areaLength
float m_areaLength
定义
BulletinDialog.cs:22
Game.ButtonWidget
定义
ButtonWidget.cs:5
Game.ContainerWidget.Children
readonly WidgetsList Children
定义
ContainerWidget.cs:5
Game.ContentManager
定义
ContentManager.cs:50
Game.ContentManager.Get
static object Get(Type type, string name)
定义
ContentManager.cs:70
Game.Dialog.Dialog
Dialog()
定义
Dialog.cs:5
Game.DialogsManager
定义
DialogsManager.cs:4
Game.DialogsManager.HideDialog
static void HideDialog(Dialog dialog)
定义
DialogsManager.cs:58
Game.LabelWidget
定义
LabelWidget.cs:4
Game.LanguageControl
定义
LanguageControl.cs:8
Game.LanguageControl.Ok
static string Ok
定义
LanguageControl.cs:11
Game.ScrollPanelWidget
定义
ScrollPanelWidget.cs:5
Game.Widget.LoadContents
virtual void LoadContents(object eventsTarget, XElement node)
定义
Widget.cs:507
Engine
定义
BaseSound.cs:10
Game
定义
ContentFileBridge.cs:4
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
Dialog
BulletinDialog.cs
制作者
1.16.1