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

◆ GetDialNumberText()

string ConstructionActionData::GetDialNumberText ( )
inlineprotected

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

407 {
408 string dialText;
409
411 {
412 string combinationText;
413 if (m_CombinationLockSide == 0)
414 {
415 combinationText = m_CombinationLock.GetCombination().ToString();
416 }
417 else if (m_CombinationLockSide == 1)
418 {
419 combinationText = m_CombinationLock.GetCombinationInside().ToString();
420 }
421
422 //insert zeros to dials with 0 value
423 int lengthDiff = m_CombinationLock.GetLockDigits() - combinationText.Length();
424 for (int i = 0; i < lengthDiff; ++i)
425 {
426 combinationText = "0" + combinationText;
427 }
428
429 int dialIndex;
430 if (m_CombinationLockSide == 0)
431 {
432 dialIndex = m_CombinationLock.GetDialIndex();
433 }
434 else if (m_CombinationLockSide == 1)
435 {
436 dialIndex = m_CombinationLock.GetDialIndexInside();
437 }
438
439 //assemble the whole combination with selected part
440 for (int j = 0; j < m_CombinationLock.GetLockDigits(); ++j)
441 {
442 if (j == dialIndex)
443 {
444 dialText += string.Format("[%1]", combinationText.Get(j));
445 }
446 else
447 {
448 dialText += string.Format(" %1 ", combinationText.Get(j));
449 }
450 }
451 }
452
453 return dialText;
454 }
CombinationLock m_CombinationLock
Определения ConstructionActionData.c:21
int m_CombinationLockSide
Определения ConstructionActionData.c:22
proto native int Length()
Returns length of string.
proto string Get(int index)
Gets n-th character from string.
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.

Перекрестные ссылки string::Format(), string::Get(), string::Length(), m_CombinationLock и m_CombinationLockSide.

Используется в OnActionInfoUpdate().