void CMenuPlayer::UpdateControls() { const RANK* pRank = g_pPlayerStats->GetRank(); if (pRank) m_pRank->GetColumn(1)->SetString(LoadTempString(pRank->nNameId)); else m_pRank->GetColumn(1)->SetString("<error>"); char szTmp[32]; sprintf(szTmp,"%d",g_pPlayerStats->GetTotalSkillPoints()); m_pTotal->GetColumn(1)->SetString(szTmp); m_pTotal->Show(!IsMultiplayerGame()); sprintf(szTmp,"%d",g_pPlayerStats->GetAvailSkillPoints()); m_pAvail->GetColumn(1)->SetString(szTmp); m_pAvail->Show(!IsMultiplayerGame()); for (uint8 i = 0; i < kNumSkills; i++) { eSkill skl = (eSkill)i; if (m_pSkills[i]) { eSkillLevel lvl = (eSkillLevel)g_pPlayerStats->GetSkillLevel(skl); m_pSkills[i]->SetSkillLevel(lvl); } } if (m_Popup.IsVisible()) UpdatePopup(); }
void NUIRenderHandler::OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList& dirtyRects, const void* buffer, int width, int height) { // OnPaint shouldn't be reached anymore //assert(!"NUIRenderHandler::OnPaint"); return; if (m_owner->GetWindowValid()) { // lock the window lock auto& lock = m_owner->GetWindowLock(); lock.lock(); // paint the buffer if (type == PET_VIEW) { PaintView(dirtyRects, buffer, width, height); } else if (type == PET_POPUP) { PaintPopup(buffer, width, height); } // invalidate and paint the popup UpdatePopup(); // mark the render buffer as dirty m_owner->GetWindow()->MarkRenderBufferDirty(); // unlock the lock lock.unlock(); } }
void PaletteSubDialog::LoadPalette(Int32 id) { GeDynamicArray<Palette> pals; Palette::GetPalettes(pals); m_palette = pals[id]; m_palette.m_name = pals[id].m_name; m_paletteID = id; PaletteLayout(); UpdatePopup(id); }
uint32 CMenuPlayer::OnCommand(uint32 nCommand, uint32 nParam1, uint32 nParam2) { if (m_Popup.m_bWaitForUpdate) { if (nCommand == MC_UPDATE) { m_Popup.m_bWaitForUpdate = LTFALSE; // g_pInterfaceMgr->GetMenuMgr()->HideSubMenu(true); UpdateControls(); } return 1; } if (nCommand == MC_UPGRADE && m_Upgrade.IsEnabled()) { CAutoMessage cMsg; cMsg.Writeuint8(MID_PLAYER_SKILLS); cMsg.Writeuint8((uint8)g_nSkill); g_pLTClient->SendToServer(cMsg.Read(), MESSAGE_GUARANTEED); m_Popup.m_bWaitForUpdate = LTTRUE; // Play upgrade sound... g_pClientSoundMgr->PlayInterfaceSound("Interface\\Snd\\upgraded_skill.wav"); } else if (nCommand >= MC_CUSTOM) { g_nSkill = nCommand - MC_CUSTOM; UpdatePopup(); m_Points.SetString(FormatTempString(IDS_SKILL_AVAIL,g_pPlayerStats->GetAvailSkillPoints())); m_Popup.ClearSelection(); m_Popup.PreviousSelection(); UpdateModText(true); g_pInterfaceMgr->GetMenuMgr()->ShowSubMenu(&m_Popup); } else { return CBaseMenu::OnCommand(nCommand,nParam1,nParam2); } return 1; }