From: terencehill Date: Sat, 10 Oct 2015 11:32:08 +0000 (+0200) Subject: Merge branch 'master' into terencehill/menu_gametype_tooltips_2 X-Git-Tag: xonotic-v0.8.2~1808^2~1 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=03f978544a8b13a18cef1c7cc3dbcaba1c3aee4c Merge branch 'master' into terencehill/menu_gametype_tooltips_2 Conflicts: qcsrc/menu/xonotic/dialog_settings_game.qc --- 03f978544a8b13a18cef1c7cc3dbcaba1c3aee4c diff --cc qcsrc/menu/xonotic/dialog_settings_game.qc index cde5d40a6e,69ab675822..3c1503b297 --- a/qcsrc/menu/xonotic/dialog_settings_game.qc +++ b/qcsrc/menu/xonotic/dialog_settings_game.qc @@@ -12,14 -12,7 +12,14 @@@ CLASS(SettingSource, DataSource if (returns) returns(it.title, string_null); return it; } - METHOD(SettingSource, getEntryTooltip, entity(int i, void(string theTooltip) returns)) ++ METHOD(SettingSource, getEntryTooltip, entity(entity this, int i, void(string theTooltip) returns)) + { - Lazy l = SETTINGS[i]; ++ Lazy l = Settings[i]; + entity it = l.m_get(); + if (returns) returns(it.tooltip); + return it; + } - METHOD(SettingSource, reload, int(string filter)) { return SETTINGS_COUNT; } + METHOD(SettingSource, reload, int(entity this, string filter)) { return Settings_COUNT; } ENDCLASS(SettingSource) #include "listbox.qc" @@@ -53,7 -38,7 +53,7 @@@ CLASS(XonoticRegisteredSettingsList, Xo METHOD(XonoticRegisteredSettingsList, drawListBoxItem, void(entity this, int i, vector absSize, bool isSelected, bool isFocused)) { if (!this.source) return; - if (!this.source.getEntry(i, XonoticRegisteredSettingsList_getNameIcon_cb)) return; - if (!this.source.getEntry(this.source, i, XonoticRegisteredSettingsList_cb)) return; ++ if (!this.source.getEntry(this.source, i, XonoticRegisteredSettingsList_getNameIcon_cb)) return; string name = XonoticRegisteredSettingsList_cb_name; if (isSelected) { draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED); @@@ -64,26 -49,6 +64,26 @@@ string s = draw_TextShortenToWidth(strdecolorize(name), 1, 0, this.realFontSize); draw_Text(this.realUpperMargin * eY + (0.5 * this.realFontSize.x) * eX, s, this.realFontSize, '1 1 1', SKINALPHA_TEXT, 0); } + + METHOD(XonoticRegisteredSettingsList, focusedItemChangeNotify, void(entity this)) + { + if (this.focusedItem == -1 || !this.source) + { + clearTooltip(this); + return; + } - if (!this.source.getEntryTooltip(this.focusedItem, XonoticRegisteredSettingsList_getTooltip_cb)) ++ if (!this.source.getEntryTooltip(this, this.focusedItem, XonoticRegisteredSettingsList_getTooltip_cb)) + { + clearTooltip(this); + return; + } + string theTooltip = XonoticRegisteredSettingsList_cb_tooltip; + if(theTooltip != "") + setZonedTooltip(this, theTooltip, string_null); + else + clearTooltip(this); + } + METHOD(XonoticRegisteredSettingsList, refilter, void(entity this)) { if (!this.source) {