]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename the minigame definition functions
authorMattia Basaglia <mattia.basaglia@gmail.com>
Thu, 12 Feb 2015 14:35:54 +0000 (15:35 +0100)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Thu, 12 Feb 2015 14:35:54 +0000 (15:35 +0100)
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/minigame/all.qh
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/pong.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/minigames/sv_minigames.qc

index 85ddf57ffcfd8a26c40a9dbd2ddb93199053a15f..6d250ac702199c05ad9e65bdf9ff87c4a5b81303 100644 (file)
@@ -51,9 +51,9 @@ void initialize_minigames()
                minig.classname = "minigame_descriptor"; \
                minig.netname = strzone(strtolower(#name)); \
                minig.message = nicename; \
-               minig.minigame_hud_board = minigame_hud_board_##name; \
-               minig.minigame_hud_status = minigame_hud_status_##name; \
-               minig.minigame_event = minigame_event_##name; \
+               minig.minigame_hud_board = name##_hud_board; \
+               minig.minigame_hud_status = name##_hud_status; \
+               minig.minigame_event = name##_client_event; \
                if ( !last_minig ) minigame_descriptors = minig; \
                else last_minig.list_next = minig; \
                last_minig = minig;
index 4085a96acca446a707b16975ed09bb35d4f7c372..6b19121bd4ae3b22200c827bc69bd41e61411178 100644 (file)
@@ -17,17 +17,17 @@ Required functions
 ------------------
 
 SVQC:
-       int minigame_event_<id>(entity minigame, string event, ...count)
+       int <id>_server_event(entity minigame, string event, ...count)
                see ../minigames.qh for a detailed explanation
 CSQC:
-       void minigame_hud_board_<id>(vector pos, vector mySize)
+       void <id>_hud_board(vector pos, vector mySize)
                draws the main game board inside the rectangle defined by pos and mySize
                (That rectangle is expressed in window coordinates)
-       void minigame_hud_status_<id>(vector pos, vector mySize)
+       void <id>_hud_status(vector pos, vector mySize)
                draws the game status panel inside the rectangle defined by pos and mySize
                (That rectangle is expressed in window coordinates)
                This panel shows eg scores, captured pieces and so on
-       int minigame_event_<id>(entity minigame, string event, ...count)
+       int <id>_client_event(entity minigame, string event, ...count)
                see ../minigames.qh for a detailed explanation
 
 Managing entities
index eb27646fde600bc0a165a884a9a843a6ec5bf72f..fc5df6bc5f481d2db9734e18f67b0a97f47eecd6 100644 (file)
@@ -211,7 +211,7 @@ int nmm_count_pieces(entity minigame, int teamn, int pieceflags)
 }
 
 // required function, handle server side events
-int minigame_event_nmm(entity minigame, string event, ...)
+int nmm_server_event(entity minigame, string event, ...)
 {
        if ( event == "start" )
        {
@@ -425,7 +425,7 @@ bool nmm_draw_avaliable(entity tile)
 }
 
 // Required function, draw the game board
-void minigame_hud_board_nmm(vector pos, vector mySize)
+void nmm_hud_board(vector pos, vector mySize)
 {
        minigame_hud_fitsqare(pos, mySize);
        nmm_boardpos = pos;
@@ -493,7 +493,7 @@ void minigame_hud_board_nmm(vector pos, vector mySize)
 }
 
 // Required function, draw the game status panel
-void minigame_hud_status_nmm(vector pos, vector mySize)
+void nmm_hud_status(vector pos, vector mySize)
 {
        HUD_Panel_DrawBg(1);
        vector ts;
@@ -616,7 +616,7 @@ string nmm_turn_to_string(int turnflags)
 }
 
 // Required function, handle client events
-int minigame_event_nmm(entity minigame, string event, ...)
+int nmm_client_event(entity minigame, string event, ...)
 {
        if ( event == "activate" )
        {
index 649c98415705f5a15382fc55cea9e5f91d6de60b..5ba05f7ebe917d4405d1283c6ff7ce9cff25c6e3 100644 (file)
@@ -188,7 +188,7 @@ vector pong_team_to_paddlepos(int nteam)
 }
 
 // required function, handle server side events
-int minigame_event_pong(entity minigame, string event, ...)
+int pong_server_event(entity minigame, string event, ...)
 {
        switch (event)
        {
@@ -297,7 +297,7 @@ vector pong_team_to_color(int nteam)
 }
 
 // Required function, draw the game board
-void minigame_hud_board_pong(vector pos, vector mySize)
+void pong_hud_board(vector pos, vector mySize)
 {
        minigame_hud_fitsqare(pos, mySize);
        minigame_hud_simpleboard(pos,mySize,minigame_texture("pong/board"));
@@ -337,7 +337,7 @@ void minigame_hud_board_pong(vector pos, vector mySize)
 
 
 // Required function, draw the game status panel
-void minigame_hud_status_pong(vector pos, vector mySize)
+void pong_hud_status(vector pos, vector mySize)
 {
        HUD_Panel_DrawBg(1);
        vector ts;
@@ -387,7 +387,7 @@ string pong_message(int mgflags)
 }
 
 // Required function, handle client events
-int minigame_event_pong(entity minigame, string event, ...)
+int pong_client_event(entity minigame, string event, ...)
 {
        switch(event)
        {
index 2823d68301bf31695058f212746086c2b0ecaf77..91da259b49cdcfbc59b4bfb97437e5f452f4d473 100644 (file)
@@ -125,7 +125,7 @@ void ttt_next_match(entity minigame, entity player)
 
 
 // required function, handle server side events
-int minigame_event_ttt(entity minigame, string event, ...)
+int ttt_server_event(entity minigame, string event, ...)
 {
        switch(event)
        {
@@ -212,7 +212,7 @@ vector ttt_boardsize;// HUD board size
 .int ttt_checkwin; // Used to optimize checks to display a win
 
 // Required function, draw the game board
-void minigame_hud_board_ttt(vector pos, vector mySize)
+void ttt_hud_board(vector pos, vector mySize)
 {
        minigame_hud_fitsqare(pos, mySize);
        ttt_boardpos = pos;
@@ -264,7 +264,7 @@ void minigame_hud_board_ttt(vector pos, vector mySize)
 
 
 // Required function, draw the game status panel
-void minigame_hud_status_ttt(vector pos, vector mySize)
+void ttt_hud_status(vector pos, vector mySize)
 {
        HUD_Panel_DrawBg(1);
        vector ts;
@@ -541,7 +541,7 @@ void ttt_set_curr_pos(string s)
 }
 
 // Required function, handle client events
-int minigame_event_ttt(entity minigame, string event, ...)
+int ttt_client_event(entity minigame, string event, ...)
 {
        switch(event)
        {
index f047c92691debe47775efacfda8252fca9741e4f..40332796e2b5c41992911f164694bc2f719292dc 100644 (file)
@@ -277,7 +277,7 @@ void initialize_minigames()
                minig.classname = "minigame_descriptor"; \
                minig.netname = #name; \
                minig.message = nicename; \
-               minig.minigame_event = minigame_event_##name; \
+               minig.minigame_event = name##_server_event; \
                if ( !last_minig ) minigame_descriptors = minig; \
                else last_minig.list_next = minig; \
                last_minig = minig;