From b0b9e291f6efb55a2177362c5ced7135eba3f2f2 Mon Sep 17 00:00:00 2001 From: Marisa the Magician Date: Wed, 22 Jun 2022 12:41:02 +0200 Subject: [PATCH] Fix jumpy chat tab --- language.version | 4 ++-- zscript/kbase/swwm_kbasetab_chat.zsc | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/language.version b/language.version index 978ff3a2f..19bc4d87b 100644 --- a/language.version +++ b/language.version @@ -1,3 +1,3 @@ [default] -SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.29 \cu(Wed 22 Jun 01:52:57 CEST 2022)\c-"; -SWWM_SHORTVER="\cw1.2.29 \cu(2022-06-22 01:52:57)\c-"; +SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.28 r2 \cu(Wed 22 Jun 23:39:42 CEST 2022)\c-"; +SWWM_SHORTVER="\cw1.2.28 r2 \cu(2022-06-22 23:39:42)\c-"; diff --git a/zscript/kbase/swwm_kbasetab_chat.zsc b/zscript/kbase/swwm_kbasetab_chat.zsc index 36fbb7242..23d7b93ed 100644 --- a/zscript/kbase/swwm_kbasetab_chat.zsc +++ b/zscript/kbase/swwm_kbasetab_chat.zsc @@ -6,12 +6,14 @@ Class DemolitionistChatTab : DemolitionistMenuTab int ofs, maxofs; double smofs; bool drag; + bool justopened; SWWMFullHistory hist; override DemolitionistMenuTab Init( DemolitionistMenu master ) { title = StringTable.Localize("$SWWM_CHATTAB"); hist = SWWMFullHistory.Get(); + justopened = true; return Super.Init(master); } @@ -24,6 +26,7 @@ Class DemolitionistChatTab : DemolitionistMenuTab override void OnSelect() { smofs = ofs; + justopened = true; } override void OnDeselect() { @@ -76,7 +79,8 @@ Class DemolitionistChatTab : DemolitionistMenuTab if ( recenter ) ofs = maxofs; // update smooth scroll smofs = (smofs*.6)+(ofs*.4); - if ( abs(smofs-ofs) < (1./master.hs) ) smofs = ofs; + if ( (abs(smofs-ofs) < (1./master.hs)) || justopened ) smofs = ofs; + justopened = false; // tick the list (not really needed, as elements don't dynamically update anything) msglist.Ticker(); }