Mercurial > mm7
comparison UI/UIHouses.cpp @ 1920:05b433b8cb37
GuildDialog fix and cleared
author | Ritor1 |
---|---|
date | Wed, 23 Oct 2013 12:49:25 +0600 |
parents | 140ca8123384 |
children | 03d9336e862f |
comparison
equal
deleted
inserted
replaced
1919:140ca8123384 | 1920:05b433b8cb37 |
---|---|
1055 case BuildingType_DarkGuild: | 1055 case BuildingType_DarkGuild: |
1056 case BuildingType_ElementalGuild: | 1056 case BuildingType_ElementalGuild: |
1057 case BuildingType_SelfGuild: | 1057 case BuildingType_SelfGuild: |
1058 case BuildingType_16: | 1058 case BuildingType_16: |
1059 { | 1059 { |
1060 if ( pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] >= (signed __int64)pParty->uTimePlayed ) | 1060 if ( pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] >= (signed __int64)pParty->uTimePlayed ) |
1061 { | 1061 { |
1062 for ( uint i = 0; i < 12; ++i ) | 1062 for ( uint i = 0; i < 12; ++i ) |
1063 { | 1063 { |
1064 if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].uItemID ) | 1064 if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].uItemID ) |
1065 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].GetIconName(), TEXTURE_16BIT_PALETTE)]; | 1065 ItemsInShopTexture[i] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].GetIconName(), TEXTURE_16BIT_PALETTE)]; |
1066 } | 1066 } |
1067 } | 1067 } |
1068 else//generation new books | 1068 else//generation new books |
1069 { | 1069 { |
1070 SpellBookGenerator(); | 1070 SpellBookGenerator(); |
1071 pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 | 1071 pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 |
1072 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); | 1072 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); |
1073 } | 1073 } |
1074 break; | 1074 break; |
1075 } | 1075 } |
1076 case BuildingType_TownHall: | 1076 case BuildingType_TownHall: |
2074 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); | 2074 v9 = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].flt_24 * 500.0); |
2075 pPriceSkill = v9 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; | 2075 pPriceSkill = v9 * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100; |
2076 if ( pPriceSkill < v9 / 3 ) | 2076 if ( pPriceSkill < v9 / 3 ) |
2077 pPriceSkill = v9 / 3; | 2077 pPriceSkill = v9 / 3; |
2078 all_text_height = 0; | 2078 all_text_height = 0; |
2079 for ( pItemNum = pDialogueWindow->pStartingPosActiveItem; | 2079 for ( int i = pDialogueWindow->pStartingPosActiveItem; |
2080 pItemNum < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++pItemNum ) | 2080 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i ) |
2081 { | 2081 { |
2082 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(pItemNum)->msg_param - 36] | 2082 if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(i)->msg_param - 36] |
2083 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(pItemNum)->msg_param - 36] ) | 2083 && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] ) |
2084 { | 2084 { |
2085 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(pItemNum)->msg_param - 36], &dialog_window, 0, 0); | 2085 all_text_height = pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &dialog_window, 0, 0); |
2086 pSkillCount++; | 2086 pSkillCount++; |
2087 } | 2087 } |
2088 } | 2088 } |
2089 if ( pSkillCount ) | 2089 if ( pSkillCount ) |
2090 { | 2090 { |
2092 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3); | 2092 dialog_window.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3); |
2093 v91 = (149 - all_text_height) / pSkillCount; | 2093 v91 = (149 - all_text_height) / pSkillCount; |
2094 if ( (149 - all_text_height) / pSkillCount > 32 ) | 2094 if ( (149 - all_text_height) / pSkillCount > 32 ) |
2095 v91 = 32; | 2095 v91 = 32; |
2096 v54 = (149 - pSkillCount * v91 - all_text_height) / 2 - v91 / 2 + 162; | 2096 v54 = (149 - pSkillCount * v91 - all_text_height) / 2 - v91 / 2 + 162; |
2097 for ( pItemNum = pDialogueWindow->pStartingPosActiveItem; | 2097 for ( int i = pDialogueWindow->pStartingPosActiveItem; |
2098 pItemNum < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; pItemNum++ ) | 2098 i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; i++ ) |
2099 { | 2099 { |
2100 pButton = pDialogueWindow->GetControl(pItemNum); | 2100 pButton = pDialogueWindow->GetControl(i); |
2101 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36] | 2101 if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36] |
2102 || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] ) | 2102 || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] ) |
2103 { | 2103 { |
2104 pButton->uW = 0; | 2104 pButton->uW = 0; |
2105 pButton->uHeight = 0; | 2105 pButton->uHeight = 0; |
2111 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &dialog_window, 0, 0); | 2111 pTextHeight = pFontArrus->CalcTextHeight(pSkillNames[pButton->msg_param - 36], &dialog_window, 0, 0); |
2112 pButton->uHeight = pTextHeight; | 2112 pButton->uHeight = pTextHeight; |
2113 v54 = pTextHeight + pButton->uY - 1; | 2113 v54 = pTextHeight + pButton->uY - 1; |
2114 pButton->uW = v54; | 2114 pButton->uW = v54; |
2115 pColorText = TargetColor(0xFFu, 0xFFu, 0x9Bu); | 2115 pColorText = TargetColor(0xFFu, 0xFFu, 0x9Bu); |
2116 if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum ) | 2116 if ( pDialogueWindow->pCurrentPosActiveItem != i ) |
2117 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); | 2117 pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu); |
2118 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[pButton->msg_param - 36], 3); | 2118 dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[pButton->msg_param - 36], 3); |
2119 } | 2119 } |
2120 } | 2120 } |
2121 return; | 2121 return; |