Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
RateCommunityContentDialog.cs
浏览该文件的文档.
1
using
System.Xml.Linq;
2
3
namespace
Game
{
4
public
class
RateCommunityContentDialog
:
Dialog
{
5
public
string
m_address
;
6
7
public
string
m_displayName
;
8
9
public
string
m_userId
;
10
11
public
LabelWidget
m_nameLabel
;
12
13
public
StarRatingWidget
m_starRating
;
14
15
public
ButtonWidget
m_rateButton
;
16
17
public
LinkWidget
m_reportLink
;
18
19
public
ButtonWidget
m_cancelButton
;
20
21
public
RateCommunityContentDialog
(
string
address,
string
displayName,
string
userId) {
22
m_address
= address;
23
m_displayName
= displayName;
24
m_userId
= userId;
25
XElement node =
ContentManager
.
Get
<XElement>(
"Dialogs/RateCommunityContentDialog"
);
26
LoadContents
(
this
, node);
27
m_nameLabel
=
Children
.Find<
LabelWidget
>(
"RateCommunityContentDialog.Name"
);
28
m_starRating
=
Children
.Find<
StarRatingWidget
>(
"RateCommunityContentDialog.StarRating"
);
29
m_rateButton
=
Children
.Find<
ButtonWidget
>(
"RateCommunityContentDialog.Rate"
);
30
m_reportLink
=
Children
.Find<
LinkWidget
>(
"RateCommunityContentDialog.Report"
);
31
m_cancelButton
=
Children
.Find<
ButtonWidget
>(
"RateCommunityContentDialog.Cancel"
);
32
m_nameLabel.Text = displayName;
33
m_rateButton.IsEnabled =
false
;
34
}
35
36
public
override
void
Update
() {
37
m_rateButton.IsEnabled = m_starRating.Rating != 0f;
38
if
(
m_rateButton
.IsClicked) {
39
DialogsManager
.
HideDialog
(
this
);
40
CancellableBusyDialog
busyDialog =
new
(
"Sending Rating"
,
false
);
41
DialogsManager
.
ShowDialog
(
ParentWidget
, busyDialog);
42
CommunityContentManager
.
Rate
(
43
m_address
,
44
m_userId
,
45
(
int
)
m_starRating
.Rating,
46
busyDialog.
Progress
,
47
delegate { DialogsManager.HideDialog(busyDialog); },
48
delegate { DialogsManager.HideDialog(busyDialog); }
49
);
50
}
51
if
(
m_reportLink
.IsClicked
52
&&
UserManager
.
ActiveUser
!=
null
) {
53
DialogsManager
.
HideDialog
(
this
);
54
DialogsManager
.
ShowDialog
(
ParentWidget
,
new
ReportCommunityContentDialog
(
m_address
,
m_displayName
,
UserManager
.
ActiveUser
.
UniqueId
));
55
}
56
if
(Input.Cancel
57
||
m_cancelButton
.IsClicked) {
58
DialogsManager
.
HideDialog
(
this
);
59
}
60
}
61
}
62
}
Game.ButtonWidget
定义
ButtonWidget.cs:5
Game.CancellableBusyDialog
定义
CancellableBusyDialog.cs:5
Game.CancellableBusyDialog.Progress
CancellableProgress Progress
定义
CancellableBusyDialog.cs:16
Game.CommunityContentManager
定义
CommunityContentManager.cs:11
Game.CommunityContentManager.Rate
static void Rate(string address, string userId, int rating, CancellableProgress progress, Action success, Action< Exception > failure)
定义
CommunityContentManager.cs:264
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.DialogsManager.ShowDialog
static void ShowDialog(ContainerWidget parentWidget, Dialog dialog)
定义
DialogsManager.cs:35
Game.LabelWidget
定义
LabelWidget.cs:4
Game.LinkWidget
定义
LinkWidget.cs:7
Game.RateCommunityContentDialog.m_starRating
StarRatingWidget m_starRating
定义
RateCommunityContentDialog.cs:13
Game.RateCommunityContentDialog.RateCommunityContentDialog
RateCommunityContentDialog(string address, string displayName, string userId)
定义
RateCommunityContentDialog.cs:21
Game.RateCommunityContentDialog.m_userId
string m_userId
定义
RateCommunityContentDialog.cs:9
Game.RateCommunityContentDialog.Update
override void Update()
定义
RateCommunityContentDialog.cs:36
Game.RateCommunityContentDialog.m_reportLink
LinkWidget m_reportLink
定义
RateCommunityContentDialog.cs:17
Game.RateCommunityContentDialog.m_displayName
string m_displayName
定义
RateCommunityContentDialog.cs:7
Game.RateCommunityContentDialog.m_address
string m_address
定义
RateCommunityContentDialog.cs:5
Game.RateCommunityContentDialog.m_nameLabel
LabelWidget m_nameLabel
定义
RateCommunityContentDialog.cs:11
Game.RateCommunityContentDialog.m_cancelButton
ButtonWidget m_cancelButton
定义
RateCommunityContentDialog.cs:19
Game.RateCommunityContentDialog.m_rateButton
ButtonWidget m_rateButton
定义
RateCommunityContentDialog.cs:15
Game.ReportCommunityContentDialog
定义
ReportCommunityContentDialog.cs:4
Game.StarRatingWidget
定义
StarRatingWidget.cs:5
Game.UserInfo.UniqueId
readonly string UniqueId
定义
UserInfo.cs:3
Game.UserManager
定义
UserManager.cs:4
Game.UserManager.ActiveUser
static UserInfo ActiveUser
定义
UserManager.cs:7
Game.Widget.ParentWidget
ContainerWidget ParentWidget
定义
Widget.cs:468
Game.Widget.LoadContents
virtual void LoadContents(object eventsTarget, XElement node)
定义
Widget.cs:507
Game
定义
ContentFileBridge.cs:4
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
Dialog
RateCommunityContentDialog.cs
制作者
1.16.1