X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Futil.qh;h=49afad22d7f19bc62f552b8dcdbf3884f7e8654d;hb=4aabbcbfcb5d689c7553db92012b7db84b867afa;hp=f46dc6535db74dc51a8e55938ee6dd85c0128e23;hpb=2fb4172213439edb17c1d116747c75f9540f2017;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index f46dc6535..49afad22d 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -34,6 +34,8 @@ float median(float a, float b, float c); // works for up to 10 decimals! string ftos_decimals(float number, float decimals); +float fexists(string f); + vector colormapPaletteColor(float c, float isPants); // unzone the string, and return it as tempstring. Safe to be called on string_null @@ -142,7 +144,7 @@ string getWrappedLine_remaining; string getWrappedLine(float w, vector size, textLengthUpToWidth_widthFunction_t tw); string getWrappedLineLen(float w, textLengthUpToLength_lenFunction_t tw); -float isGametypeInFilter(float gt, float tp, string pattern); +float isGametypeInFilter(float gt, float tp, float ts, string pattern); typedef void(float i1, float i2, entity pass) swapfunc_t; // is only ever called for i1 < i2 typedef float(float i1, float i2, entity pass) comparefunc_t; // <0 for <, ==0 for ==, >0 for > (like strcmp) @@ -238,8 +240,8 @@ switch(id) { \ case HUD_PANEL_MODICONS: panel_name = HUD_PANELNAME_MODICONS; break; \ case HUD_PANEL_PRESSEDKEYS: panel_name = HUD_PANELNAME_PRESSEDKEYS; break; \ case HUD_PANEL_CHAT: panel_name = HUD_PANELNAME_CHAT; break; \ -}\ -HUD_Panel_GetName_Part2(id) + default: HUD_Panel_GetName_Part2(id)\ +} vector vec2(vector v); @@ -248,3 +250,11 @@ vector NearestPointOnBox(entity box, vector org); #endif float vercmp(string v1, string v2); + +float u8_strsize(string s); + +// translation helpers +string prvm_language; +string language_filename(string s); +string CTX(string s); +#define ZCTX(s) strzone(CTX(s))