Honorable Member Owsap 8173 Posted September 18, 2019 Honorable Member Share Posted September 18, 2019 First of all I know this is kind useless but for the sake of enabling and disabling the flash effect in buttons I decided to use the standard flash function because I didn't know an easier way. Spoiler EterPythonLib/PythonWindow.cpp /// 1. // Search void CButton::Flash() { m_isFlash = true; } // Add below void CButton::EnableFlash() { m_isFlash = true; if (!m_overVisual.IsEmpty()) SetCurrentVisual(&m_overVisual); } void CButton::DisableFlash() { m_isFlash = false; if (!m_upVisual.IsEmpty()) SetCurrentVisual(&m_upVisual); } /// 2. // Search function void CButton::OnRender() // Replace with void CButton::OnRender() { if (!IsShow()) return; if (m_pcurVisual) { if (m_isFlash) { if (!IsIn() && !IsPressed()) { if (!m_overVisual.IsEmpty()) SetCurrentVisual(&m_overVisual); if (int(timeGetTime() / 500) % 2) return; } } m_pcurVisual->Render(); } PyCallClassMemberFunc(m_poHandler, "OnRender", BuildEmptyTuple()); } EterPythonLib/PythonWindow.h /// 1. // Search void Flash(); // Add below void EnableFlash(); void DisableFlash(); EterPythonLib/PythonWindowManagerModule.cpp /// 1. // Search PyObject * wndButtonFlash(PyObject * poSelf, PyObject * poArgs) { UI::CWindow * pWindow; if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) return Py_BuildException(); ((UI::CButton*)pWindow)->Flash(); return Py_BuildNone(); } // Add below PyObject* wndButtonEnableFlash(PyObject* poSelf, PyObject* poArgs) { UI::CWindow * pWindow; if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) return Py_BuildException(); ((UI::CButton*)pWindow)->EnableFlash(); return Py_BuildNone(); } PyObject* wndButtonDisableFlash(PyObject* poSelf, PyObject* poArgs) { UI::CWindow * pWindow; if (!PyTuple_GetWindow(poArgs, 0, &pWindow)) return Py_BuildException(); ((UI::CButton*)pWindow)->DisableFlash(); return Py_BuildNone(); } /// 2. // Search { "Flash", wndButtonFlash, METH_VARARGS }, // Add below { "EnableFlash", wndButtonEnableFlash, METH_VARARGS }, { "DisableFlash", wndButtonDisableFlash, METH_VARARGS }, ROOT/ui.py ''' 1. ''' # Search def Flash(self): wndMgr.Flash(self.hWnd) # Add below def EnableFlash(self): wndMgr.EnableFlash(self.hWnd) def DisableFlash(self): wndMgr.DisableFlash(self.hWnd) As for an example, here is a demonstration of the flash effect. 1 2 7 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Syriza 234 Posted September 18, 2019 Share Posted September 18, 2019 Very nice thank you could you please also show how you did the flash effect on the pet System ? Link to comment Share on other sites More sharing options...
ManiacRobert 429 Posted September 19, 2019 Share Posted September 19, 2019 Acum 3 ore, Syriza a spus: Very nice thank you could you please also show how you did the flash effect on the pet System ? Carefully. 1 Link to comment Share on other sites More sharing options...
IGNEEL 24 Posted September 19, 2019 Share Posted September 19, 2019 (edited) Il y a 4 heures, Syriza a dit : Very nice thank you could you please also show how you did the flash effect on the pet System ? Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Premium Hunger 472 Posted September 19, 2019 Premium Share Posted September 19, 2019 That would be a nice addon for the status&skill points buttons. 1 Link to comment Share on other sites More sharing options...
Recommended Posts