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;
------------------
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
}
// 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" )
{
}
// 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;
}
// 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;
}
// Required function, handle client events
-int minigame_event_nmm(entity minigame, string event, ...)
+int nmm_client_event(entity minigame, string event, ...)
{
if ( event == "activate" )
{
}
// required function, handle server side events
-int minigame_event_pong(entity minigame, string event, ...)
+int pong_server_event(entity minigame, string event, ...)
{
switch (event)
{
}
// 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"));
// 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;
}
// Required function, handle client events
-int minigame_event_pong(entity minigame, string event, ...)
+int pong_client_event(entity minigame, string event, ...)
{
switch(event)
{
// required function, handle server side events
-int minigame_event_ttt(entity minigame, string event, ...)
+int ttt_server_event(entity minigame, string event, ...)
{
switch(event)
{
.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;
// 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;
}
// Required function, handle client events
-int minigame_event_ttt(entity minigame, string event, ...)
+int ttt_client_event(entity minigame, string event, ...)
{
switch(event)
{
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;