Jump to content

Recommended Posts

Hello everyone

İ am using lc_text like this.

open server/game/src/locale.hpp
  
find
  
	#define LC_TEXT(str) locale_find(str)
  
remove and add

	const char* LC_TEXT(str,...)
	{
		char locale_text[CHAT_MAX_LEN + 1];
		va_list args;
		va_start(args, str);
		int len = vsnprintf(locale_text, sizeof(locale_text), locale_find(str), args);
		va_end(args);
		return locale_text;
	}


Example:

Old version:

char buf[256];
sprintf(buf, LC_TEXT("HELLO"),"ARG1",2,"ARG3");
ChatPacket(CHAT_TYPE_INFO, buf);

New Version:

ChatPacket(CHAT_TYPE_INFO, LC_TEXT("HELLO","ARG1",2,"ARG3"));

 

  • Sad 1
  • Love 1
Link to comment
https://metin2.dev/topic/22176-advanced-locale-text/
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.