Moved UIRoutines call order. Call FinalizeChanges. Fixed UI Button Events. #359
|
@ -372,21 +372,21 @@ namespace SHADE
|
||||||
SHEventHandle SHScriptEngine::onUIElementReleased(SHEventPtr eventPtr)
|
SHEventHandle SHScriptEngine::onUIElementReleased(SHEventPtr eventPtr)
|
||||||
{
|
{
|
||||||
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
|
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
|
||||||
csUIElementOnClicked(eventData->data->EID);
|
csUIElementOnRemoved(eventData->data->EID);
|
||||||
return eventData->handle;
|
return eventData->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
SHEventHandle SHScriptEngine::onUIElementOnHoverEntered(SHEventPtr eventPtr)
|
SHEventHandle SHScriptEngine::onUIElementOnHoverEntered(SHEventPtr eventPtr)
|
||||||
{
|
{
|
||||||
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
|
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
|
||||||
csUIElementOnClicked(eventData->data->EID);
|
csUIElementOnHoverEntered(eventData->data->EID);
|
||||||
return eventData->handle;
|
return eventData->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
SHEventHandle SHScriptEngine::onUIElementOnHoverExited(SHEventPtr eventPtr)
|
SHEventHandle SHScriptEngine::onUIElementOnHoverExited(SHEventPtr eventPtr)
|
||||||
{
|
{
|
||||||
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
|
auto eventData = reinterpret_cast<const SHEventSpec<SHButtonClickEvent>*>(eventPtr.get());
|
||||||
csUIElementOnClicked(eventData->data->EID);
|
csUIElementOnHoverExited(eventData->data->EID);
|
||||||
return eventData->handle;
|
return eventData->handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
onReleasedEventMap[entity]->Invoke();
|
onReleasedEventMap[entity]->Invoke();
|
||||||
}
|
}
|
||||||
SAFE_NATIVE_CALL_END("UIElement.OnClicked")
|
SAFE_NATIVE_CALL_END("UIElement.OnReleased")
|
||||||
}
|
}
|
||||||
void UIElement::OnHoverEntered(EntityID entity)
|
void UIElement::OnHoverEntered(EntityID entity)
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,7 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
onHoverEnterEventMap[entity]->Invoke();
|
onHoverEnterEventMap[entity]->Invoke();
|
||||||
}
|
}
|
||||||
SAFE_NATIVE_CALL_END("UIElement.OnClicked")
|
SAFE_NATIVE_CALL_END("UIElement.OnHoverEntered")
|
||||||
}
|
}
|
||||||
void UIElement::OnHoverExited(EntityID entity)
|
void UIElement::OnHoverExited(EntityID entity)
|
||||||
{
|
{
|
||||||
|
@ -163,6 +163,6 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
onHoverExitEventMap[entity]->Invoke();
|
onHoverExitEventMap[entity]->Invoke();
|
||||||
}
|
}
|
||||||
SAFE_NATIVE_CALL_END("UIElement.OnClicked")
|
SAFE_NATIVE_CALL_END("UIElement.OnHoverExited")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue