From: terencehill Date: Sat, 31 Mar 2018 00:28:59 +0000 (+0200) Subject: Menu: fix #1991 "State of items in Game Settings tabs aren't automatically updated... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=00c875120e97f999bba76ecba58688a589ba9ded;p=xonotic%2Fxonotic-data.pk3dir.git Menu: fix #1991 "State of items in Game Settings tabs aren't automatically updated on tab change" --- diff --git a/qcsrc/menu/xonotic/dialog_settings_game.qc b/qcsrc/menu/xonotic/dialog_settings_game.qc index 87134cb78..f2864030a 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game.qc @@ -110,6 +110,7 @@ METHOD(XonoticGameSettingsTab, topicChangeNotify, void(entity, entity this)) adding.resizeNotify(adding, '0 0 0', c.size, '0 0 0', c.size); c.addItem(c, adding, '0 0 0', '1 1 0', 1); s.resizeNotify(s, '0 0 0', s.size, '0 0 0', s.size); + s.showNotify(s); } } METHOD(XonoticGameSettingsTab, fill, void(entity this)) diff --git a/qcsrc/menu/xonotic/scrollpanel.qc b/qcsrc/menu/xonotic/scrollpanel.qc index 4543f0bc4..22413e8b6 100644 --- a/qcsrc/menu/xonotic/scrollpanel.qc +++ b/qcsrc/menu/xonotic/scrollpanel.qc @@ -6,6 +6,12 @@ METHOD(XonoticScrollPanel, drawListBoxItem, void(XonoticScrollPanel this, int i, p.draw(p); } +METHOD(XonoticScrollPanel, showNotify, void(XonoticScrollPanel this)) +{ + XonoticTab p = this.currentPanel; + p.showNotify(p); +} + METHOD(XonoticScrollPanel, resizeNotify, void(XonoticScrollPanel this, vector relOrigin, vector relSize, vector absOrigin, vector absSize)) { SUPER(XonoticScrollPanel).resizeNotify(this, relOrigin, relSize, absOrigin, absSize); diff --git a/qcsrc/menu/xonotic/scrollpanel.qh b/qcsrc/menu/xonotic/scrollpanel.qh index b00c8af8a..826e19bed 100644 --- a/qcsrc/menu/xonotic/scrollpanel.qh +++ b/qcsrc/menu/xonotic/scrollpanel.qh @@ -26,5 +26,6 @@ CLASS(XonoticScrollPanel, XonoticListBox) METHOD(XonoticScrollPanel, setSelected, void(XonoticScrollPanel this, int i)) { } METHOD(XonoticScrollPanel, drawListBoxItem, void(XonoticScrollPanel this, int i, vector absSize, bool isSelected, bool isFocused)); + METHOD(XonoticScrollPanel, showNotify, void(XonoticScrollPanel this)); METHOD(XonoticScrollPanel, resizeNotify, void(XonoticScrollPanel this, vector relOrigin, vector relSize, vector absOrigin, vector absSize)); ENDCLASS(XonoticScrollPanel)