Index: sources/Client/EterPythonLib/PythonWindow.cpp =================================================================== --- sources/Client/EterPythonLib/PythonWindow.cpp (revision 8589) +++ sources/Client/EterPythonLib/PythonWindow.cpp (revision 8590) @@ -1609,12 +1609,17 @@ { m_byDelay = iDelay; } - void CAniImageBox::AppendImage(const char* c_szFileName - #ifdef ENABLE_ACCE_COSTUME_SYSTEM - , float r, float g, float b, float a - #endif - ) + + #ifdef ENABLE_HIGHLIGHT_NEW_ITEM + void CAniImageBox::SetDiffuseColor(const D3DXCOLOR & color) { + for (auto & elem : m_ImageVector) + elem->SetDiffuseColor(color.r, color.g, color.b, color.a); + } + #endif + + void CAniImageBox::AppendImage(const char * c_szFileName) + { CResource * pResource = CResourceManager::Instance().GetResourcePointer(c_szFileName); if (!pResource->IsType(CGraphicImage::Type())) return; @@ -1621,9 +1626,6 @@ CGraphicExpandedImageInstance * pImageInstance = CGraphicExpandedImageInstance::New(); pImageInstance->SetImagePointer(static_cast(pResource)); -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - pImageInstance->SetDiffuseColor(r, g, b, a); -#endif if (pImageInstance->IsEmpty()) { Index: sources/Client/EterPythonLib/PythonWindowManagerModule.cpp =================================================================== --- sources/Client/EterPythonLib/PythonWindowManagerModule.cpp (revision 8589) +++ sources/Client/EterPythonLib/PythonWindowManagerModule.cpp (revision 8590) @@ -1339,8 +1339,14 @@ if (!pWin->IsType(UI::CSlotWindow::Type())) return Py_BuildException(); + D3DXCOLOR color = { 1.f, 1.f, 1.f, 1.f }; + PyTuple_GetFloat(poArgs, 2, &color.r); + PyTuple_GetFloat(poArgs, 3, &color.g); + PyTuple_GetFloat(poArgs, 4, &color.b); + PyTuple_GetFloat(poArgs, 5, &color.a); + UI::CSlotWindow * pSlotWin = (UI::CSlotWindow *)pWin; - pSlotWin->ActivateSlot(iSlotIndex); + pSlotWin->ActivateSlot(iSlotIndex, color); return Py_BuildNone(); } @@ -2372,57 +2378,6 @@ return Py_BuildNone(); } -#ifdef ENABLE_ACCE_COSTUME_SYSTEM -PyObject* wndMgrActivateEffect(PyObject* poSelf, PyObject* poArgs) -{ - UI::CWindow* pWin; - if (!PyTuple_GetWindow(poArgs, 0, &pWin)) - return Py_BuildException(); - - int iSlotIndex; - if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex)) - return Py_BuildException(); - - if (!pWin->IsType(UI::CSlotWindow::Type())) - return Py_BuildException(); - - float r, g, b, a; - if (!PyTuple_GetFloat(poArgs, 2, &r)) - return Py_BuildException(); - - if (!PyTuple_GetFloat(poArgs, 3, &g)) - return Py_BuildException(); - - if (!PyTuple_GetFloat(poArgs, 4, &b)) - return Py_BuildException(); - - if (!PyTuple_GetFloat(poArgs, 5, &a)) - return Py_BuildException(); - - UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin; - pSlotWin->ActivateEffect(iSlotIndex, r, g, b, a); - return Py_BuildNone(); -} - -PyObject* wndMgrDeactivateEffect(PyObject* poSelf, PyObject* poArgs) -{ - UI::CWindow* pWin; - if (!PyTuple_GetWindow(poArgs, 0, &pWin)) - return Py_BuildException(); - - int iSlotIndex; - if (!PyTuple_GetInteger(poArgs, 1, &iSlotIndex)) - return Py_BuildException(); - - if (!pWin->IsType(UI::CSlotWindow::Type())) - return Py_BuildException(); - - UI::CSlotWindow* pSlotWin = (UI::CSlotWindow*)pWin; - pSlotWin->DeactivateEffect(iSlotIndex); - return Py_BuildNone(); -} -#endif - PyObject* wndSetAniImgScale(PyObject* poSelf, PyObject* poArgs) { UI::CWindow* pWindow; @@ -2643,20 +2598,11 @@ { "SetOutlineFlag", wndMgrSetOutlineFlag, METH_VARARGS }, { "ShowOverInWindowName", wndMgrShowOverInWindowName, METH_VARARGS }, -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - { "ActivateEffect", wndMgrActivateEffect, METH_VARARGS }, - { "DeactivateEffect", wndMgrDeactivateEffect, METH_VARARGS }, -#endif - { NULL, NULL, NULL }, }; PyObject * poModule = Py_InitModule("wndMgr", s_methods); -// PyObject * poMgrModule = Py_InitModule("wndMgr", s_methods); -// PyObject * poTextModule = Py_InitModule("wndText", s_methods); -// PyObject * poSlotModule = Py_InitModule("wndSlot", s_methods); - PyModule_AddIntConstant(poModule, "SLOT_STYLE_NONE", UI::SLOT_STYLE_NONE); PyModule_AddIntConstant(poModule, "SLOT_STYLE_PICK_UP", UI::SLOT_STYLE_PICK_UP); PyModule_AddIntConstant(poModule, "SLOT_STYLE_SELECT", UI::SLOT_STYLE_SELECT); Index: sources/Client/EterPythonLib/PythonSlotWindow.cpp =================================================================== --- sources/Client/EterPythonLib/PythonSlotWindow.cpp (revision 8589) +++ sources/Client/EterPythonLib/PythonSlotWindow.cpp (revision 8590) @@ -218,9 +218,6 @@ Slot.pSlotButton = NULL; Slot.pSignImage = NULL; Slot.pFinishCoolTimeEffect = NULL; -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - memset(Slot.pActiveSlotEffect, 0, sizeof(Slot.pActiveSlotEffect)); -#endif ClearSlot(&Slot); Slot.dwSlotNumber = dwIndex; @@ -558,7 +555,7 @@ pSlot->fStartCoolTime = CTimer::Instance().GetCurrentSecond() - fElapsedTime; } -void CSlotWindow::ActivateSlot(DWORD dwIndex) +void CSlotWindow::ActivateSlot(DWORD dwIndex, const D3DXCOLOR& color) { TSlot * pSlot; if (!GetSlotPointer(dwIndex, &pSlot)) @@ -565,15 +562,18 @@ return; pSlot->bActive = TRUE; +#ifdef ENABLE_HIGHLIGHT_NEW_ITEM + pSlot->Color = color; +#endif if (!m_pSlotActiveEffect #ifdef ENABLE_HIGHLIGHT_NEW_ITEM || !m_pSlotActiveEffectSlot2 || !m_pSlotActiveEffectSlot3 #endif ) - { __CreateSlotEnableEffect(); - } } void CSlotWindow::DeactivateSlot(DWORD dwIndex) @@ -630,13 +630,6 @@ { pSlot->pFinishCoolTimeEffect->Hide(); } -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - for (auto& pEff : pSlot->pActiveSlotEffect) - { - if (pEff) - pEff->Hide(); - } -#endif } void CSlotWindow::ClearAllSlot() @@ -1023,16 +1016,6 @@ if (!GetSlotPointer(dwSlotIndex, &pSlot)) continue; __DestroyFinishCoolTimeEffect(pSlot); -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - for (auto& pEff : pSlot->pActiveSlotEffect) - { - if (pEff) - { - delete pEff; - pEff = NULL; - } - } -#endif } m_ReserveDestroyEffectDeque.clear(); @@ -1159,23 +1142,6 @@ rSlot.pFinishCoolTimeEffect->Render(); } -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - { - int iX = m_rect.left + rSlot.ixPosition, iY = m_rect.top + rSlot.iyPosition, iItemYSize = rSlot.byyPlacedItemSize; - for (int i = 0; i < 3; ++i) - { - auto& pEff = rSlot.pActiveSlotEffect[i]; - if ((pEff) && (iItemYSize == i + 1)) - { - pEff->Show(); - pEff->SetPosition(iX, iY); - pEff->Update(); - pEff->Render(); - } - } - } -#endif - if (rSlot.bActive) { if (m_pSlotActiveEffect && rSlot.byyPlacedItemSize==1) @@ -1182,6 +1148,9 @@ { int ix = m_rect.left + rSlot.ixPosition; int iy = m_rect.top + rSlot.iyPosition; + #ifdef ENABLE_HIGHLIGHT_NEW_ITEM + m_pSlotActiveEffect->SetDiffuseColor(rSlot.Color); + #endif m_pSlotActiveEffect->SetPosition(ix, iy); m_pSlotActiveEffect->Render(); } @@ -1190,6 +1159,7 @@ { int ix = m_rect.left + rSlot.ixPosition; int iy = m_rect.top + rSlot.iyPosition; + m_pSlotActiveEffectSlot2->SetDiffuseColor(rSlot.Color); m_pSlotActiveEffectSlot2->SetPosition(ix, iy); m_pSlotActiveEffectSlot2->Render(); } @@ -1197,6 +1167,7 @@ { int ix = m_rect.left + rSlot.ixPosition; int iy = m_rect.top + rSlot.iyPosition; + m_pSlotActiveEffectSlot3->SetDiffuseColor(rSlot.Color); m_pSlotActiveEffectSlot3->SetPosition(ix, iy); m_pSlotActiveEffectSlot3->Render(); } @@ -1372,54 +1343,6 @@ return s_Type; } -#ifdef ENABLE_ACCE_COSTUME_SYSTEM -void CSlotWindow::ActivateEffect(DWORD dwSlotIndex, float r, float g, float b, float a) -{ - TSlot* pSlot; - if (!GetSlotPointer(dwSlotIndex, &pSlot)) - return; - - for (int i = 0; i < 3; ++i) - { - auto& pActiveEff = pSlot->pActiveSlotEffect[i]; - - if (pActiveEff) - { - delete pActiveEff; - pActiveEff = NULL; - } - - const int ciImageCount = 12; - - pActiveEff = new CAniImageBox(NULL); - for (int j = 0; j <= ciImageCount; ++j) - { - char cBuf[72]; - snprintf(cBuf, sizeof(cBuf), "d:/ymir work/ui/public/slotactiveeffect/slot%d/%02d.sub", (i + 1), j); - pActiveEff->AppendImage(cBuf, r, g, b, a); - } - - pActiveEff->SetRenderingMode(CGraphicExpandedImageInstance::RENDERING_MODE_SCREEN); - } -} - -void CSlotWindow::DeactivateEffect(DWORD dwSlotIndex) -{ - TSlot* pSlot; - if (!GetSlotPointer(dwSlotIndex, &pSlot)) - return; - - for (auto& pActiveEff : pSlot->pActiveSlotEffect) - { - if (pActiveEff) - { - delete pActiveEff; - pActiveEff = NULL; - } - } -} -#endif - BOOL CSlotWindow::OnIsType(DWORD dwType) { if (CSlotWindow::Type() == dwType) @@ -1624,13 +1547,6 @@ { CWindowManager::Instance().DestroyWindow(rSlot.pFinishCoolTimeEffect); } -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - for (auto& pEff : rSlot.pActiveSlotEffect) - { - if (pEff) - CWindowManager::Instance().DestroyWindow(pEff); - } -#endif } m_SlotList.clear(); Index: sources/Client/EterPythonLib/PythonWindow.h =================================================================== --- sources/Client/EterPythonLib/PythonWindow.h (revision 8589) +++ sources/Client/EterPythonLib/PythonWindow.h (revision 8590) @@ -429,11 +429,10 @@ virtual ~CAniImageBox(); void SetDelay(int iDelay); - void AppendImage(const char* c_szFileName - #ifdef ENABLE_ACCE_COSTUME_SYSTEM - , float r = 1.0, float g = 1.0, float b = 1.0, float a = 1.0 - #endif - ); + #ifdef ENABLE_HIGHLIGHT_NEW_ITEM + void SetDiffuseColor(const D3DXCOLOR& color); + #endif + void AppendImage(const char* c_szFileName); void SetRenderingRect(float fLeft, float fTop, float fRight, float fBottom); void SetRenderingMode(int iMode); void SetAniImgScale(float x, float y); Index: sources/Client/EterPythonLib/PythonSlotWindow.h =================================================================== --- sources/Client/EterPythonLib/PythonSlotWindow.h (revision 8589) +++ sources/Client/EterPythonLib/PythonSlotWindow.h (revision 8590) @@ -55,6 +55,9 @@ // Toggle BOOL bActive; + #ifdef ENABLE_HIGHLIGHT_NEW_ITEM + D3DXCOLOR Color{1.f, 1.f, 1.f, 1.f}; + #endif int ixPosition; int iyPosition; @@ -73,9 +76,6 @@ CSlotButton * pSlotButton; CImageBox * pSignImage; CAniImageBox * pFinishCoolTimeEffect; -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - CAniImageBox* pActiveSlotEffect[3]; -#endif } TSlot; typedef std::list TSlotList; typedef TSlotList::iterator TSlotListIterator; @@ -113,7 +113,7 @@ void SetSlotCount(DWORD dwIndex, DWORD dwCount); void SetSlotCountNew(DWORD dwIndex, DWORD dwGrade, DWORD dwCount); void SetSlotCoolTime(DWORD dwIndex, float fCoolTime, float fElapsedTime = 0.0f); - void ActivateSlot(DWORD dwIndex); + void ActivateSlot(DWORD dwIndex, const D3DXCOLOR& color); void DeactivateSlot(DWORD dwIndex); void RefreshSlot(); @@ -156,11 +156,6 @@ // CallBack void ReserveDestroyCoolTimeFinishEffect(DWORD dwSlotIndex); -#ifdef ENABLE_ACCE_COSTUME_SYSTEM - void ActivateEffect(DWORD dwSlotIndex, float r, float g, float b, float a); - void DeactivateEffect(DWORD dwSlotIndex); -#endif - protected: void __Initialize(); void __CreateToggleSlotImage(); Index: trunk/client/data/packs/root/ui.py =================================================================== --- trunk/client/data/packs/root/ui.py (revision 8589) +++ trunk/client/data/packs/root/ui.py (revision 8590) @@ -1625,25 +1625,12 @@ def HideRequirementSign(self, slotNumber): wndMgr.HideRequirementSign(self.hWnd, slotNumber) - if app.ENABLE_ACCE_COSTUME_SYSTEM: - def ActivateSlot(self, slotNumber, r = 1.0, g = 1.0, b = 1.0, a = 1.0): - wndMgr.ActivateEffect(self.hWnd, slotNumber, r, g, b, a) + def ActivateSlot(self, slotNumber, r = 1.0, g = 1.0, b = 1.0, a = 1.0): + wndMgr.ActivateSlot(self.hWnd, slotNumber, r, g, b, a) - def DeactivateSlot(self, slotNumber): - wndMgr.DeactivateEffect(self.hWnd, slotNumber) + def DeactivateSlot(self, slotNumber): + wndMgr.DeactivateSlot(self.hWnd, slotNumber) - def ActivateSlotOld(self, slotNumber): - wndMgr.ActivateSlot(self.hWnd, slotNumber) - - def DeactivateSlotOld(self, slotNumber): - wndMgr.DeactivateSlot(self.hWnd, slotNumber) - else: - def ActivateSlot(self, slotNumber): - wndMgr.ActivateSlot(self.hWnd, slotNumber) - - def DeactivateSlot(self, slotNumber): - wndMgr.DeactivateSlot(self.hWnd, slotNumber) - def ShowSlotBaseImage(self, slotNumber): wndMgr.ShowSlotBaseImage(self.hWnd, slotNumber) Index: trunk/client/data/packs/root/uiCharacter.py =================================================================== --- trunk/client/data/packs/root/uiCharacter.py (revision 8589) +++ trunk/client/data/packs/root/uiCharacter.py (revision 8590) @@ -1126,10 +1126,7 @@ for slotWindow in self.skillPageDict.itervalues(): if slotWindow.HasSlot(slotIndex): - if app.ENABLE_ACCE_COSTUME_SYSTEM: - slotWindow.ActivateSlotOld(slotIndex) - else: - slotWindow.ActivateSlot(slotIndex) + slotWindow.ActivateSlot(slotIndex) return def OnDeactivateSkill(self, slotIndex): @@ -1138,10 +1135,7 @@ for slotWindow in self.skillPageDict.itervalues(): if slotWindow.HasSlot(slotIndex): - if app.ENABLE_ACCE_COSTUME_SYSTEM: - slotWindow.DeactivateSlotOld(slotIndex) - else: - slotWindow.DeactivateSlot(slotIndex) + slotWindow.DeactivateSlot(slotIndex) return def __ShowJobToolTip(self):