forked from github/server
Unicode WIP:
- links on Linux (Jamfile changes) - bugfix latin1/newfactions file
This commit is contained in:
parent
8fbb513b63
commit
b132ffdd2b
9 changed files with 37 additions and 18 deletions
|
@ -18,10 +18,11 @@ SOURCES =
|
||||||
luck.c
|
luck.c
|
||||||
monster.c
|
monster.c
|
||||||
randenc.c
|
randenc.c
|
||||||
# report.c
|
report.c
|
||||||
spells.c
|
spells.c
|
||||||
spy.c
|
spy.c
|
||||||
study.c
|
study.c
|
||||||
|
summary.c
|
||||||
xmlreport.c
|
xmlreport.c
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -908,12 +908,12 @@ describe(FILE * F, const region * r, int partial, faction * f)
|
||||||
/* Spezielle Richtungen */
|
/* Spezielle Richtungen */
|
||||||
for (a = a_find(r->attribs, &at_direction);a && a->type==&at_direction;a=a->next) {
|
for (a = a_find(r->attribs, &at_direction);a && a->type==&at_direction;a=a->next) {
|
||||||
spec_direction * d = (spec_direction *)(a->data.v);
|
spec_direction * d = (spec_direction *)(a->data.v);
|
||||||
strcpy(bufp++, " ");
|
bufp += strlcpy(bufp, " ", sizeof(buf) - (bufp-buf));
|
||||||
bufp += strxcpy(bufp, d->desc);
|
bufp += strlcpy(bufp, LOC(f->locale, d->desc), sizeof(buf) - (bufp-buf));
|
||||||
bufp += strxcpy(bufp, " (\"");
|
bufp += strlcpy(bufp, " (\"", sizeof(buf) - (bufp-buf));
|
||||||
bufp += strxcpy(bufp, d->keyword);
|
bufp += strlcpy(bufp, LOC(f->locale, d->keyword), sizeof(buf) - (bufp-buf));
|
||||||
bufp += strxcpy(bufp, "\")");
|
bufp += strlcpy(bufp, "\")", sizeof(buf) - (bufp-buf));
|
||||||
strcpy(bufp++, ".");
|
bufp += strlcpy(bufp, ".", sizeof(buf) - (bufp-buf));
|
||||||
dh = 1;
|
dh = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -248,21 +248,21 @@ register_special_direction(const char * name)
|
||||||
static int
|
static int
|
||||||
a_readdirection(attrib *a, FILE *f)
|
a_readdirection(attrib *a, FILE *f)
|
||||||
{
|
{
|
||||||
char lbuf[16];
|
|
||||||
spec_direction *d = (spec_direction *)(a->data.v);
|
spec_direction *d = (spec_direction *)(a->data.v);
|
||||||
|
|
||||||
fscanf(f, "%hd %hd %d", &d->x, &d->y, &d->duration);
|
fscanf(f, "%hd %hd %d", &d->x, &d->y, &d->duration);
|
||||||
fscanf(f, "%15s ", lbuf);
|
|
||||||
d->desc = strdup(lbuf);
|
|
||||||
fscanf(f, "%15s ", lbuf);
|
|
||||||
if (global.data_version<UNICODE_VERSION) {
|
if (global.data_version<UNICODE_VERSION) {
|
||||||
|
char lbuf[16];
|
||||||
|
fscanf(f, "%*s ");
|
||||||
|
fscanf(f, "%s ", lbuf);
|
||||||
dir_lookup * dl = dir_name_lookup;
|
dir_lookup * dl = dir_name_lookup;
|
||||||
|
|
||||||
cstring_i(d->desc);
|
|
||||||
cstring_i(lbuf);
|
cstring_i(lbuf);
|
||||||
for (;dl;dl=dl->next) {
|
for (;dl;dl=dl->next) {
|
||||||
if (strcmp(lbuf, dl->oldname)==0) {
|
if (strcmp(lbuf, dl->oldname)==0) {
|
||||||
d->keyword=strdup(dl->name);
|
d->keyword=strdup(dl->name);
|
||||||
|
sprintf(lbuf, "%s_desc", d->keyword);
|
||||||
|
d->desc=strdup(dl->name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,6 +272,10 @@ a_readdirection(attrib *a, FILE *f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
char lbuf[16];
|
||||||
|
fscanf(f, "%15s ", lbuf);
|
||||||
|
d->desc = strdup(lbuf);
|
||||||
|
fscanf(f, "%15s ", lbuf);
|
||||||
d->keyword = strdup(lbuf);
|
d->keyword = strdup(lbuf);
|
||||||
}
|
}
|
||||||
d->active = true;
|
d->active = true;
|
||||||
|
|
|
@ -169,7 +169,7 @@ extern struct region * find_special_direction(const struct region *r, const char
|
||||||
extern void register_special_direction(const char * name);
|
extern void register_special_direction(const char * name);
|
||||||
extern struct spec_direction * special_direction(const region * from, const region * to);
|
extern struct spec_direction * special_direction(const region * from, const region * to);
|
||||||
extern struct attrib *create_special_direction(struct region *r, struct region *rt,
|
extern struct attrib *create_special_direction(struct region *r, struct region *rt,
|
||||||
int duration, const char *desc,
|
int duration, const char *desc,
|
||||||
const char *keyword);
|
const char *keyword);
|
||||||
|
|
||||||
int deathcount(const struct region * r);
|
int deathcount(const struct region * r);
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include <util/rng.h>
|
#include <util/rng.h>
|
||||||
#include <util/sql.h>
|
#include <util/sql.h>
|
||||||
|
|
||||||
|
#include <libxml/encoding.h>
|
||||||
|
|
||||||
/* libc includes */
|
/* libc includes */
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
@ -239,6 +241,18 @@ read_newfactions(const char * filename)
|
||||||
/* if the script didn't supply the race as a token, then it gives us a
|
/* if the script didn't supply the race as a token, then it gives us a
|
||||||
* race in the default locale (which means that itis a UTF8 string) */
|
* race in the default locale (which means that itis a UTF8 string) */
|
||||||
nf->race = findrace(race, default_locale);
|
nf->race = findrace(race, default_locale);
|
||||||
|
if (nf->race==NULL) {
|
||||||
|
char buffer[32];
|
||||||
|
int outbytes = sizeof(buffer);
|
||||||
|
int inbytes = strlen(race);
|
||||||
|
isolat1ToUTF8((unsigned char *)buffer, &outbytes, (const unsigned char *)race, &inbytes);
|
||||||
|
nf->race = findrace(buffer, default_locale);
|
||||||
|
if (nf->race==NULL) {
|
||||||
|
log_error(("new faction has unknown race '%s'.\n", race));
|
||||||
|
free(nf);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
nf->lang = find_locale(lang);
|
nf->lang = find_locale(lang);
|
||||||
nf->bonus = bonus;
|
nf->bonus = bonus;
|
||||||
|
|
|
@ -11,6 +11,7 @@ SubDirHdrs $(XMLHDRS) ;
|
||||||
SOURCES =
|
SOURCES =
|
||||||
dragons.c
|
dragons.c
|
||||||
illusion.c
|
illusion.c
|
||||||
|
races.c
|
||||||
zombies.c
|
zombies.c
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ SOURCES =
|
||||||
cvector.c
|
cvector.c
|
||||||
dice.c
|
dice.c
|
||||||
event.c
|
event.c
|
||||||
|
filereader.c
|
||||||
functions.c
|
functions.c
|
||||||
goodies.c
|
goodies.c
|
||||||
graph.c
|
graph.c
|
||||||
|
|
|
@ -620,7 +620,7 @@ load_inifile(const char * filename)
|
||||||
luafile = iniparser_getstring(d, "eressea:run", luafile);
|
luafile = iniparser_getstring(d, "eressea:run", luafile);
|
||||||
g_reportdir = iniparser_getstring(d, "eressea:report", g_reportdir);
|
g_reportdir = iniparser_getstring(d, "eressea:report", g_reportdir);
|
||||||
|
|
||||||
str = iniparser_getstring(d, "common:locales", "de");
|
str = iniparser_getstring(d, "common:locales", "de,en");
|
||||||
make_locales(str);
|
make_locales(str);
|
||||||
}
|
}
|
||||||
inifile = d;
|
inifile = d;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
-- the locales that this gameworld supports.
|
-- the locales that this gameworld supports.
|
||||||
local locales = { "de", "en" }
|
local locales = { "de", "en" }
|
||||||
enc_orders = "ISO-8859-1"
|
|
||||||
enc_game = "ISO-8859-1"
|
|
||||||
|
|
||||||
function loadscript(name)
|
function loadscript(name)
|
||||||
local script = scriptpath .. "/" .. name
|
local script = scriptpath .. "/" .. name
|
||||||
|
@ -56,7 +54,7 @@ function process(orders)
|
||||||
equipment_setitem("new_faction", "money", "4200");
|
equipment_setitem("new_faction", "money", "4200");
|
||||||
|
|
||||||
file = "" .. get_turn()
|
file = "" .. get_turn()
|
||||||
set_encoding(enc_game)
|
-- set_encoding(enc_game)
|
||||||
if read_game(file)~=0 then
|
if read_game(file)~=0 then
|
||||||
print("could not read game")
|
print("could not read game")
|
||||||
return -1
|
return -1
|
||||||
|
@ -67,7 +65,7 @@ function process(orders)
|
||||||
loadscript("eressea/multis.lua")
|
loadscript("eressea/multis.lua")
|
||||||
|
|
||||||
-- run the turn:
|
-- run the turn:
|
||||||
if read_orders(orders, enc_orders) ~= 0 then
|
if read_orders(orders) ~= 0 then
|
||||||
print("could not read " .. orders)
|
print("could not read " .. orders)
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue