DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ SetFocusToIndex()

void HandsContainer::SetFocusToIndex ( )
inlineprotected

См. определение в файле HandsContainer.c строка 72

73 {
74 int index = m_ActiveIndex - 1;
75 int attachment_start_index = -1;
76 int cargo_start_index = -1;
77 int attachment_end_index = -1;
78 int cargo_end_index = -1;
79
80 if ( m_Atts || m_AttachmentAttachments.Count() > 0 )
81 {
82 attachment_start_index = 0;
83 if ( m_Atts )
84 attachment_end_index++;
85 attachment_end_index += m_AttachmentAttachments.Count();
86 }
87
88 if ( m_CargoGrid || m_AttachmentCargos.Count() > 0 )
89 {
90 cargo_start_index = attachment_end_index + 1;
91 if ( m_CargoGrid )
92 cargo_end_index++;
93 cargo_end_index += cargo_start_index + m_AttachmentCargos.Count();
94 }
95
96 if ( m_ActiveIndex > m_OpenedContainers.Count() )
97 {
98 m_ActiveIndex = m_OpenedContainers.Count();
99 }
100
101 if ( index == -1 )
102 {
103 #ifdef PLATFORM_CONSOLE
104 if ( m_MainWidget.FindAnyWidget("Cursor") )
105 m_MainWidget.FindAnyWidget("Cursor").Show( true );
106 #endif
107 m_ScrollWidget.VScrollToPos01( 0 );
108 }
109 else
110 {
111 if( index.InRange( 0, attachment_end_index ) )
112 {
113 if( m_Atts )
114 {
115 if( index == 0 )
116 {
117 m_Atts.SetDefaultFocus();
118 SetFocusedContainer( m_Atts.GetWrapper() );
119 }
120 else
121 {
122 m_AttachmentAttachments.GetElement( index - 1 ).SetDefaultFocus();
123 SetFocusedContainer( m_AttachmentAttachments.GetElement( index - 1 ).GetWrapper() );
124 }
125 }
126 else
127 {
128 m_AttachmentAttachments.GetElement( index ).SetDefaultFocus();
129 SetFocusedContainer( m_AttachmentAttachments.GetElement( index ).GetWrapper() );
130 }
131 }
132 else if( index.InRange( cargo_start_index, cargo_end_index ) )
133 {
134 if( m_CargoGrid )
135 {
136 if( index == cargo_start_index )
137 {
138 m_CargoGrid.SetDefaultFocus();
139 SetFocusedContainer( m_CargoGrid );
140 }
141 else
142 {
143 m_AttachmentCargos.GetElement( index - 1 - cargo_start_index ).SetDefaultFocus();
144 SetFocusedContainer( m_AttachmentCargos.GetElement( index - 1 - cargo_start_index ) );
145 }
146 }
147 else
148 {
149 m_AttachmentCargos.GetElement( index - cargo_start_index ).SetDefaultFocus();
150 SetFocusedContainer( m_AttachmentCargos.GetElement( index - cargo_start_index ) );
151 }
152 }
153
154 if( m_MainWidget.FindAnyWidget("Cursor") )
155 m_MainWidget.FindAnyWidget("Cursor").Show( false );
156 ScrollToActiveContainer( GetFocusedContainer() );
157 }
158 }
ref map< EntityAI, ref CargoContainer > m_AttachmentCargos
Определения HandsContainer.c:10
void ScrollToActiveContainer(Container active_container)
Определения HandsContainer.c:160
ref map< EntityAI, ref Attachments > m_AttachmentAttachments
Определения HandsContainer.c:12
ScrollWidget m_ScrollWidget
Определения HandsContainer.c:18
ref Attachments m_Atts
Определения HandsContainer.c:7
ref CargoContainer m_CargoGrid
Определения HandsContainer.c:8

Перекрестные ссылки m_AttachmentAttachments, m_AttachmentCargos, m_Atts, m_CargoGrid, m_ScrollWidget и ScrollToActiveContainer().