-#ifndef DIALOG_SETTINGS_VIDEO_H
-#define DIALOG_SETTINGS_VIDEO_H
-#include "tab.qc"
-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")
-ENDCLASS(XonoticVideoSettingsTab)
-entity makeXonoticVideoSettingsTab();
-#endif
+#include "dialog_settings_video.qh"
+
+#include "commandbutton.qh"
+#include "textlabel.qh"
+#include "textslider.qh"
+#include "checkbox.qh"
+#include "slider.qh"
+#include "slider_resolution.qh"
+#include "radiobutton.qh"
-#ifdef IMPLEMENTATION
entity makeXonoticVideoSettingsTab()
{
entity me;
void XonoticVideoSettingsTab_fill(entity me)
{
entity e;
+ entity videoApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
+ "vid_width $_menu_vid_width;"
+ "vid_height $_menu_vid_height;"
+ "vid_pixelheight $_menu_vid_pixelheight;"
+ "vid_desktopfullscreen $_menu_vid_desktopfullscreen;"
+ "menu_cmd update_conwidths_before_vid_restart;"
+ "vid_restart;"
+ "menu_cmd sync;"
+ , COMMANDBUTTON_APPLY);
+ videoApplyButton.disableOnClick = true;
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution:")));
me.TD(me, 1, 2, e = makeXonoticResolutionSlider());
+ e.applyButton = videoApplyButton;
me.TR(me);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Font/UI size:")));
me.TD(me, 1, 2, e = makeXonoticTextSlider("menu_vid_scale"));
e.addValue(e, _("16bit"), "16");
e.addValue(e, _("32bit"), "32");
e.configureXonoticTextSliderValues(e);
+ e.applyButton = videoApplyButton;
me.TR(me);
- me.TD(me, 1, 1, e = makeXonoticCheckBox_T(0, "vid_fullscreen", _("Full screen"),
- _("Enable fullscreen mode (default: enabled)")));
+ me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
+ e.applyButton = videoApplyButton;
me.TD(me, 1, 2, e = makeXonoticCheckBox_T(0, "vid_vsync", _("Vertical Synchronization"),
_("Enable vertical synchronization to prevent tearing, will cap your fps to the screen refresh rate (default: disabled)")));
e.addValue(e, _("4x"), "4");
e.configureXonoticTextSliderValues(e);
setDependent(e, "r_viewfbo", 0, 0);
+ e.applyButton = videoApplyButton;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "r_viewfbo", _("High-quality frame buffer")));
setDependent(e, "vid_samples", 1, 1);
me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Vertex Buffer Objects (VBOs)")));
me.TR(me);
me.TDempty(me, 0.2);
- me.TD(me, 1, 0.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "0", ZCTX(_("VBO^Off")),
- _("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
+ me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", ZCTX(_("VBO^Off"))));
me.TD(me, 1, 1.9, e = makeXonoticRadioButton_T(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)"),
_("Make use of Vertex Buffer Objects to store static geometry in video memory for faster rendering (default: Vertex and Triangles)")));
me.TR(me);
_("Make the CPU wait for the GPU to finish each frame, can help with some strange input or video lag on some machines (default: disabled)")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
+ e.applyButton = videoApplyButton;
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, 1, 2.8, e = makeXonoticCheckBox_T(0, "v_glslgamma", _("Use GLSL to handle color control"),
}
me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; menu_cmd update_conwidths_before_vid_restart; vid_restart; menu_cmd sync", COMMANDBUTTON_APPLY));
+ me.TD(me, 1, me.columns, videoApplyButton);
}
-#endif