|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
Go to the source code of this file.
Macros | |
| #define | DAYS_UP_TO_EPOCH 719469 |
| #define | DEC_TO_HEXDIGIT(d) |
| #define | endsWith(this, suffix) |
| #define | EVAL_PAR(...) |
| #define | HEXDIGIT_TO_DEC(d) |
| #define | HEXDIGIT_TO_DEC_RAW(d) |
| #define | IS_DIGIT(d) |
| #define | IS_HEXDIGIT(d) |
| #define | mmsst(tm, compact) |
| #define | mmssth(tm, compact) |
| #define | PAGE_TEXT _page_text |
| #define | PAGE_TEXT_INIT() |
| #define | PAR(...) |
| Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprintf. | |
| #define | PAR_1(msg) |
| #define | PAR_2(msg, a1) |
| #define | PAR_3(msg, a1, a2) |
| #define | PAR_4(msg, a1, a2, a3) |
| #define | PAR_5(msg, a1, a2, a3, a4) |
| #define | PAR_6(msg, a1, a2, a3, a4, a5) |
| #define | PAR_7(msg, a1, a2, a3, a4, a5, a6) |
| #define | PAR_8(msg, a1, a2, a3, a4, a5, a6, a7) |
| #define | PAR_9(msg, a1, a2, a3, a4, a5, a6, a7, a8) |
| #define | startsWith(haystack, needle) |
| #define | strcpy(this, s) |
| #define | strfree(this) |
| #define | strhasword(s, w) |
| #define | VM_TEMPSTRING_MAXSIZE 16383 |
Functions | |
| ERASEABLE void | _shufflewords_swapfunc (float i, float j, entity pass) |
| ERASEABLE int | buf_load (string pFilename) |
| ERASEABLE void | buf_save (float buf, string pFilename) |
| ERASEABLE string | car (string s) |
| returns first word | |
| string | CCR (string input) |
| color code replace, place inside of sprintf and parse the string | |
| ERASEABLE string | cdr (string s) |
| returns all but first word | |
| ERASEABLE vector | checkColorCode (string theText, int text_len, int pos, bool check_at_the_end) |
| ERASEABLE string | clockedtime_tostring (int tm, bool hundredths, bool compact) |
| ERASEABLE string | ColorTranslateRGB (string s) |
| ERASEABLE string | cons (string a, string b) |
| ERASEABLE string | cons_mid (string a, string mid, string b) |
| ERASEABLE int | days_up_to_date (int Y, int M, int D) |
| ERASEABLE string | format_time (float seconds) |
| ERASEABLE string | fstrunzone (string s) |
| unzone the string, and return it as tempstring. | |
| ERASEABLE string | ftos_decimals (float number, int decimals) |
| converts a number to a string with the indicated number of decimals | |
| ERASEABLE string | ftos_decimals_percentage (float number, int decimals) |
| converts a percentage to a string with the indicated number of decimals | |
| ERASEABLE string | ftos_mindecimals (float number) |
| Converts a number to a string with the minimum number of decimals It assumes that an extreme accuracy of the input number is not needed and reduces the max number of decimals to 4 in order to hide minor representation errors that can easily happen even with small numbers, e.g.: x = 32.1; sprintf("%f", x): "32.099998" x = 4; x += 0.01; x += 0.01; sprintf("%f", x): "4.020001" Reducing the max number of decimals to 5 is not enough to hide most errors. | |
| ERASEABLE bool | isCaretEscaped (string theText, float pos) |
| ERASEABLE bool | isInvisibleString (string s) |
| ERASEABLE bool | isValidColorCodeValue (string theText, int cc_len, int tag_start) |
| ERASEABLE string | seconds_tostring (float seconds) |
| ERASEABLE string | shufflewords (string str) |
| ERASEABLE bool | startsWithNocase (string haystack, string needle) |
| ERASEABLE string | strftime_s () |
| float | stringwidth_colors (string s, vector theSize) |
| float | stringwidth_nocolors (string s, vector theSize) |
| ERASEABLE string | strwords (string s, int w) |
| ERASEABLE string | substring_range (string s, float b, float e) |
| ERASEABLE string | swapwords (string str, float i, float j) |
| ERASEABLE int | u8_strsize (string s) |
| ERASEABLE string | unescape (string in) |
| ERASEABLE int | vercmp (string v1, string v2) |
| ERASEABLE int | vercmp_recursive (string v1, string v2) |
Variables | |
| noref string | _endsWith_suffix |
| string | _shufflewords_str |
| string | autocvar_hud_colorset_background = "7" |
| string | autocvar_hud_colorset_foreground_1 = "2" |
| string | autocvar_hud_colorset_foreground_2 = "3" |
| string | autocvar_hud_colorset_foreground_3 = "4" |
| string | autocvar_hud_colorset_foreground_4 = "1" |
| string | autocvar_hud_colorset_kill_1 = "1" |
| string | autocvar_hud_colorset_kill_2 = "3" |
| string | autocvar_hud_colorset_kill_3 = "4" |
| int | ColorTranslateMode |
| const string | DIGITS = "0123456789" |
| const string | HEXDIGITS = "0123456789ABCDEF0123456789abcdef" |
| const string | HEXDIGITS_MINSET = "0123456789ABCDEFabcdef" |
| #define DAYS_UP_TO_EPOCH 719469 |
Definition at line 85 of file string.qh.
Referenced by strftime_s().
| #define DEC_TO_HEXDIGIT | ( | d | ) |
Definition at line 572 of file string.qh.
Referenced by rgb_to_hexcolor().
| #define endsWith | ( | this, | |
| suffix ) |
| #define HEXDIGIT_TO_DEC | ( | d | ) |
Definition at line 571 of file string.qh.
Referenced by InputBox_draw().
| #define HEXDIGIT_TO_DEC_RAW | ( | d | ) |
| #define IS_DIGIT | ( | d | ) |
Definition at line 576 of file string.qh.
Referenced by bot_cmd_eval(), find_last_color_code(), InputBox_draw(), isValidColorCodeValue(), translate_key(), and XonoticServerList_drawListBoxItem().
| #define IS_HEXDIGIT | ( | d | ) |
Definition at line 573 of file string.qh.
Referenced by find_last_color_code(), and isValidColorCodeValue().
| #define mmsst | ( | tm, | |
| compact ) |
| #define mmssth | ( | tm, | |
| compact ) |
| #define PAGE_TEXT _page_text |
| #define PAR | ( | ... | ) |
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprintf.
Secondary arguments are optional format arguments for internal sprintf calls. This is to make translators' work easier: paragraphs are shorter than the whole page, sometimes they can be shared across pages (reducing translatable text) and don't require translators to check the whole text in the case of a paragraph update.
| #define PAR_1 | ( | msg | ) |
| #define PAR_2 | ( | msg, | |
| a1 ) |
| #define PAR_3 | ( | msg, | |
| a1, | |||
| a2 ) |
| #define PAR_4 | ( | msg, | |
| a1, | |||
| a2, | |||
| a3 ) |
| #define PAR_5 | ( | msg, | |
| a1, | |||
| a2, | |||
| a3, | |||
| a4 ) |
| #define PAR_6 | ( | msg, | |
| a1, | |||
| a2, | |||
| a3, | |||
| a4, | |||
| a5 ) |
| #define PAR_7 | ( | msg, | |
| a1, | |||
| a2, | |||
| a3, | |||
| a4, | |||
| a5, | |||
| a6 ) |
| #define PAR_8 | ( | msg, | |
| a1, | |||
| a2, | |||
| a3, | |||
| a4, | |||
| a5, | |||
| a6, | |||
| a7 ) |
| #define PAR_9 | ( | msg, | |
| a1, | |||
| a2, | |||
| a3, | |||
| a4, | |||
| a5, | |||
| a6, | |||
| a7, | |||
| a8 ) |
| #define startsWith | ( | haystack, | |
| needle ) |
Definition at line 236 of file string.qh.
Referenced by _getcommandkey(), _MapInfo_Generate(), spawnfunc(), startsWith(), W_Guide_Keybinds(), WarpZoneLib_BadEntity(), and XonoticKeyBinder_drawListBoxItem().
| #define strcpy | ( | this, | |
| s ) |
Definition at line 52 of file string.qh.
Referenced by Accuracy_LoadLevels(), Announcer_Duel(), bd_do_next_match(), bd_move_dozer(), bd_server_event(), bd_set_next_match(), bd_set_nextlevel(), bot_custom_weapon_priority_setup(), bot_decodecommand(), centerprint_Add(), centerprint_SetDuelTitle(), centerprint_SetTitle(), Cmd_Scoreboard_SetFields(), CvarList_UpdateResults(), DamageText::DamageText_update(), Ent_WaypointSprite(), GameTypeVote_Finished(), GENERIC_COMMAND(), get_mi_min_max(), GetCvars_handleString(), GetCvars_handleString_Fixup(), HUD_Chat(), HUD_Main(), HUD_Mod_Race(), HUD_Panel_FirstInDrawQ(), HUD_Radar(), HUD_Vote(), HUD_Weapons(), ignore_add_player(), ignore_remove_player(), InitGameplayMode(), Label_draw(), Label_setText(), LoadPlayerSounds(), Local_Notification_sound(), LocalCommand_sendcvar(), m_goto(), m_tooltip(), Model::model_precache(), Monster_Sounds_Load(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), net_handle_ServerWelcome(), OnlineBanList_Think(), PlayerFrame(), PlayerThink(), preMenuDraw(), ps_move_piece(), queue_to_execute_next_frame(), QuickMenu_Page_Load(), QuickMenu_Page_LoadEntry(), QuickMenu_skip_submenu(), race_checkAndWriteName(), race_deleteTime(), race_SendTime(), race_setTime(), sandbox_ObjectPort_Load(), Scoreboard_Draw(), SendWelcomeMessage(), Set_NextMap(), Sound::sound_precache(), spawnfunc(), StoreCheckpointSplits(), UpdatePlayerSounds(), W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(), W_Reload(), waypoint_loadall(), waypoint_saveall(), welcomeDialog_resetStrings(), WinningConditionHelper(), WriteByte(), XonoticCampaignList_loadCvars(), XonoticCrosshairPreview_draw(), XonoticCvarList_setSelected(), XonoticMapInfoDialog_loadMapInfo(), XonoticMapList_keyDown(), XonoticMapList_refilter(), XonoticPlayerModelSelector_go(), XonoticScreenshotBrowserTab_loadPreviewScreenshot(), XonoticScreenshotImage_load(), XonoticScreenshotViewerDialog_loadScreenshot(), XonoticServerList_draw(), XonoticServerList_setSelected(), XonoticTextBox_setText(), and XonoticWelcomeDialog_readInputArgs().
| #define strfree | ( | this | ) |
Definition at line 59 of file string.qh.
Referenced by DamageText::~DamageText(), DebugText3d::~DebugText3d(), Announcer_ClearTitle(), bd_editor_place(), bd_server_event(), bd_setup_pieces(), bd_unfill_recurse(), BGMScript_InitEntity(), bot_clientdisconnect(), c4_server_event(), CampaignFile_Unload(), centerprint_ClearTitle(), centerprint_KillAll(), ClearCheckpointSplits(), ClearPlayerSounds(), ClientDisconnect(), Cmd_Scoreboard_SetFields(), cvar_changes_init(), DemoList_Filter_Change(), end_minigame(), Ent_RemoveEntCS(), Ent_RemoveWaypointSprite(), EntryList_StringFilterBox_Change(), execute_next_frame(), GameType_ConfigureSliders(), GetCvars_handleString(), HUD_Crosshair(), HUD_Mod_Race(), HUDSkinList_Filter_Change(), HUDSkinList_SavedName_Change(), ignore_list_apply(), InputBox_setText(), ItemRemove(), LocalCommand_sendcvar(), m_init_delayed(), m_tooltip(), MapList_StringFilterBox_Change(), MapVote_Finished(), MapVote_Think(), MapVote_UnzoneStrings(), MUTATOR_HOOKFUNCTION(), MX_Say_(), Net_Flush(), NET_HANDLE(), NET_HANDLE(), Net_Notification_Remove(), nmm_kill_tiles(), PlayerStats_GameReport_FinalizePlayer(), PlayerStats_GameReport_Reset_All(), pp_move(), pp_server_event(), ps_move_piece(), ps_server_event(), QuickMenu_Close(), QuickMenu_Page_ClearEntry(), QuickMenu_skip_submenu(), race_CheckName(), race_ClearRecords(), rewrapCampaign(), sandbox_ObjectPort_Load(), sandbox_ObjectRemove(), Scoreboard_Rankings_Draw(), ScreenshotList_Filter_Change(), ServerList_Filter_Change(), Set_NextMap(), setZonedTooltip(), Shutdown(), SL_ProcessCategoryOverrides(), SoundList_Filter_Change(), StrafeHUD_UpdateSonarSound(), ttt_server_event(), url_fclose(), url_multi_ready(), url_single_fopen(), url_URI_Get_Callback(), VoteReset(), Welcome_Message_Show_Try(), XonoticCvarList_setSelected(), XonoticGuideDescription_setDescription(), XonoticKeyBinder_destroy(), XonoticServerInfoDialog_loadServerInfo(), XonoticServerList_setSortOrder(), and XonoticTextBox_destroy().
| #define strhasword | ( | s, | |
| w ) |
Definition at line 370 of file string.qh.
Referenced by CvarList_Revert_Click(), GL_CheckExtension(), Map_IsRecent(), Physics_Valid(), W_HitPlotOpen(), XonoticCvarList_drawListBoxItem(), and XonoticCvarList_updateCvarType().
| #define VM_TEMPSTRING_MAXSIZE 16383 |
Definition at line 8 of file string.qh.
Referenced by cvar_changes_init().
Definition at line 319 of file string.qh.
References _shufflewords_str, entity(), pass, and swapwords().
Referenced by shufflewords().
returns first word
Definition at line 259 of file string.qh.
References strstrofs, and substring().
Referenced by _MapInfo_Generate(), _MapInfo_Map_ApplyGametype(), _MapInfo_Map_ApplyGametypeEx(), _MapInfo_Parse_Settemp(), _MapInfo_ParseArena(), GameCommand_adminmsg(), GameCommand_moveplayer(), get_model_parameters(), GlobalSound_sample(), Local_Notification_centerprint_Add(), Local_Notification_HUD_Notify_Push(), Local_Notification_sprintf(), MapInfo_Get_ByName_NoFallbacks(), matchacl(), PrecacheGlobalSound(), Process_Notif_Args(), STATIC_INIT_LATE(), W_GetCycleWeapon(), and XonoticStatsList_getStats().
color code replace, place inside of sprintf and parse the string
Definition at line 216 of file string.qh.
References autocvar_hud_colorset_background, autocvar_hud_colorset_foreground_1, autocvar_hud_colorset_foreground_2, autocvar_hud_colorset_foreground_3, autocvar_hud_colorset_foreground_4, autocvar_hud_colorset_kill_1, autocvar_hud_colorset_kill_2, autocvar_hud_colorset_kill_3, and strcat().
Referenced by centerprint_SetTitle(), hash_replace(), net_handle_ServerWelcome(), notif_arg_frag_ping(), notif_arg_frag_stats(), and notif_arg_spree_inf().
returns all but first word
Definition at line 268 of file string.qh.
References string_null, strlen, strstrofs, and substring().
Referenced by _MapInfo_Generate(), _MapInfo_Map_ApplyGametype(), _MapInfo_Map_ApplyGametypeEx(), _MapInfo_Parse_Settemp(), _MapInfo_ParseArena(), GameCommand_adminmsg(), GameCommand_moveplayer(), get_model_parameters(), GlobalSound_sample(), Local_Notification_centerprint_Add(), Local_Notification_HUD_Notify_Push(), Local_Notification_sprintf(), MapInfo_Get_ByName_NoFallbacks(), matchacl(), PrecacheGlobalSound(), Process_Notif_Args(), STATIC_INIT_LATE(), and W_GetCycleWeapon().
Definition at line 609 of file string.qh.
References eX, eY, isCaretEscaped(), isValidColorCodeValue(), LABEL, strlen, substring(), and vector.
Referenced by textLengthUpToLength(), textLengthUpToWidth(), and XonoticColorpicker_mouseDrag().
| [in] | tm | integer clocked time in tenths or hundredths, CANNOT be negative |
| [in] | hundredths | if true append hundredths too, otherwise only tenths |
| [in] | compact | if true leading 0s are omitted (except the seconds unit digit) |
Definition at line 148 of file string.qh.
References floor(), ftos(), strcat(), and substring().
Definition at line 196 of file string.qh.
References ColorTranslateMode.
Referenced by CSQC_Parse_Print(), entcs_GetName(), HUD_Mod_Race(), HUD_Notify(), HUD_Vote(), MakeRaceString(), MapVote_DrawSuggester(), minigame_show_allspecs(), Scoreboard_Draw(), and Scoreboard_Rankings_Draw().
Definition at line 276 of file string.qh.
References strcat().
Referenced by _json_parse_pair(), _MapInfo_ParseArena(), BanCommand_mute(), BanCommand_playban(), BanCommand_voteban(), Gametype::gametype_init(), GenericCommand_addtolist(), GenericCommand_maplist(), GenericCommand_removefromlist(), getlsmaps(), getmaplist(), ignore_add_player(), ignore_playerindb(), ignore_remove_player(), Map_MarkAsRecent(), MapList_Add_All(), Maplist_Init(), MUTATOR_HOOKFUNCTION(), spawnfunc(), W_Apply_Weaponreplace(), waypoint_loadall(), waypoint_saveall(), and XonoticPlayerList_drawListBoxItem().
Definition at line 284 of file string.qh.
References strcat().
Referenced by _getcommandkey(), net_handle_ServerWelcome(), translate_weaponarena(), and XonoticKeyBinder_drawListBoxItem().
Definition at line 70 of file string.qh.
References floor().
Referenced by strftime_s().
Definition at line 180 of file string.qh.
References floor().
converts a number to a string with the indicated number of decimals
Definition at line 469 of file string.qh.
References number.
Referenced by dialog_hudpanel_main_settings(), DrawDomItem(), formatStringSpecial(), HUD_Physics(), HUD_Score(), MakeRaceString(), MixedSlider_addRange(), MUTATOR_HOOKFUNCTION(), StrafeHUD_DrawJumpHeight(), StrafeHUD_DrawStartSpeed(), StrafeHUD_DrawStrafeEfficiency(), StrafeHUD_DrawVerticalAngle(), updateSensField(), waypoint_save_links(), waypoint_saveall(), and XonoticDecibelsSlider_valueToText().
converts a percentage to a string with the indicated number of decimals
Definition at line 480 of file string.qh.
References number.
Referenced by dialog_hudpanel_main_settings(), formatStringSpecial(), Scoreboard_AccuracyStats_Draw(), XonoticDecibelsSlider_valueToText(), XonoticLanguageList_drawListBoxItem(), XonoticScreenshotImage_draw(), and XonoticStatsList_getStats().
Converts a number to a string with the minimum number of decimals It assumes that an extreme accuracy of the input number is not needed and reduces the max number of decimals to 4 in order to hide minor representation errors that can easily happen even with small numbers, e.g.: x = 32.1; sprintf("%f", x): "32.099998" x = 4; x += 0.01; x += 0.01; sprintf("%f", x): "4.020001" Reducing the max number of decimals to 5 is not enough to hide most errors.
Definition at line 497 of file string.qh.
References fabs(), ftos(), number, rint(), strstrofs, and substring().
Referenced by dialog_hudpanel_main_settings(), gettooltip_dependency_string_numeric(), HUD_Panel_InputEvent(), HUD_Panel_SetPos(), HUD_Panel_SetPosSize(), XonoticCheckBox_saveCvars(), XonoticMixedSlider_saveCvars(), and XonoticSlider_saveCvars().
Definition at line 580 of file string.qh.
References substring().
Referenced by checkColorCode(), and XonoticColorpicker_mouseDrag().
Definition at line 387 of file string.qh.
References cvar(), str2chr, and strlen.
Referenced by PlayerFrame().
Definition at line 591 of file string.qh.
References IS_DIGIT, IS_HEXDIGIT, and substring().
Referenced by checkColorCode().
| [in] | seconds | number of seconds, can be negative too |
Definition at line 126 of file string.qh.
References floor().
Referenced by formatmessage(), HUD_CenterPrint(), HUD_Pickup(), and HUD_Timer().
Definition at line 325 of file string.qh.
References _shufflewords_str, _shufflewords_swapfunc(), NULL, shuffle(), string_null, and tokenizebyseparator.
Definition at line 239 of file string.qh.
References strcasecmp, strlen, and substring().
Referenced by MapInfo_FindName().
Definition at line 94 of file string.qh.
References days_up_to_date(), DAYS_UP_TO_EPOCH, floor(), ftos(), stof(), strcat(), and substring().
Referenced by spawnfunc().
Definition at line 30 of file string.qh.
References vector.
Referenced by centerprint_SetDuelTitle(), Checkpoints_drawstring(), Draw_ShowNames(), GameTypeVote_DrawGameTypeItem(), HUD_CenterPrint(), HUD_Chat(), HUD_Mod_Race(), HUD_Notify(), HUD_Quickmenu_DrawEntry(), HUD_Score_Rankings(), HUD_Vote(), InfoMessages_drawstring(), MakeRaceString(), minigame_drawcolorcodedstring_trunc(), minigame_drawcolorcodedstring_wrapped(), minigame_show_allspecs(), Scoreboard_Draw(), Scoreboard_DrawOthers(), Scoreboard_FixColumnWidth(), and Scoreboard_Rankings_Draw().
Definition at line 35 of file string.qh.
References vector.
Referenced by HUD_Pickup(), MapVote_FormatMapItem(), minigame_drawstring_trunc(), and minigame_drawstring_wrapped().
Definition at line 361 of file string.qh.
References strstrofs, and substring().
Referenced by Map_MarkAsRecent().
Definition at line 292 of file string.qh.
References substring().
Referenced by DamageText::DamageText_update(), and swapwords().
Definition at line 298 of file string.qh.
References argv(), argv_end_index, argv_start_index, s1, s2, strcat(), substring_range(), and tokenizebyseparator.
Referenced by _shufflewords_swapfunc().
Definition at line 373 of file string.qh.
References str2chr.
Referenced by InputBox_enterText().
Definition at line 336 of file string.qh.
References strcat(), strlen, strunzone(), strzone(), and substring().
Definition at line 557 of file string.qh.
References strcasecmp, and vercmp_recursive().
Referenced by PlayerFrame(), and UpdateNotification_URI_Get_Callback().
Definition at line 538 of file string.qh.
References s1, s2, stof(), strcasecmp, strstrofs, substring(), and vercmp_recursive().
Referenced by vercmp(), and vercmp_recursive().
| string _shufflewords_str |
Definition at line 317 of file string.qh.
Referenced by _shufflewords_swapfunc(), and shufflewords().
| string autocvar_hud_colorset_background = "7" |
| string autocvar_hud_colorset_foreground_1 = "2" |
| string autocvar_hud_colorset_foreground_2 = "3" |
| string autocvar_hud_colorset_foreground_3 = "4" |
| string autocvar_hud_colorset_foreground_4 = "1" |
| string autocvar_hud_colorset_kill_1 = "1" |
| string autocvar_hud_colorset_kill_2 = "3" |
| string autocvar_hud_colorset_kill_3 = "4" |
| int ColorTranslateMode |
Definition at line 193 of file string.qh.
Referenced by ColorTranslateRGB(), and CSQC_UpdateView().
| const string HEXDIGITS = "0123456789ABCDEF0123456789abcdef" |