Survivalcraft API 1.8.2.3
v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
FullInventoryWidget.cs
浏览该文件的文档.
1
using
System.Xml.Linq;
2
using
Engine
;
3
4
namespace
Game
{
5
public
class
FullInventoryWidget
:
CanvasWidget
{
6
public
GridPanelWidget
m_inventoryGrid
;
7
8
public
GridPanelWidget
m_craftingGrid
;
9
10
public
InventorySlotWidget
m_craftingResultSlot
;
11
12
public
InventorySlotWidget
m_craftingRemainsSlot
;
13
14
public
FullInventoryWidget
(
IInventory
inventory,
ComponentCraftingTable
componentCraftingTable) {
15
XElement node =
ContentManager
.
Get
<XElement>(
"Widgets/FullInventoryWidget"
);
16
LoadContents
(
this
, node);
17
m_inventoryGrid
=
Children
.Find<
GridPanelWidget
>(
"InventoryGrid"
);
18
m_craftingGrid
=
Children
.Find<
GridPanelWidget
>(
"CraftingGrid"
);
19
m_craftingResultSlot
=
Children
.Find<
InventorySlotWidget
>(
"CraftingResultSlot"
);
20
m_craftingRemainsSlot
=
Children
.Find<
InventorySlotWidget
>(
"CraftingRemainsSlot"
);
21
int
num = 10;
22
for
(
int
i = 0; i <
m_inventoryGrid
.RowsCount; i++) {
23
for
(
int
j = 0; j <
m_inventoryGrid
.ColumnsCount; j++) {
24
InventorySlotWidget
inventorySlotWidget =
new
();
25
inventorySlotWidget.
AssignInventorySlot
(inventory, num++);
26
m_inventoryGrid
.Children.Add(inventorySlotWidget);
27
m_inventoryGrid
.SetWidgetCell(inventorySlotWidget,
new
Point2
(j, i));
28
}
29
}
30
num = 0;
31
for
(
int
k = 0; k <
m_craftingGrid
.RowsCount; k++) {
32
for
(
int
l = 0; l <
m_craftingGrid
.ColumnsCount; l++) {
33
InventorySlotWidget
inventorySlotWidget2 =
new
();
34
inventorySlotWidget2.
AssignInventorySlot
(componentCraftingTable, num++);
35
m_craftingGrid
.Children.Add(inventorySlotWidget2);
36
m_craftingGrid
.SetWidgetCell(inventorySlotWidget2,
new
Point2
(l, k));
37
}
38
}
39
m_craftingResultSlot
.AssignInventorySlot(componentCraftingTable, componentCraftingTable.
ResultSlotIndex
);
40
m_craftingRemainsSlot
.AssignInventorySlot(componentCraftingTable, componentCraftingTable.
RemainsSlotIndex
);
41
}
42
}
43
}
Game.CanvasWidget
定义
CanvasWidget.cs:4
Game.ComponentCraftingTable
定义
ComponentCraftingTable.cs:7
Game.ComponentCraftingTable.ResultSlotIndex
int ResultSlotIndex
定义
ComponentCraftingTable.cs:20
Game.ComponentCraftingTable.RemainsSlotIndex
int RemainsSlotIndex
定义
ComponentCraftingTable.cs:13
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.FullInventoryWidget.m_inventoryGrid
GridPanelWidget m_inventoryGrid
定义
FullInventoryWidget.cs:6
Game.FullInventoryWidget.m_craftingGrid
GridPanelWidget m_craftingGrid
定义
FullInventoryWidget.cs:8
Game.FullInventoryWidget.FullInventoryWidget
FullInventoryWidget(IInventory inventory, ComponentCraftingTable componentCraftingTable)
定义
FullInventoryWidget.cs:14
Game.FullInventoryWidget.m_craftingRemainsSlot
InventorySlotWidget m_craftingRemainsSlot
定义
FullInventoryWidget.cs:12
Game.FullInventoryWidget.m_craftingResultSlot
InventorySlotWidget m_craftingResultSlot
定义
FullInventoryWidget.cs:10
Game.GridPanelWidget
定义
GridPanelWidget.cs:4
Game.InventorySlotWidget
定义
InventorySlotWidget.cs:7
Game.InventorySlotWidget.AssignInventorySlot
virtual void AssignInventorySlot(IInventory inventory, int slotIndex)
定义
InventorySlotWidget.cs:189
Game.Widget.LoadContents
virtual void LoadContents(object eventsTarget, XElement node)
定义
Widget.cs:507
Game.IInventory
定义
IInventory.cs:5
Engine
定义
BaseSound.cs:10
Game
定义
ContentFileBridge.cs:4
Engine.Point2
定义
Point2.cs:2
SurvivalcraftApi 1.8.2.3
Survivalcraft.Windows
Widget
FullInventoryWidget.cs
制作者
1.16.1