Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: binaries/data/mods/mod/gui/gui.rnc
- ===================================================================
- --- binaries/data/mods/mod/gui/gui.rnc (revision 19029)
- +++ binaries/data/mods/mod/gui/gui.rnc (working copy)
- @@ -71,6 +71,7 @@
- attribute scrollbar { bool }?&
- attribute scrollbar_style { text }?&
- attribute scroll_bottom { bool }?&
- + attribute scroll_top { bool }?&
- attribute selected_column { text }?&
- attribute selected_column_order { text }?&
- attribute sortable { bool }?&
- Index: binaries/data/mods/mod/gui/gui.rng
- ===================================================================
- --- binaries/data/mods/mod/gui/gui.rng (revision 19029)
- +++ binaries/data/mods/mod/gui/gui.rng (working copy)
- @@ -290,6 +290,11 @@
- </attribute>
- </optional>
- <optional>
- + <attribute name="scroll_top">
- + <ref name="bool"/>
- + </attribute>
- + </optional>
- + <optional>
- <attribute name="selected_column"/>
- </optional>
- <optional>
- Index: binaries/data/mods/public/gui/credits/credits.xml
- ===================================================================
- --- binaries/data/mods/public/gui/credits/credits.xml (revision 19029)
- +++ binaries/data/mods/public/gui/credits/credits.xml (working copy)
- @@ -28,7 +28,7 @@
- </object>
- <object type="image" sprite="ModernFade" size="220 30 100%-20 100%-54">
- - <object name="creditsText" type="text" style="textPanel"/>
- + <object name="creditsText" type="text" style="textPanel" scroll_top="true" />
- </object>
- <!-- Close dialog -->
- Index: source/gui/CText.cpp
- ===================================================================
- --- source/gui/CText.cpp (revision 19029)
- +++ source/gui/CText.cpp (working copy)
- @@ -34,6 +34,7 @@
- AddSetting(GUIST_bool, "scrollbar");
- AddSetting(GUIST_CStr, "scrollbar_style");
- AddSetting(GUIST_bool, "scroll_bottom");
- + AddSetting(GUIST_bool, "scroll_top");
- AddSetting(GUIST_CGUISpriteInstance, "sprite");
- AddSetting(GUIST_EAlign, "text_align");
- AddSetting(GUIST_EVAlign, "text_valign");
- @@ -97,8 +98,9 @@
- // Setup scrollbar
- if (scrollbar)
- {
- - bool scrollbottom = false;
- - GUI<bool>::GetSetting(this, "scroll_bottom", scrollbottom);
- + bool scroll_top = false, scroll_bottom = false;
- + GUI<bool>::GetSetting(this, "scroll_bottom", scroll_bottom);
- + GUI<bool>::GetSetting(this, "scroll_top", scroll_top);
- // If we are currently scrolled to the bottom of the text,
- // then add more lines of text, update the scrollbar so we
- @@ -105,7 +107,7 @@
- // stick to the bottom.
- // (Use 1.5px delta so this triggers the first time caption is set)
- bool bottom = false;
- - if (scrollbottom && GetScrollBar(0).GetPos() > GetScrollBar(0).GetMaxPos() - 1.5f)
- + if (scroll_bottom && GetScrollBar(0).GetPos() > GetScrollBar(0).GetMaxPos() - 1.5f)
- bottom = true;
- GetScrollBar(0).SetScrollRange(m_GeneratedTexts[0]->m_Size.cy);
- @@ -118,6 +120,8 @@
- if (bottom)
- GetScrollBar(0).SetPos(GetScrollBar(0).GetMaxPos());
- + if (scroll_top)
- + GetScrollBar(0).SetPos(0.0f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement