Current time: 23.03.2024, 19:53 Hello There, Guest! (LoginRegister)
Language: english | russian  

Post Reply 
Threaded Mode | Linear Mode
ERA BattleQueue
» Move order for combat / очерёдность хода в битве
Author Message
Berserker Offline
Administrators

Posts: 16449
Post: #10

RoseKavalier, brilliant work!
I recomment to use only translation keys in json in English.
{
"caption": "have a nive day"
}
All other translations can be released by enthusiasts as standalone mods and they will virtually overwrite your file.

Or create Lang directory in your mod with *.json,
{
    "ebq": {
    all key value pairs
    }
}
And use

Code:
typedef char* (__stdcall *TTr) (const char* key, const char** params, int highParams);

  TTr _tr = NULL;

  /**
   * Returns translation for given complex key ('xxx.yyy.zzz') with substituted parameters.
   * Pass vector of (parameter name, parameter value) pairs to substiture named parameters.
   * Example: Mod\Lang\*.json file: { "eqs": { "greeting": "Hello, @name@" } }
   * Example: ShowMessage(tr("eqs.greeting", { "name", "igrik" }).c_str());
   *
   * @param  key    Key to get translation for.
   * @param  params Vector of (parameter name, parameter value pairs).
   * @return        Translation string.
   */
  std::string tr (const char *key, const std::vector<std::string> params = {}) {
    const int MAX_PARAMS = 64;
    const char* _params[MAX_PARAMS];
    int numParams = params.size() <= MAX_PARAMS ? params.size() : MAX_PARAMS;

    for (int i = 0; i < numParams; i++) {
      _params[i] = params[i].c_str();
    }

    char* buf = _tr(key, _params, numParams - 1);
    MemFree(buf);

    return buf;
  }

hEra                  = LoadLibrary("era.dll");
_tr                   = (TTr)                   GetProcAddress(hEra, "tr");


Скачать Герои 3 Эра и всё, что с ней связано / ERA 2.46f для старых модов
Поддержать проект
16.06.2020 13:47
Find all posts by this user Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
ERA BattleQueue - RoseKavalier - 16.06.2020, 08:24
RE: ERA BattleQueue - Grossmaster - 16.06.2020, 08:46
RE: ERA BattleQueue - Bes - 16.06.2020, 10:07
RE: ERA BattleQueue - planetavril - 16.06.2020, 10:29
RE: ERA BattleQueue - Valery - 16.06.2020, 10:43
RE: ERA BattleQueue - igrik - 16.06.2020, 10:45
RE: ERA BattleQueue - Archer30 - 16.06.2020, 11:35
RE: ERA BattleQueue - Algor - 16.06.2020, 11:43
RE: ERA BattleQueue - XEPOMAHT - 16.06.2020, 13:42
RE: ERA BattleQueue - Berserker - 16.06.2020 13:47
RE: ERA BattleQueue - daemon_n - 16.06.2020, 16:43
RE: ERA BattleQueue - RoseKavalier - 16.06.2020, 17:08
RE: ERA BattleQueue - Algor - 16.06.2020, 17:41
RE: ERA BattleQueue - RoseKavalier - 16.06.2020, 22:39
RE: ERA BattleQueue - daemon_n - 16.06.2020, 23:02
RE: ERA BattleQueue - Berserker - 17.06.2020, 00:11
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 01:50
RE: ERA BattleQueue - Berserker - 17.06.2020, 02:23
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 03:03
RE: ERA BattleQueue - Berserker - 17.06.2020, 03:25
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 04:37
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 07:12
RE: ERA BattleQueue - daemon_n - 17.06.2020, 07:35
RE: ERA BattleQueue - RoseKavalier - 17.06.2020, 09:26
RE: ERA BattleQueue - Berserker - 17.06.2020, 15:00
RE: ERA BattleQueue - RoseKavalier - 22.06.2020, 03:58
RE: ERA BattleQueue - Berserker - 22.06.2020, 04:22
RE: ERA BattleQueue - Archer30 - 22.06.2020, 12:04
RE: ERA BattleQueue - Archer30 - 09.07.2020, 11:27
RE: ERA BattleQueue - RoseKavalier - 09.07.2020, 17:29
RE: ERA BattleQueue - daemon_n - 08.08.2020, 16:24
RE: ERA BattleQueue - Bes - 08.08.2020, 23:10
RE: ERA BattleQueue - daemon_n - 08.08.2020, 23:35
RE: ERA BattleQueue - Bes - 09.08.2020, 00:05
RE: ERA BattleQueue - RoseKavalier - 09.08.2020, 07:43
RE: ERA BattleQueue - daemon_n - 09.08.2020, 12:04
RE: ERA BattleQueue - Bes - 09.08.2020, 15:44
RE: ERA BattleQueue - RoseKavalier - 10.08.2020, 01:15
RE: ERA BattleQueue - ilya - 07.05.2021, 20:14
RE: ERA BattleQueue - helgtla - 20.12.2021, 19:43
RE: ERA BattleQueue - Berserker - 20.12.2021, 23:01
RE: ERA BattleQueue - RoseKavalier - 21.12.2021, 05:54
RE: ERA BattleQueue - RoseKavalier - 31.12.2021, 07:33
RE: ERA BattleQueue - Berserker - 31.12.2021, 11:31
RE: ERA BattleQueue - Raistlin - 31.12.2021, 21:29

Forum Jump:

Powered by MyBB Copyright © 2002-2024 MyBB Group