Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
SelectGameModeDialog.cs
浏览该文件的文档.
1
using
System.Xml.Linq;
2
using
Engine
;
3
4
namespace
Game
{
5
public
class
SelectGameModeDialog
:
ListSelectionDialog
{
6
public
SelectGameModeDialog
(
string
title,
bool
allowAdventure,
bool
allowCruel, Action<GameMode> selectionHandler) : base(
7
title,
8
GetAllowedGameModes
(allowAdventure, allowCruel),
9
140f,
10
delegate(
object
item) {
11
GameMode
gameMode = (
GameMode
)item;
12
XElement node =
ContentManager
.
Get
<XElement>(
"Widgets/SelectGameModeItem"
);
13
ContainerWidget
obj = (
ContainerWidget
)
LoadWidget
(
null
, node,
null
);
14
obj.Children.Find<
LabelWidget
>(
"SelectGameModeItem.Name"
).Text =
LanguageControl
.
Get
(
"GameMode"
, gameMode.ToString());
15
obj.Children.Find<
LabelWidget
>(
"SelectGameModeItem.Description"
).Text =
16
StringsManager
.
GetString
($
"GameMode.{gameMode}.Description"
);
17
return
obj;
18
},
19
delegate(
object
item) { selectionHandler((
GameMode
)item); }
20
) =>
ContentSize
=
new
Vector2
(750f, 420f);
21
22
public
static
IEnumerable<GameMode>
GetAllowedGameModes
(
bool
allowAdventure,
bool
allowCruel) {
23
yield
return
GameMode
.Creative;
24
yield
return
GameMode
.Survival;
25
yield
return
GameMode
.Challenging;
26
yield
return
GameMode
.Harmless;
27
if
(allowAdventure) {
28
yield
return
GameMode
.Adventure;
29
}
30
if
(allowCruel) {
31
yield
return
GameMode
.Cruel;
32
}
33
}
34
}
35
}
Game.ContainerWidget
定义
ContainerWidget.cs:4
Game.ContentManager
定义
ContentManager.cs:50
Game.ContentManager.Get
static object Get(Type type, string name)
定义
ContentManager.cs:70
Game.LabelWidget
定义
LabelWidget.cs:4
Game.LanguageControl
定义
LanguageControl.cs:8
Game.LanguageControl.Get
static string Get(string className, int key)
获取在当前语言类名键对应的字符串
定义
LanguageControl.cs:247
Game.ListSelectionDialog.ListSelectionDialog
ListSelectionDialog(string title, IEnumerable items, float itemSize, Func< object, Widget > itemWidgetFactory, Action< object > selectionHandler)
定义
ListSelectionDialog.cs:23
Game.ListSelectionDialog.ContentSize
Vector2 ContentSize
定义
ListSelectionDialog.cs:18
Game.SelectGameModeDialog
定义
SelectGameModeDialog.cs:5
Game.SelectGameModeDialog.GetAllowedGameModes
SelectGameModeDialog(string title, bool allowAdventure, bool allowCruel, Action< GameMode > selectionHandler) static IEnumerable< GameMode > GetAllowedGameModes(bool allowAdventure, bool allowCruel)
定义
SelectGameModeDialog.cs:22
Game.StringsManager
定义
StringsManager.cs:2
Game.StringsManager.GetString
static string GetString(string name)
定义
StringsManager.cs:3
Game.Widget.LoadWidget
static Widget LoadWidget(object eventsTarget, XElement node, ContainerWidget parentWidget)
定义
Widget.cs:486
Engine
定义
BaseSound.cs:10
Game
定义
ContentFileBridge.cs:4
Game.GameMode
GameMode
定义
GameMode.cs:2
Engine.Vector2
定义
Vector2.cs:2
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
Dialog
SelectGameModeDialog.cs
制作者
1.16.1