Mercurial > mm7
comparison GUI/GUIWindow.cpp @ 2547:fed97f15d1e1
* SaveLoad
* QuickReference
* Modal
* Character
author | a.parshin |
---|---|
date | Tue, 12 May 2015 01:45:31 +0200 |
parents | 4087cbc62706 |
children | 87e5590d034b |
comparison
equal
deleted
inserted
replaced
2546:4087cbc62706 | 2547:fed97f15d1e1 |
---|---|
1613 pEventTimer->Resume(); | 1613 pEventTimer->Resume(); |
1614 } | 1614 } |
1615 | 1615 |
1616 | 1616 |
1617 | 1617 |
1618 void GUIWindow_CharacterRecord::Update() | |
1619 { | |
1620 // ----------------------------------- | |
1621 // 004156F0 GUI_UpdateWindows --- part | |
1622 CharacterUI_CharacterScreen_Draw(pPlayers[uActiveCharacter]); | |
1623 } | |
1624 | |
1625 void GUIWindow_Book::Update() | 1618 void GUIWindow_Book::Update() |
1626 { | 1619 { |
1627 // ----------------------------------- | 1620 // ----------------------------------- |
1628 // 004156F0 GUI_UpdateWindows --- part | 1621 // 004156F0 GUI_UpdateWindows --- part |
1629 BookUI_Draw((WindowType)(int)ptr_1C); | 1622 BookUI_Draw((WindowType)(int)ptr_1C); |
1634 // ----------------------------------- | 1627 // ----------------------------------- |
1635 // 004156F0 GUI_UpdateWindows --- part | 1628 // 004156F0 GUI_UpdateWindows --- part |
1636 auto pButton = (GUIButton *)ptr_1C; | 1629 auto pButton = (GUIButton *)ptr_1C; |
1637 pRenderer->DrawTextureIndexed(uFrameY, uFrameX, pButton->pTextures[0]); | 1630 pRenderer->DrawTextureIndexed(uFrameY, uFrameX, pButton->pTextures[0]); |
1638 viewparams->bRedrawGameUI = true; | 1631 viewparams->bRedrawGameUI = true; |
1639 } | |
1640 | |
1641 void GUIWindow_QuickReference::Update() | |
1642 { | |
1643 // ----------------------------------- | |
1644 // 004156F0 GUI_UpdateWindows --- part | |
1645 GameUI_QuickRef_Draw(); | |
1646 } | 1632 } |
1647 | 1633 |
1648 void GUIWindow_Dialogue::Update() | 1634 void GUIWindow_Dialogue::Update() |
1649 { | 1635 { |
1650 // ----------------------------------- | 1636 // ----------------------------------- |
1679 pRenderer->ClearZBuffer(0, 479); | 1665 pRenderer->ClearZBuffer(0, 479); |
1680 draw_leather(); | 1666 draw_leather(); |
1681 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1667 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1682 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); | 1668 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId)); |
1683 } | 1669 } |
1684 } | |
1685 | |
1686 void GUIWindow_Save::Update() | |
1687 { | |
1688 // ----------------------------------- | |
1689 // 004156F0 GUI_UpdateWindows --- part | |
1690 SaveUI_Draw(); | |
1691 } | |
1692 | |
1693 void GUIWindow_Load::Update() | |
1694 { | |
1695 // ----------------------------------- | |
1696 // 004156F0 GUI_UpdateWindows --- part | |
1697 LoadUI_Draw(); | |
1698 } | 1670 } |
1699 | 1671 |
1700 void GUIWindow_House::Update() | 1672 void GUIWindow_House::Update() |
1701 { | 1673 { |
1702 // ----------------------------------- | 1674 // ----------------------------------- |
1750 pRenderer->ClearZBuffer(0, 479); | 1722 pRenderer->ClearZBuffer(0, 479); |
1751 draw_leather(); | 1723 draw_leather(); |
1752 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); | 1724 CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); |
1753 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); | 1725 CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]); |
1754 pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); | 1726 pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u)); |
1755 } | |
1756 | |
1757 void GUIWindow_Modal::Update() | |
1758 { | |
1759 // ----------------------------------- | |
1760 // 004156F0 GUI_UpdateWindows --- part | |
1761 ModalWindow_ShowHint(); | |
1762 } | 1727 } |
1763 | 1728 |
1764 void OnButtonClick::Update() | 1729 void OnButtonClick::Update() |
1765 { | 1730 { |
1766 // ----------------------------------- | 1731 // ----------------------------------- |
2038 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; | 2003 Dst.uFrameZ = Dst.uFrameX + Dst.uFrameWidth - 1; |
2039 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; | 2004 Dst.uFrameW = Dst.uFrameY + Dst.uFrameHeight - 1; |
2040 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); | 2005 Dst.DrawTitleText(pFontSmallnum, 0, 0xCu, ui_mainmenu_copyright_color, pGlobalTXT_LocalizationStrings[157], 3); |
2041 } | 2006 } |
2042 | 2007 |
2043 enum CURRENT_SCREEN modal_window_prev_screen_type; | |
2044 | |
2045 //----- (004141CA) -------------------------------------------------------- | |
2046 void ModalWindow(const char *pStrHint, UIMessageType OnRelease_message) | |
2047 { | |
2048 pEventTimer->Pause(); | |
2049 modal_window_prev_screen_type = current_screen_type; | |
2050 pModalWindow = new GUIWindow_Modal(0, 0, window->GetWidth(), window->GetHeight(), OnRelease_message, pStrHint); | |
2051 current_screen_type = SCREEN_MODAL_WINDOW; | |
2052 } | |
2053 | |
2054 //----- (0041420D) -------------------------------------------------------- | |
2055 void ModalWindow_ShowHint() | |
2056 { | |
2057 GUIWindow pWindow; // [sp+4h] [bp-54h]@1 | |
2058 | |
2059 sprintf(pTmpBuf2.data(), "%s\n \n%s", pModalWindow->Hint, pGlobalTXT_LocalizationStrings[61]);// Press Escape | |
2060 pWindow.Hint = pTmpBuf2.data(); | |
2061 pWindow.uFrameWidth = 400; | |
2062 pWindow.uFrameHeight = 100; | |
2063 pWindow.uFrameX = 120; | |
2064 pWindow.uFrameY = 140; | |
2065 pWindow.uFrameZ = 519; | |
2066 pWindow.uFrameW = 239; | |
2067 pWindow.DrawMessageBox(0); | |
2068 } | |
2069 | |
2070 //----- (0041426F) -------------------------------------------------------- | |
2071 void ModalWindow_Release() | |
2072 { | |
2073 pMessageQueue_50CBD0->AddGUIMessage((UIMessageType)pModalWindow->par1C, 0, 0); | |
2074 | |
2075 pModalWindow->Release(); | |
2076 pModalWindow = nullptr; | |
2077 | |
2078 current_screen_type = modal_window_prev_screen_type; | |
2079 pEventTimer->Resume(); | |
2080 } | |
2081 | 2008 |
2082 //----- (00467FB6) -------------------------------------------------------- | 2009 //----- (00467FB6) -------------------------------------------------------- |
2083 void CreateScrollWindow() | 2010 void CreateScrollWindow() |
2084 { | 2011 { |
2085 unsigned int v0; // eax@1 | 2012 unsigned int v0; // eax@1 |