#include "xonotic/dialog_singleplayer.qc"
#include "xonotic/dialog_singleplayer_winner.qc"
#include "xonotic/dialog_teamselect.qc"
+#include "xonotic/dialog_tip.qc"
#include "xonotic/gametypelist.qc"
#include "xonotic/image.qc"
#include "xonotic/inputbox.qc"
#include "xonotic/keybinder.qc"
#include "xonotic/languagelist.qc"
#include "xonotic/listbox.qc"
+#include "xonotic/loadingwindow.qc"
#include "xonotic/mainwindow.qc"
#include "xonotic/maplist.qc"
#include "xonotic/nexposee.qc"
{
draw_reset_cropped();
main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
+ loading.resizeNotify(loading, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
}
}
else
loadTooltips();
anim = NEW(AnimHost);
main = NEW(MainWindow); main.configureMainWindow(main);
+ loading = NEW(LoadingWindow);
unloadTooltips();
main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
main.focused = 1;
+ loading.resizeNotify(loading, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
+ loading.focused = true;
menuShiftState = 0;
menuMousePos = '0.5 0.5 0';
}
}
+float realFrametime;
+
void m_draw(float width, float height)
{
float t;
- float realFrametime;
m_gamestatus();
if(cvar("menu_sounds"))
localsound(soundfile);
}
+
+void m_loading(bool signingon)
+{
+ if (!menuInitialized) return;
+
+ static float fadetime = 2;
+ static float a;
+ a = bound(0, a - 1 / fadetime * realFrametime, 1);
+
+ if (!(gamestatus & GAME_CONNECTED)) return;
+ if (signingon) a = 1;
+ cvar_set("scr_loadingscreen_scale", "0");
+ if (a) {
+ drawfill('0 0 0', eX * realconwidth + eY * realconheight, '0 0 0', a, DRAWFLAG_NORMAL);
+ string s = "gfx/loading";
+ string mapshot = cvar_string("cl_worldnamenoextension");
+ if (mapshot != "" && precache_pic(mapshot)) s = mapshot;
+ drawpic('0 0 0', s, eX * realconwidth + eY * realconheight, '1 1 1', a, DRAWFLAG_NORMAL);
+
+ float _draw_alpha = draw_alpha;
+ draw_alpha = a;
+ loading.draw(loading);
+ draw_alpha = _draw_alpha;
+ } else {
+ cvar_set("cl_worldnamenoextension", "");
+ }
+}
entity anim;
entity main;
+entity loading;
void m_hide();
void m_display();
void m_goto(string name);
--- /dev/null
+#ifndef DIALOG_TIP_H
+#define DIALOG_TIP_H
+CLASS(XonoticTipDialog, XonoticDialog)
+ METHOD(XonoticTipDialog, fill, void(entity));
+ ATTRIB(XonoticTipDialog, title, string, _("Tip"))
+ ATTRIB(XonoticTipDialog, color, vector, SKINCOLOR_DIALOG_FIRSTRUN)
+ ATTRIB(XonoticTipDialog, intendedWidth, float, 0.7)
+ ATTRIB(XonoticTipDialog, rows, float, 2)
+ ATTRIB(XonoticTipDialog, columns, float, 2)
+ ATTRIB(XonoticTipDialog, name, string, "Tip")
+
+ ATTRIB(XonoticTipDialog, closable, float, 0)
+
+ENDCLASS(XonoticTipDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticTipDialog_fill(entity this)
+{
+ entity e;
+ this.TR(this);
+ this.TD(this, 2, 2, e = makeXonoticTextLabel(0, "Loading"));
+ e.allowWrap = 1;
+}
+#endif
--- /dev/null
+#ifndef LOADINGWINDOW_H
+#define LOADINGWINDOW_H
+CLASS(LoadingWindow, ModalController)
+ METHOD(LoadingWindow, configureLoadingWindow, void(entity));
+ METHOD(LoadingWindow, draw, void(entity));
+ ATTRIB(LoadingWindow, tipDialog, entity, NULL)
+ ATTRIB(LoadingWindow, fadedAlpha, float, SKINALPHA_BEHIND)
+ ATTRIB(LoadingWindow, dialogToShow, entity, NULL)
+ INIT(LoadingWindow) {
+ entity e;
+
+ this.tipDialog = e = NEW(XonoticTipDialog);
+ e.configureDialog(e);
+ this.addItemCentered(this, e, e.intendedWidth * eX + e.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
+ this.dialogToShow = this.tipDialog;
+ }
+ENDCLASS(LoadingWindow)
+#endif
+
+#ifdef IMPLEMENTATION
+void LoadingWindow_draw(entity this)
+{
+ super.draw(this);
+
+ if (this.dialogToShow)
+ {
+ DialogOpenButton_Click_withCoords(world, this.dialogToShow, '0 0 0', eX * conwidth + eY * conheight);
+ this.dialogToShow = NULL;
+ }
+}
+
+#endif