6 if(
panel.current_panel_bg !=
"0" &&
panel.current_panel_bg !=
"")
8 panel.current_panel_bg,
18 v_x = pos_x + v_x * mySize_x;
19 v_y = pos_y + v_y * mySize_y;
33 v_x = ( v_x - pos_x ) / mySize_x;
34 v_y = ( v_y - pos_y ) / mySize_y;
41 return mousepos_x >= pos_x && mousepos_x < pos_x + sz_x &&
42 mousepos_y >= pos_y && mousepos_y < pos_y + sz_y ;
47 return sprintf(
"gfx/hud/%s/minigames/%s", skinname,
name);
57#define FIELD(Flags, Type, Name) \
58 MSLE_CLEAN_##Type(this.Name)
60#define MSLE_CLEAN_String(x) strfree(x);
61#define MSLE_CLEAN_Byte(x)
62#define MSLE_CLEAN_Char(x)
63#define MSLE_CLEAN_Short(x)
64#define MSLE_CLEAN_Long(x)
65#define MSLE_CLEAN_Coord(x)
66#define MSLE_CLEAN_Angle(x)
67#define MSLE_CLEAN_Float(x)
68#define MSLE_CLEAN_Vector(x)
69#define MSLE_CLEAN_Vector2D(x)
71#define MSLE(Name, Fields) \
72 void msle_entremove_##Name(entity this) \
74 strfree(this.netname); \
98 if ( e.minigame_autoclean )
129 if ( !minigame.descriptor || minigame.classname !=
"minigame" )
131 LOG_TRACE(
"Trying to activate unregistered minigame ",minigame.netname,
" in client");
164 return strzone(ReadString_Raw());
166#define ReadString ReadString_Zoned
167#define FIELD(Flags, Type, Name) \
169 this.Name = Read##Type();
171#define MSLE(Name, Fields) \
172 else if (this.classname == #Name) \
174 if (sf & MINIG_SF_CREATE) \
176 this.entremove = msle_entremove_##Name; \
178 minigame_ent = minigame_get_owner(this.minigame_id); \
205 LOG_TRACE(
"Got a minigame without a client-side descriptor!");
210 this.minigame_event = this.
descriptor.minigame_event;
219 else if ( this.
classname ==
"minigame_player" )
224 float ent = ReadShort();
237 this.
descriptor.minigame_event(minigame_ent,
"network_receive",
this,sf);
253 string allspecs =
"";
254 float allspecs_width = 0;
255 float max_allspecs_width = boardsize.x;
257 int allspecs_lines = 2;
262 if (allspecs_width >= 0 && e.classname ==
"minigame_player" && e.team ==
C4_SPECTATOR_TEAM)
267 current_spec =
strcat(
", ", current_spec);
271 float max_width = max_allspecs_width * allspecs_lines - max_current_spec_width;
273 allspecs =
strcat(allspecs, current_spec);
277 allspecs =
strcat(allspecs,
", ...");
306 if ( take_until >
strlen(s) )
310 for (
int i = 0; i < take_until; ++i )
318 if ( take_until > 0 || skip > 0 )
320 if ( skip == 0 && take_until <
strlen(s) )
322 int last_word = take_until;
323 while(last_word > 0 &&
substring(s, last_word, 1) !=
" ")
326 if ( last_word != 0 )
328 take_until = last_word;
336 else if (tw(
"^7", theFontSize) == 0)
359 mypos_y += fontsize_y;
367 string text,
vector fontsize,
float theAlpha,
int drawflags,
float align )
378 mypos_y += fontsize_y;
393 vector fontsize,
float theAlpha,
int drawflags )
402 drawpic( pos-sz/2, texture, sz,
color, thealpha, drawflags );
409 string cmd =
"cmd minigame ";
411 for ( i = 0; i < cmdargc; ++i )
423 _(
"It's your turn"),
"");
434 if(
argv(1) ==
"minigame")
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
#define MUTATOR_RETURNVALUE
const int C4_SPECTATOR_TEAM
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
string autocvar_menu_skin
void minigame_drawcolorcodedstring_trunc(float maxwidth, vector pos, string text, vector fontsize, float theAlpha, int drawflags)
void minigame_show_allspecs(vector boardpos, vector boardsize)
vector minigame_drawstring_wrapped(float maxwidth, vector pos, string text, vector fontsize, vector color, float theAlpha, int drawflags, float align)
void minigame_cmd_workaround(float dummy, string...cmdargc)
bool minigame_hud_mouse_in(vector pos, vector sz)
void minigame_hud_simpleboard(vector pos, vector mySize, string board_texture)
void deactivate_minigame()
string minigame_getWrappedLine(float w, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
string minigame_texture_skin(string skinname, string name)
string minigame_texture(string name)
bool auto_close_minigamemenu
vector minigame_hud_denormalize_size(vector v, vector pos, vector mySize)
vector minigame_drawcolorcodedstring_wrapped(float maxwidth, vector pos, string text, vector fontsize, float theAlpha, int drawflags, float align)
MINIGAME_SIMPLELINKED_ENTITIES void minigame_autoclean_entity(entity e)
void minigame_drawstring_trunc(float maxwidth, vector pos, string text, vector fontsize, vector color, float theAlpha, int drawflags)
void HUD_MinigameMenu_CurrentButton()
void minigame_player_entremove(entity this)
vector minigame_hud_denormalize(vector v, vector pos, vector mySize)
void minigame_entremove(entity this)
vector minigame_hud_normalize(vector v, vector pos, vector mySize)
string ReadString_Zoned()
void activate_minigame(entity minigame)
void minigame_drawpic_centered(vector pos, string texture, vector sz, vector color, float thealpha, int drawflags)
#define FOREACH_MINIGAME_ENTITY(entityvar)
float minigame_playerslot
void HUD_MinigameMenu_Close(entity this, entity actor, entity trigger)
bool HUD_MinigameMenu_IsOpened()
void HUD_MinigameMenu_Open()
#define drawcolorcodedstring(position, text, scale, alpha, flag)
#define drawstring(position, text, scale, rgb, alpha, flag)
#define drawpic(position, pic, size, rgb, alpha, flag)
string find_last_color_code(string s)
string textShortenToWidth(string theText, float maxWidth, vector theFontSize, textLengthUpToWidth_widthFunction_t tw)
float textLengthUpToWidth(string theText, float maxWidth, vector theSize, textLengthUpToWidth_widthFunction_t w)
string getWrappedLine_remaining
float(string s, vector size) textLengthUpToWidth_widthFunction_t
const float DRAWFLAG_NORMAL
string entcs_GetName(int i)
void HUD_Notify_Push(string icon, string attacker, string victim)
const float BORDER_MULTIPLIER
void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector theColor, float theAlpha, vector theBorderSize)
#define NET_HANDLE(id, param)
#define ReadRegistered(r)
#define MINIGAME_SIMPLELINKED_ENTITIES
Set up automatic entity read/write functionality To ensure that everything is handled automatically,...
entity minigame_get_owner(int id)
string msle_classname(int id)
int minigame_id
Unique ID for the minigame session, associated with all objects currently the result of etof(minigame...
const int MINIG_SF_UPDATE
const int MINIG_SF_CREATE
entity descriptor
For minigame sessions: minigame descriptor object.
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
ERASEABLE string ColorTranslateRGB(string s)
float stringwidth_nocolors(string s, vector theSize)
float stringwidth_colors(string s, vector theSize)