r3158 - in trunk/data: maps qcsrc/menu-div0test qcsrc/menu-div0test/nexuiz
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Jan 17 01:44:01 EST 2008
Author: div0
Date: 2008-01-17 01:44:01 -0500 (Thu, 17 Jan 2008)
New Revision: 3158
Added:
trunk/data/qcsrc/menu-div0test/nexuiz/dialog_singleplayer_winner.c
Modified:
trunk/data/maps/aneurysm.mapinfo
trunk/data/qcsrc/menu-div0test/classes.c
trunk/data/qcsrc/menu-div0test/menu.qc
trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c
Log:
Tell the player when he is WINNER. WINNER image not included (gfx/winner.tga is where it should be).
Modified: trunk/data/maps/aneurysm.mapinfo
===================================================================
--- trunk/data/maps/aneurysm.mapinfo 2008-01-17 06:07:26 UTC (rev 3157)
+++ trunk/data/maps/aneurysm.mapinfo 2008-01-17 06:44:01 UTC (rev 3158)
@@ -9,4 +9,4 @@
type rune 200 20
type lms 9 20
type arena 10 20
-type kh 1000 30 3
+type kh 1000 30 2
Modified: trunk/data/qcsrc/menu-div0test/classes.c
===================================================================
--- trunk/data/qcsrc/menu-div0test/classes.c 2008-01-17 06:07:26 UTC (rev 3157)
+++ trunk/data/qcsrc/menu-div0test/classes.c 2008-01-17 06:44:01 UTC (rev 3158)
@@ -60,3 +60,4 @@
#include "nexuiz/slider_decibels.c"
#include "nexuiz/dialog_singleplayer.c"
#include "nexuiz/campaign.c"
+#include "nexuiz/dialog_singleplayer_winner.c"
Modified: trunk/data/qcsrc/menu-div0test/menu.qc
===================================================================
--- trunk/data/qcsrc/menu-div0test/menu.qc 2008-01-17 06:07:26 UTC (rev 3157)
+++ trunk/data/qcsrc/menu-div0test/menu.qc 2008-01-17 06:44:01 UTC (rev 3158)
@@ -15,6 +15,9 @@
float menuLoadedMaplist;
float menuNotTheFirstFrame;
+string campaign_name_previous;
+float campaign_won_previous;
+
void SUB_Null() { };
void() m_init =
@@ -188,6 +191,29 @@
menuPrevTime = t;
time += frametime;
+ if not(campaign_name_previous)
+ campaign_name_previous = strzone(strcat(campaign_name, "x")); // force unequal
+ if(campaign_name == campaign_name_previous)
+ {
+ if(cvar(strcat("g_campaign", campaign_name, "_won")))
+ {
+ if(!campaign_won_previous)
+ {
+ m_display();
+ DialogOpenButton_Click_withCoords(NULL, main.winnerDialog, '0 0 0', '1 1 0');
+ }
+ campaign_won_previous = 1;
+ }
+ else
+ campaign_won_previous = 0;
+ }
+ else
+ {
+ strunzone(campaign_name_previous);
+ campaign_name_previous = strzone(campaign_name);
+ campaign_won_previous = cvar(strcat("g_campaign", campaign_name, "_won"));
+ }
+
if(Menu_Active)
{
if(getmousetarget() == MT_MENU && (getkeydest() == KEY_MENU || getkeydest() == KEY_MENU_GRABBED))
Added: trunk/data/qcsrc/menu-div0test/nexuiz/dialog_singleplayer_winner.c
===================================================================
--- trunk/data/qcsrc/menu-div0test/nexuiz/dialog_singleplayer_winner.c (rev 0)
+++ trunk/data/qcsrc/menu-div0test/nexuiz/dialog_singleplayer_winner.c 2008-01-17 06:44:01 UTC (rev 3158)
@@ -0,0 +1,25 @@
+#ifdef INTERFACE
+CLASS(NexuizWinnerDialog) EXTENDS(NexuizDialog)
+ METHOD(NexuizWinnerDialog, fill, void(entity))
+ ATTRIB(NexuizWinnerDialog, title, string, "Winner")
+ ATTRIB(NexuizWinnerDialog, color, vector, SKINCOLOR_DIALOG_MULTIPLAYER)
+ ATTRIB(NexuizWinnerDialog, intendedWidth, float, 0.64)
+ ATTRIB(NexuizWinnerDialog, rows, float, 12)
+ ATTRIB(NexuizWinnerDialog, columns, float, 3)
+ENDCLASS(NexuizWinnerDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void fillNexuizWinnerDialog(entity me)
+{
+ entity mc, e;
+
+ me.TR(me);
+ me.TD(me, me.rows - 2, me.columns, e = makeNexuizImage("/gfx/winner", 1.0));
+
+ me.gotoXY(me, me.rows - 1, 0);
+ me.TD(me, 1, me.columns, e = makeNexuizButton("OK", '0 0 0'));
+ e.onClick = Dialog_Close;
+ e.onClickEntity = me;
+}
+#endif
Modified: trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c
===================================================================
--- trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c 2008-01-17 06:07:26 UTC (rev 3157)
+++ trunk/data/qcsrc/menu-div0test/nexuiz/mainwindow.c 2008-01-17 06:44:01 UTC (rev 3158)
@@ -4,6 +4,7 @@
ATTRIB(MainWindow, mutatorsDialog, entity, NULL)
ATTRIB(MainWindow, mapInfoDialog, entity, NULL)
ATTRIB(MainWindow, userbindEditDialog, entity, NULL)
+ ATTRIB(MainWindow, winnerDialog, entity, NULL)
ATTRIB(MainWindow, fadedAlpha, float, SKINALPHA_BEHIND)
ENDCLASS(MainWindow)
#endif
@@ -38,6 +39,10 @@
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+ me.winnerDialog = i = spawnNexuizWinnerDialog();
+ i.configureDialog(i);
+ me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
n = spawnNexuizNexposee();
/*
if(checkextension("DP_GECKO_SUPPORT"))
More information about the nexuiz-commits
mailing list