| 354 | } |
| 355 | |
| 356 | bool CUIXmlInit::Init3tButton(CUIXml& xml_doc, const char* path, int index, CUI3tButton* pWnd) |
| 357 | { |
| 358 | R_ASSERT3(xml_doc.NavigateToNode(path, index), "XML node not found", path); |
| 359 | |
| 360 | InitWindow(xml_doc, path, index, pWnd); |
| 361 | InitMultiText(xml_doc, path, index, pWnd); |
| 362 | InitMultiTexture(xml_doc, path, index, pWnd); |
| 363 | InitTextureOffset(xml_doc, path, index, pWnd); |
| 364 | InitSound(xml_doc, path, index, pWnd); |
| 365 | |
| 366 | pWnd->EnableHeading(!!xml_doc.ReadAttribInt(path, index, "heading", 0)); |
| 367 | pWnd->SetStretchTexture(!!xml_doc.ReadAttribInt(path, index, "stretch")); |
| 368 | |
| 369 | LPCSTR accel = xml_doc.ReadAttrib(path, index, "accel", NULL); |
| 370 | if (accel) |
| 371 | { |
| 372 | int acc = keyname_to_dik(accel); |
| 373 | pWnd->SetAccelerator(acc, 0); |
| 374 | } |
| 375 | accel = xml_doc.ReadAttrib(path, index, "accel_ext", NULL); |
| 376 | if (accel) |
| 377 | { |
| 378 | int acc = keyname_to_dik(accel); |
| 379 | pWnd->SetAccelerator(acc, 1); |
| 380 | } |
| 381 | |
| 382 | float shadowOffsetX = xml_doc.ReadAttribFlt(path, index, "shadow_offset_x", 0); |
| 383 | float shadowOffsetY = xml_doc.ReadAttribFlt(path, index, "shadow_offset_y", 0); |
| 384 | |
| 385 | pWnd->SetShadowOffset(Fvector2().set(shadowOffsetX, shadowOffsetY)); |
| 386 | |
| 387 | // init hint static |
| 388 | string256 hint; |
| 389 | strconcat(sizeof(hint), hint, path, ":hint"); |
| 390 | |
| 391 | if (xml_doc.NavigateToNode(hint, index)) |
| 392 | InitStatic(xml_doc, hint, index, &pWnd->m_hint); |
| 393 | |
| 394 | int r = xml_doc.ReadAttribInt(path, index, "check_mode", -1); |
| 395 | if (r != -1) |
| 396 | pWnd->SetCheckMode((r == 1)); |
| 397 | |
| 398 | LPCSTR text_hint = xml_doc.ReadAttrib(path, index, "hint", NULL); |
| 399 | if (text_hint) |
| 400 | pWnd->m_hint_text = CStringTable().translate(text_hint); |
| 401 | |
| 402 | return true; |
| 403 | } |
| 404 | |
| 405 | bool CUIXmlInit::InitSound(CUIXml& xml_doc, const char* path, int index, CUI3tButton* pWnd) |
| 406 | { |
no test coverage detected