Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс UIPropertyAttachment

Закрытые члены

void UIPropertyAttachment (Widget root)
 
void ~UIPropertyAttachment ()
 
bool OnClick (Widget w, int x, int y, int button)
 
void SetPos (float x, float y)
 
void SetSize (float width, float height)
 
void Show (EntityAI e, string slot_name, TStringArray att_items)
 
void Hide ()
 
bool IsVisible ()
 

Закрытые данные

Widget m_WgtRoot
 
Widget m_WgtThis
 
XComboBoxWidget m_WgtComboBox
 
TextWidget m_WgtSlotName
 
ref TStringArray m_ComboItems
 
int m_PrevIndex
 
EntityAI m_Obj
 
int m_SlotID
 

Подробное описание

Конструктор(ы)

◆ UIPropertyAttachment()

void UIPropertyAttachment ( Widget root)
inlineprivate
14 {
16
18
19 m_WgtThis = GetGame().GetWorkspace().CreateWidgets("gui/layouts/scene_editor/day_z_scene_editor_attachment.layout", m_WgtRoot);
20 m_WgtComboBox = XComboBoxWidget.Cast( m_WgtThis.FindAnyWidget("combo_box") );
21 m_WgtSlotName = TextWidget.Cast( m_WgtThis.FindAnyWidget("txt_slot_name") );
22 }
Definition EntityAI.c:95
Definition EnWidgets.c:220
XComboBoxWidget m_WgtComboBox
Definition UIPropertyAttachment.c:5
TextWidget m_WgtSlotName
Definition UIPropertyAttachment.c:6
ref TStringArray m_ComboItems
Definition UIPropertyAttachment.c:7
Widget m_WgtThis
Definition UIPropertyAttachment.c:4
Widget m_WgtRoot
Definition UIPropertyAttachment.c:3
proto native CGame GetGame()
array< string > TStringArray
Definition EnScript.c:685

Перекрестные ссылки GetGame(), m_ComboItems, m_WgtComboBox, m_WgtRoot, m_WgtSlotName и m_WgtThis.

◆ ~UIPropertyAttachment()

void ~UIPropertyAttachment ( )
inlineprivate
25 {
28
29 delete m_WgtThis;
30 }

Перекрестные ссылки m_WgtComboBox, m_WgtRoot и m_WgtThis.

Методы

◆ Hide()

void Hide ( )
inlineprivate
103 {
104 m_WgtThis.Show(false);
105
106 m_Obj = NULL;
107 m_SlotID = -1;
108 }
int m_SlotID
Definition UIPropertyAttachment.c:10
EntityAI m_Obj
Definition UIPropertyAttachment.c:9

Перекрестные ссылки m_Obj, m_SlotID и m_WgtThis.

◆ IsVisible()

bool IsVisible ( )
inlineprivate
111 {
112 return m_WgtThis.IsVisible();
113 }

Перекрестные ссылки m_WgtThis.

◆ OnClick()

bool OnClick ( Widget w,
int x,
int y,
int button )
inlineprivate
33 {
34 if ( w == m_WgtComboBox )
35 {
36 if ( m_PrevIndex != 0 )
37 {
38 EntityAI attachment = m_Obj.GetInventory().FindAttachment(m_SlotID);
39 GetGame().ObjectDelete(attachment);
40 }
41
42 int curr_index = m_WgtComboBox.GetCurrentItem();
43
44 if ( curr_index != 0 )
45 {
46 PluginDeveloper module_dev = PluginDeveloper.Cast( GetPlugin(PluginDeveloper) );
47
48 EntityAI e = module_dev.SpawnEntityAsAttachment(PluginSceneManager.PLAYER, m_Obj, m_ComboItems.Get(curr_index), 1, -1);
49 }
50
52
53 return true;
54 }
55
56 return false;
57 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
Definition Building.c:6
int m_PrevIndex
Definition UIPropertyAttachment.c:8

Перекрестные ссылки GetGame(), GetPlugin(), m_ComboItems, m_Obj, m_PrevIndex, m_SlotID и m_WgtComboBox.

◆ SetPos()

void SetPos ( float x,
float y )
inlineprivate
60 {
61 m_WgtThis.SetPos(x, y);
62 }
Icon x
Icon y

Перекрестные ссылки m_WgtThis, x и y.

◆ SetSize()

void SetSize ( float width,
float height )
inlineprivate
65 {
66 m_WgtThis.SetSize(width, height);
67 }

Перекрестные ссылки m_WgtThis.

◆ Show()

void Show ( EntityAI e,
string slot_name,
TStringArray att_items )
inlineprivate
70 {
71 m_WgtThis.Show(true);
72
73 m_Obj = e;
74 m_ComboItems.Clear();
75 m_ComboItems.Insert("none");
76 m_ComboItems.InsertAll(att_items);
77
78 m_WgtSlotName.SetText(slot_name);
79
80 m_WgtComboBox.ClearAll();
81
83 EntityAI attachment = e.GetInventory().FindAttachment(m_SlotID);
84 int selected_index = 0;
85
86 for ( int i = 0; i < m_ComboItems.Count(); ++i )
87 {
88 string item_name = m_ComboItems.Get(i);
89
90 m_WgtComboBox.AddItem(item_name);
91
92 if ( attachment != NULL && attachment.GetType() == item_name )
93 {
95 }
96 }
97
98 m_WgtComboBox.SetCurrentItem(selected_index);
100 }
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

Перекрестные ссылки InventorySlots::GetSlotIdFromString(), m_ComboItems, m_Obj, m_PrevIndex, m_SlotID, m_WgtComboBox, m_WgtSlotName и m_WgtThis.

Поля

◆ m_ComboItems

ref TStringArray m_ComboItems
private

Используется в OnClick(), Show() и UIPropertyAttachment().

◆ m_Obj

EntityAI m_Obj
private

Используется в Hide(), OnClick() и Show().

◆ m_PrevIndex

int m_PrevIndex
private

Используется в OnClick() и Show().

◆ m_SlotID

int m_SlotID
private

Используется в Hide(), OnClick() и Show().

◆ m_WgtComboBox

XComboBoxWidget m_WgtComboBox
private

◆ m_WgtRoot

Widget m_WgtRoot
private

Используется в UIPropertyAttachment() и ~UIPropertyAttachment().

◆ m_WgtSlotName

TextWidget m_WgtSlotName
private

Используется в Show() и UIPropertyAttachment().

◆ m_WgtThis

Widget m_WgtThis
private

Объявления и описания членов класса находятся в файле: