1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Object related stuff and better dutch translation

Implemented: paint_path_entry
Implemented: paint_stex_entry
-> Scenarios texts are now shown correctly localized
Better dutch translation based on the original dutch rct2
This commit is contained in:
Gericom
2015-02-25 15:06:29 +01:00
parent e376116e80
commit ac6fa31292
5 changed files with 3692 additions and 3484 deletions

View File

@@ -20,6 +20,7 @@
#include "../addresses.h"
#include "localisation.h"
#include "../object.h"
const char *language_names[LANGUAGE_COUNT] = {
"", // LANGUAGE_UNDEFINED
@@ -224,3 +225,64 @@ void language_close()
gCurrentLanguage = LANGUAGE_UNDEFINED;
}
const int OpenRCT2LangIdToObjectLangId[] = {
0, 0, 1, 3, 6, 2, 0, 0, 4, 7
};
//0x006A9E24
rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/*ecx*/, int index/*ebx*/, int tableindex/*edx*/)
{
char* pString;
int result = 0;
while (true)
{
uint8_t language_code = ((uint8_t*)*pStringTable)[0];
(*pStringTable)++;
if (language_code == 0xFF) //end of string table
break;
if (language_code == OpenRCT2LangIdToObjectLangId[gCurrentLanguage])//1)
{
pString = *pStringTable;
result |= 1;
}
if (language_code == 0 && !(result & 1))
{
pString = *pStringTable;
result |= 2;
}
if (!(result & 7))
{
pString = *pStringTable;
result |= 4;
}
while (true)
{
uint8_t character = ((uint8_t*)*pStringTable)[0];
(*pStringTable)++;
if (character == 0) break;
}
}
if (RCT2_GLOBAL(0x9ADAFC, uint8_t) == 0)
{
int stringid = 0xD87;
int i;
for (i = 0; i < type; i++)
{
int nrobjects = object_entry_group_counts[i];
int nrstringtables = RCT2_GLOBAL(0x98DA16 + i * 2, uint16_t);//the number of string tables in a type
stringid += nrobjects * nrstringtables;
}
stringid += index * RCT2_GLOBAL(0x98DA16 + type * 2, uint16_t);
RCT2_GLOBAL(0x00F42BBC, uint32) = stringid;
stringid += tableindex;
RCT2_GLOBAL(0x009BF2D4 + stringid * 4, char*) = pString;//put pointer in stringtable
return stringid;
}
else
{
int stringid = 0xD77 + tableindex;
RCT2_GLOBAL(0x009BF2D4 + stringid * 4, char*) = pString;//put pointer in stringtable
return stringid;
}
}

View File

@@ -44,4 +44,6 @@ const char *language_get_string(rct_string_id id);
int language_open(int id);
void language_close();
rct_string_id object_get_localised_text(uint8_t** pStringTable/*ebp*/, int type/*ecx*/, int index/*ebx*/, int tableindex/*edx*/);
#endif