From 5e6ec245539095e91a7c33f7af4b3071d09cffb2 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sun, 18 Aug 2013 15:47:41 -0400 Subject: [PATCH] Move screenshots and demos into the same "Media" tab --- qcsrc/menu/classes.c | 7 ++-- qcsrc/menu/xonotic/dialog_multiplayer.c | 2 +- qcsrc/menu/xonotic/dialog_multiplayer_media.c | 33 +++++++++++++++++++ ...demo.c => dialog_multiplayer_media_demo.c} | 2 +- ... => dialog_multiplayer_media_screenshot.c} | 2 +- ...log_multiplayer_media_screenshot_viewer.c} | 0 6 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 qcsrc/menu/xonotic/dialog_multiplayer_media.c rename qcsrc/menu/xonotic/{dialog_multiplayer_demo.c => dialog_multiplayer_media_demo.c} (96%) rename qcsrc/menu/xonotic/{dialog_multiplayer_screenshot.c => dialog_multiplayer_media_screenshot.c} (97%) rename qcsrc/menu/xonotic/{dialog_multiplayer_screenshot_screenshotviewer.c => dialog_multiplayer_media_screenshot_viewer.c} (100%) diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c index d5e97ea5d..f35b40843 100644 --- a/qcsrc/menu/classes.c +++ b/qcsrc/menu/classes.c @@ -86,11 +86,12 @@ #include "xonotic/dialog_multiplayer_playersetup_view.c" #include "xonotic/dialog_multiplayer_playersetup_weapons.c" #include "xonotic/weaponslist.c" -#include "xonotic/dialog_multiplayer_demo.c" +#include "xonotic/dialog_multiplayer_media.c" +#include "xonotic/dialog_multiplayer_media_demo.c" #include "xonotic/demolist.c" #include "xonotic/screenshotimage.c" -#include "xonotic/dialog_multiplayer_screenshot.c" -#include "xonotic/dialog_multiplayer_screenshot_screenshotviewer.c" +#include "xonotic/dialog_multiplayer_media_screenshot.c" +#include "xonotic/dialog_multiplayer_media_screenshot_viewer.c" #include "xonotic/screenshotlist.c" #include "xonotic/colorpicker.c" #include "xonotic/colorpicker_string.c" diff --git a/qcsrc/menu/xonotic/dialog_multiplayer.c b/qcsrc/menu/xonotic/dialog_multiplayer.c index ba85f8c8c..bb16f1d2d 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer.c @@ -20,7 +20,7 @@ void XonoticMultiplayerDialog_fill(entity me) //me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Demos"), makeXonoticDemoBrowserTab())); //me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Screenshots"), makeXonoticScreenshotBrowserTab())); //me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Players"), makeXonoticDemoBrowserTab())); - me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Media"), makeXonoticDemoBrowserTab())); + me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Media"), makeXonoticMediaTab())); me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Profile"), makeXonoticPlayerSettingsTab())); me.TR(me); diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_media.c b/qcsrc/menu/xonotic/dialog_multiplayer_media.c new file mode 100644 index 000000000..a644557a5 --- /dev/null +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media.c @@ -0,0 +1,33 @@ +#ifdef INTERFACE +CLASS(XonoticMediaTab) EXTENDS(XonoticTab) + METHOD(XonoticMediaTab, fill, void(entity)) + ATTRIB(XonoticMediaTab, title, string, _("Demo")) + ATTRIB(XonoticMediaTab, intendedWidth, float, 0.9) + ATTRIB(XonoticMediaTab, rows, float, 22) + ATTRIB(XonoticMediaTab, columns, float, 2) + ATTRIB(XonoticMediaTab, name, string, "Media") +ENDCLASS(XonoticMediaTab) +entity makeXonoticMediaTab(); +#endif + +#ifdef IMPLEMENTATION +entity makeXonoticMediaTab() +{ + entity me; + me = spawnXonoticMediaTab(); + me.configureDialog(me); + return me; +} +void XonoticMediaTab_fill(entity me) +{ + entity mc, e; + mc = makeXonoticTabController(me.rows - 2); + me.TR(me); + me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Demos"), makeXonoticDemoBrowserTab())); + me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Screenshots"), makeXonoticScreenshotBrowserTab())); + + me.TR(me); + me.TR(me); + me.TD(me, me.rows - 2, me.columns, mc); +} +#endif diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_demo.c b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c similarity index 96% rename from qcsrc/menu/xonotic/dialog_multiplayer_demo.c rename to qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c index 84115f1ed..893178e48 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_demo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_demo.c @@ -3,7 +3,7 @@ CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab) METHOD(XonoticDemoBrowserTab, fill, void(entity)) ATTRIB(XonoticDemoBrowserTab, title, string, _("Demo")) ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9) - ATTRIB(XonoticDemoBrowserTab, rows, float, 22) + ATTRIB(XonoticDemoBrowserTab, rows, float, 20) ATTRIB(XonoticDemoBrowserTab, columns, float, 4) ATTRIB(XonoticDemoBrowserTab, name, string, "DemoBrowser") ENDCLASS(XonoticDemoBrowserTab) diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_screenshot.c b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.c similarity index 97% rename from qcsrc/menu/xonotic/dialog_multiplayer_screenshot.c rename to qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.c index 4352937e2..d154af053 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_screenshot.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot.c @@ -3,7 +3,7 @@ CLASS(XonoticScreenshotBrowserTab) EXTENDS(XonoticTab) METHOD(XonoticScreenshotBrowserTab, fill, void(entity)) ATTRIB(XonoticScreenshotBrowserTab, title, string, "Screenshot") ATTRIB(XonoticScreenshotBrowserTab, intendedWidth, float, 1) - ATTRIB(XonoticScreenshotBrowserTab, rows, float, 22) + ATTRIB(XonoticScreenshotBrowserTab, rows, float, 20) ATTRIB(XonoticScreenshotBrowserTab, columns, float, 6.5) ATTRIB(XonoticScreenshotBrowserTab, name, string, "ScreenshotBrowser") diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_screenshot_screenshotviewer.c b/qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.c similarity index 100% rename from qcsrc/menu/xonotic/dialog_multiplayer_screenshot_screenshotviewer.c rename to qcsrc/menu/xonotic/dialog_multiplayer_media_screenshot_viewer.c -- 2.39.2