From: terencehill Date: Wed, 11 May 2022 21:32:02 +0000 (+0200) Subject: Revert "Menu: don't set intendedWidth for tabs, they get overridden by parent dialogs... X-Git-Tag: xonotic-v0.8.5~42 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=08fe4aab136c39b7a2c319dc7986eac753369a78;p=xonotic%2Fxonotic-data.pk3dir.git Revert "Menu: don't set intendedWidth for tabs, they get overridden by parent dialogs anyway", it fixes #2688 "Div by zero errors at menu" This reverts commit e7230c21f582fb61399daa4e8367ff4e24ee0f0e. --- diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create.qh b/qcsrc/menu/xonotic/dialog_multiplayer_create.qh index b6aee3a43..e27552286 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create.qh @@ -5,6 +5,7 @@ CLASS(XonoticServerCreateTab, XonoticTab) METHOD(XonoticServerCreateTab, fill, void(entity)); METHOD(XonoticServerCreateTab, gameTypeChangeNotify, void(entity)); METHOD(XonoticServerCreateTab, gameTypeSelectNotify, void(entity)); + ATTRIB(XonoticServerCreateTab, intendedWidth, float, 0.9); ATTRIB(XonoticServerCreateTab, rows, float, 23); ATTRIB(XonoticServerCreateTab, columns, float, 6.2); // added extra .2 for center space diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join.qh b/qcsrc/menu/xonotic/dialog_multiplayer_join.qh index 1769597e0..38744f366 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticServerListTab, XonoticTab) METHOD(XonoticServerListTab, fill, void(entity)); + ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9); ATTRIB(XonoticServerListTab, rows, float, 23); ATTRIB(XonoticServerListTab, columns, float, 6.5); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfotab.qh b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfotab.qh index 0cd2ec637..ed3515f99 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfotab.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfotab.qh @@ -5,6 +5,7 @@ CLASS(XonoticServerInfoTab, XonoticTab) METHOD(XonoticServerInfoTab, fill, void(entity)); ATTRIB(XonoticServerInfoTab, title, string, _("Server Information")); ATTRIB(XonoticServerInfoTab, color, vector, SKINCOLOR_DIALOG_SERVERINFO); + ATTRIB(XonoticServerInfoTab, intendedWidth, float, 0.8); ATTRIB(XonoticServerInfoTab, rows, float, 17); ATTRIB(XonoticServerInfoTab, columns, float, 6.2); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_join_termsofservice.qh b/qcsrc/menu/xonotic/dialog_multiplayer_join_termsofservice.qh index 0cbdcb1f5..ebc2d867e 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_join_termsofservice.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_join_termsofservice.qh @@ -6,6 +6,7 @@ CLASS(XonoticServerToSTab, XonoticTab) METHOD(XonoticServerToSTab, loadToS, void(entity, string)); ATTRIB(XonoticServerToSTab, title, string, _("Terms of Service")); ATTRIB(XonoticServerToSTab, color, vector, SKINCOLOR_DIALOG_SERVERINFO); + ATTRIB(XonoticServerToSTab, intendedWidth, float, 0.8); ATTRIB(XonoticServerToSTab, rows, float, 17); ATTRIB(XonoticServerToSTab, columns, float, 6.2); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media.qh b/qcsrc/menu/xonotic/dialog_multiplayer_media.qh index c6ecfb518..9713e82c2 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticMediaTab, XonoticTab) METHOD(XonoticMediaTab, fill, void(entity)); + ATTRIB(XonoticMediaTab, intendedWidth, float, 0.9); ATTRIB(XonoticMediaTab, rows, float, 23); ATTRIB(XonoticMediaTab, columns, float, 3); ATTRIB(XonoticMediaTab, name, string, "Media"); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qh b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qh index b90f4b870..cf3548d77 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticDemoBrowserTab, XonoticTab) METHOD(XonoticDemoBrowserTab, fill, void(entity)); + ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9); ATTRIB(XonoticDemoBrowserTab, rows, float, 21); ATTRIB(XonoticDemoBrowserTab, columns, float, 6.5); ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser"); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_musicplayer.qh b/qcsrc/menu/xonotic/dialog_multiplayer_media_musicplayer.qh index e13e23992..6172dae03 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_musicplayer.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_musicplayer.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticMusicPlayerTab, XonoticTab) METHOD(XonoticMusicPlayerTab, fill, void(entity)); + ATTRIB(XonoticMusicPlayerTab, intendedWidth, float, 0.9); ATTRIB(XonoticMusicPlayerTab, rows, float, 21); ATTRIB(XonoticMusicPlayerTab, columns, float, 6.5); ATTRIB(XonoticMusicPlayerTab, name, string, "MusicPlayer"); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qh b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qh index 3bc3dcfeb..66dc3cf07 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticScreenshotBrowserTab, XonoticTab) METHOD(XonoticScreenshotBrowserTab, fill, void(entity)); + ATTRIB(XonoticScreenshotBrowserTab, intendedWidth, float, 1); ATTRIB(XonoticScreenshotBrowserTab, rows, float, 21); ATTRIB(XonoticScreenshotBrowserTab, columns, float, 6.5); ATTRIB(XonoticScreenshotBrowserTab, name, string, "ScreenshotBrowser"); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qh b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qh index e0ff5a350..f346aaf66 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_profile.qh +++ b/qcsrc/menu/xonotic/dialog_multiplayer_profile.qh @@ -4,6 +4,7 @@ CLASS(XonoticProfileTab, XonoticTab) METHOD(XonoticProfileTab, fill, void(entity)); METHOD(XonoticProfileTab, draw, void(entity)); + ATTRIB(XonoticProfileTab, intendedWidth, float, 0.9); ATTRIB(XonoticProfileTab, rows, float, 23); ATTRIB(XonoticProfileTab, columns, float, 6.1); // added extra .2 for center space ATTRIB(XonoticProfileTab, playerNameLabel, entity); diff --git a/qcsrc/menu/xonotic/dialog_settings_audio.qh b/qcsrc/menu/xonotic/dialog_settings_audio.qh index 0eaff9858..5794a70cc 100644 --- a/qcsrc/menu/xonotic/dialog_settings_audio.qh +++ b/qcsrc/menu/xonotic/dialog_settings_audio.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticAudioSettingsTab, XonoticTab) METHOD(XonoticAudioSettingsTab, fill, void(entity)); + ATTRIB(XonoticAudioSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticAudioSettingsTab, rows, float, 15.5); ATTRIB(XonoticAudioSettingsTab, columns, float, 6.2); // added extra .2 for center space ATTRIB(XonoticAudioSettingsTab, hiddenMenuSoundsSlider, entity); diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.qh b/qcsrc/menu/xonotic/dialog_settings_effects.qh index 7a99a1406..369c68d91 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.qh +++ b/qcsrc/menu/xonotic/dialog_settings_effects.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticEffectsSettingsTab, XonoticTab) METHOD(XonoticEffectsSettingsTab, fill, void(entity)); + ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticEffectsSettingsTab, rows, float, 15.5); ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2); // added extra .2 for center space ENDCLASS(XonoticEffectsSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_game.qh b/qcsrc/menu/xonotic/dialog_settings_game.qh index 0f3ae8148..c0965c232 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game.qh @@ -34,6 +34,7 @@ ENDCLASS(XonoticRegisteredSettingsList) #include "tab.qh" #include "scrollpanel.qh" CLASS(XonoticGameSettingsTab, XonoticTab) + ATTRIB(XonoticGameSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameSettingsTab, columns, float, 6.5); ATTRIB(XonoticGameSettingsTab, source, DataSource, NEW(SettingSource)); diff --git a/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qh b/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qh index ed15b1e0b..33576a3ec 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game_crosshair.qh @@ -5,6 +5,7 @@ CLASS(XonoticGameCrosshairSettingsTab, XonoticTab) METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity)); METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity)); ATTRIB(XonoticGameCrosshairSettingsTab, title, string, _("Crosshair")); + ATTRIB(XonoticGameCrosshairSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameCrosshairSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameCrosshairSettingsTab, columns, float, 6.2); ENDCLASS(XonoticGameCrosshairSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_game_hud.qh b/qcsrc/menu/xonotic/dialog_settings_game_hud.qh index 108b09d4a..a9851dc63 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_hud.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game_hud.qh @@ -5,6 +5,7 @@ CLASS(XonoticGameHUDSettingsTab, XonoticTab) METHOD(XonoticGameHUDSettingsTab, fill, void(entity)); METHOD(XonoticGameHUDSettingsTab, showNotify, void(entity)); ATTRIB(XonoticGameHUDSettingsTab, title, string, _("HUD")); + ATTRIB(XonoticGameHUDSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameHUDSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameHUDSettingsTab, columns, float, 6.2); ENDCLASS(XonoticGameHUDSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_game_messages.qh b/qcsrc/menu/xonotic/dialog_settings_game_messages.qh index c5230aedd..28a769862 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_messages.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game_messages.qh @@ -5,6 +5,7 @@ CLASS(XonoticGameMessageSettingsTab, XonoticTab) METHOD(XonoticGameMessageSettingsTab, fill, void(entity)); METHOD(XonoticGameMessageSettingsTab, showNotify, void(entity)); ATTRIB(XonoticGameMessageSettingsTab, title, string, _("Messages")); + ATTRIB(XonoticGameMessageSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameMessageSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameMessageSettingsTab, columns, float, 6); ATTRIB(XonoticGameMessageSettingsTab, weaponsList, entity); diff --git a/qcsrc/menu/xonotic/dialog_settings_game_model.qh b/qcsrc/menu/xonotic/dialog_settings_game_model.qh index 04240353a..c3caabee7 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_model.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game_model.qh @@ -6,6 +6,7 @@ CLASS(XonoticGameModelSettingsTab, XonoticTab) METHOD(XonoticGameModelSettingsTab, showNotify, void(entity)); ATTRIB(XonoticGameModelSettingsTab, title, string, _("Models")); ATTRIB(XonoticGameModelSettingsTab, titleTooltip, string, _("Customize how players and items are displayed in game")); + ATTRIB(XonoticGameModelSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameModelSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameModelSettingsTab, columns, float, 5); ENDCLASS(XonoticGameModelSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_game_view.qh b/qcsrc/menu/xonotic/dialog_settings_game_view.qh index c7d1f23b1..f9d600119 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_view.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game_view.qh @@ -5,6 +5,7 @@ CLASS(XonoticGameViewSettingsTab, XonoticTab) METHOD(XonoticGameViewSettingsTab, fill, void(entity)); METHOD(XonoticGameViewSettingsTab, showNotify, void(entity)); ATTRIB(XonoticGameViewSettingsTab, title, string, _("View")); + ATTRIB(XonoticGameViewSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameViewSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameViewSettingsTab, columns, float, 6.2); ENDCLASS(XonoticGameViewSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qh b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qh index b61d442b1..ded41a5ab 100644 --- a/qcsrc/menu/xonotic/dialog_settings_game_weapons.qh +++ b/qcsrc/menu/xonotic/dialog_settings_game_weapons.qh @@ -5,6 +5,7 @@ CLASS(XonoticGameWeaponsSettingsTab, XonoticTab) METHOD(XonoticGameWeaponsSettingsTab, fill, void(entity)); METHOD(XonoticGameWeaponsSettingsTab, showNotify, void(entity)); ATTRIB(XonoticGameWeaponsSettingsTab, title, string, _("Weapons")); + ATTRIB(XonoticGameWeaponsSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticGameWeaponsSettingsTab, rows, float, 15.5); ATTRIB(XonoticGameWeaponsSettingsTab, columns, float, 6); ATTRIB(XonoticGameWeaponsSettingsTab, weaponsList, entity); diff --git a/qcsrc/menu/xonotic/dialog_settings_input.qh b/qcsrc/menu/xonotic/dialog_settings_input.qh index 5064de9eb..13e56afbb 100644 --- a/qcsrc/menu/xonotic/dialog_settings_input.qh +++ b/qcsrc/menu/xonotic/dialog_settings_input.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticInputSettingsTab, XonoticTab) METHOD(XonoticInputSettingsTab, fill, void(entity)); + ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticInputSettingsTab, rows, float, 15.5); ATTRIB(XonoticInputSettingsTab, columns, float, 6.2); // added extra .2 for center space ATTRIB(XonoticInputSettingsTab, name, string, "inputsettings"); diff --git a/qcsrc/menu/xonotic/dialog_settings_misc.qh b/qcsrc/menu/xonotic/dialog_settings_misc.qh index 2146bebd7..a2a86b7e1 100644 --- a/qcsrc/menu/xonotic/dialog_settings_misc.qh +++ b/qcsrc/menu/xonotic/dialog_settings_misc.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticMiscSettingsTab, XonoticTab) METHOD(XonoticMiscSettingsTab, fill, void(entity)); + ATTRIB(XonoticMiscSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticMiscSettingsTab, rows, float, 15.5); ATTRIB(XonoticMiscSettingsTab, columns, float, 6.2); ENDCLASS(XonoticMiscSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_user.qh b/qcsrc/menu/xonotic/dialog_settings_user.qh index f1ba31a14..22f84d0f0 100644 --- a/qcsrc/menu/xonotic/dialog_settings_user.qh +++ b/qcsrc/menu/xonotic/dialog_settings_user.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticUserSettingsTab, XonoticTab) METHOD(XonoticUserSettingsTab, fill, void(entity)); + ATTRIB(XonoticUserSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticUserSettingsTab, rows, float, 15.5); ATTRIB(XonoticUserSettingsTab, columns, float, 6); ENDCLASS(XonoticUserSettingsTab) diff --git a/qcsrc/menu/xonotic/dialog_settings_video.qh b/qcsrc/menu/xonotic/dialog_settings_video.qh index 2c6fe0a88..61d8a368e 100644 --- a/qcsrc/menu/xonotic/dialog_settings_video.qh +++ b/qcsrc/menu/xonotic/dialog_settings_video.qh @@ -3,6 +3,7 @@ #include "tab.qh" CLASS(XonoticVideoSettingsTab, XonoticTab) METHOD(XonoticVideoSettingsTab, fill, void(entity)); + ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9); ATTRIB(XonoticVideoSettingsTab, rows, float, 15.5); ATTRIB(XonoticVideoSettingsTab, columns, float, 6.2); // added extra .2 for center space ATTRIB(XonoticVideoSettingsTab, name, string, "videosettings");