From a6097ae400666a752ec7ea1706f15c20f476e5a2 Mon Sep 17 00:00:00 2001 From: Beu Date: Tue, 26 Sep 2023 22:13:56 +0200 Subject: [PATCH] improve cam update --- BlocksItemsCounter/Source/Libs/Objects.as | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/BlocksItemsCounter/Source/Libs/Objects.as b/BlocksItemsCounter/Source/Libs/Objects.as index bcfbc9c..7f7f1b4 100644 --- a/BlocksItemsCounter/Source/Libs/Objects.as +++ b/BlocksItemsCounter/Source/Libs/Objects.as @@ -174,10 +174,8 @@ void AddNewObject(const string &in objectname, int trigger, const string &in typ bool FocusCam(const string &in objectname) { auto editor = cast(GetApp().Editor); auto camera = editor.OrbitalCameraControl; - auto map = GetApp().RootMap; - - if (camera !is null) { + if (camera !is null) { int index = objectsindex.Find(objectname); camerafocusindex++; @@ -188,8 +186,11 @@ bool FocusCam(const string &in objectname) { camera.m_TargetedPosition = objects[index].positions[camerafocusindex]; // Workaround to update camera TargetedPosition + auto m_ParamScrollZoomPowe = camera.m_ParamScrollZoomPower; + camera.m_ParamScrollZoomPower = 0; editor.ButtonZoomInOnClick(); - editor.ButtonZoomOutOnClick(); + camera.m_ParamScrollZoomPower = m_ParamScrollZoomPowe; + return true; } return false;