| 44 | } |
| 45 | |
| 46 | void CUISequenceSimpleItem::Load(CUIXml* xml, int idx) |
| 47 | { |
| 48 | CUISequenceItem::Load(xml, idx); |
| 49 | |
| 50 | XML_NODE* _stored_root = xml->GetLocalRoot(); |
| 51 | xml->SetLocalRoot(xml->NavigateToNode("item", idx)); |
| 52 | |
| 53 | LPCSTR m_snd_name = xml->Read("sound", 0, ""); |
| 54 | if (m_snd_name && m_snd_name[0]) |
| 55 | { |
| 56 | m_sound.create(m_snd_name, st_Effect, sg_Undefined); |
| 57 | VERIFY(m_sound._handle()); |
| 58 | } |
| 59 | |
| 60 | m_time_length = xml->ReadFlt("length_sec", 0, 0); |
| 61 | |
| 62 | auto cur_pos = UI()->GetUICursor()->GetCursorPosition(); |
| 63 | |
| 64 | m_desired_cursor_pos.x = xml->ReadAttribFlt("cursor_pos", 0, "x", cur_pos.x); |
| 65 | m_desired_cursor_pos.y = xml->ReadAttribFlt("cursor_pos", 0, "y", cur_pos.y); |
| 66 | |
| 67 | strcpy_s(m_pda_section, xml->Read("pda_section", 0, "")); |
| 68 | |
| 69 | LPCSTR str = xml->Read("pause_state", 0, "ignore"); |
| 70 | m_flags.set(etiNeedPauseOn, 0 == _stricmp(str, "on")); |
| 71 | m_flags.set(etiNeedPauseOff, 0 == _stricmp(str, "off")); |
| 72 | |
| 73 | LPCSTR str2 = xml->Read("pause_sound", 0, "ignore"); |
| 74 | m_flags.set(etiNeedPauseSound, 0 == _stricmp(str2, "on")); |
| 75 | |
| 76 | str = xml->Read("guard_key", 0, NULL); |
| 77 | m_continue_dik_guard = -1; |
| 78 | if (str && !_stricmp(str, "any")) |
| 79 | { |
| 80 | m_continue_dik_guard = 9999; |
| 81 | str = NULL; |
| 82 | } |
| 83 | if (str) |
| 84 | { |
| 85 | EGameActions cmd = action_name_to_id(str); |
| 86 | m_continue_dik_guard = get_action_dik(cmd); |
| 87 | } |
| 88 | |
| 89 | m_flags.set(etiCanBeStopped, (m_continue_dik_guard == -1)); |
| 90 | m_flags.set(etiGrabInput, 1 == xml->ReadInt("grab_input", 0, 1)); |
| 91 | |
| 92 | int actions_count = xml->GetNodesNum(0, 0, "action"); |
| 93 | m_actions.resize(actions_count); |
| 94 | for (int idx = 0; idx < actions_count; ++idx) |
| 95 | { |
| 96 | auto& itm = m_actions[idx]; |
| 97 | LPCSTR str = xml->ReadAttrib("action", idx, "id"); |
| 98 | itm.m_action = action_name_to_id(str); |
| 99 | itm.m_bfinalize = !!xml->ReadAttribInt("action", idx, "finalize", FALSE); |
| 100 | itm.m_functor = xml->Read(xml->GetLocalRoot(), "action", idx, ""); |
| 101 | } |
| 102 | |
| 103 | // ui-components |
nothing calls this directly
no test coverage detected