- Locale kann bei Erschaffen der Partei im Mapper angegeben werden.

This commit is contained in:
Christian Schlittchen 2001-05-28 18:24:44 +00:00
parent b05d1c898c
commit 52667dc453
5 changed files with 43 additions and 11 deletions

View File

@ -224,10 +224,9 @@ destroyfaction(faction * f)
void
restart(unit *u, int race)
{
faction *f = addplayer(u->region, u->faction->email, race)->faction;
faction *f = addplayer(u->region, u->faction->email, race, u->faction->locale)->faction;
f->magiegebiet = u->faction->magiegebiet;
f->options = u->faction->options;
f->locale = u->faction->locale;
destroyfaction(u->faction);
}

View File

@ -1113,6 +1113,8 @@ extern void kernel_done(void);
extern void reorder_owners(struct region * r);
extern const char *locales[];
#define FIRST_TURN 184
#include <log.h>

View File

@ -64,7 +64,7 @@ unused_faction_id(void)
}
unit *
addplayer(region *r, char *email, race_t frace)
addplayer(region *r, char *email, race_t frace, locale *loc)
{
int i;
unit *u;
@ -81,6 +81,7 @@ addplayer(region *r, char *email, race_t frace)
f->age = 0;
f->race = frace;
f->magiegebiet = 0;
f->locale = loc;
set_ursprung(f, 0, r->x, r->y);
f->options = Pow(O_REPORT) | Pow(O_ZUGVORLAGE) | Pow(O_SILBERPOOL);

View File

@ -72,6 +72,6 @@ typedef struct faction {
extern const char * factionname(const struct faction * f);
extern void * resolve_faction(void * data);
extern struct unit * addplayer(struct region *r, char *email, race_t frace);
extern struct unit * addplayer(struct region *r, char *email, race_t frace, struct locale *loc);
#endif

View File

@ -28,6 +28,7 @@
/* util includes */
#include <base36.h>
#include <language.h>
/* libc includes */
#include <ctype.h>
@ -291,12 +292,13 @@ NeuePartei(region * r)
race_t frace;
int late;
unit *u;
int locale_nr;
if (!r->land) {
warnung(0, "Ungeeignete Region! <Taste>");
return;
}
win = openwin(SX - 10, 9, "< Neue Partei einfügen >");
win = openwin(SX - 10, 12, "< Neue Partei einfügen >");
strcpy(buf, my_input(win, 2, 1, "EMail-Adresse (Leer->Ende): ", NULL));
if (!buf[0]) {
@ -313,28 +315,56 @@ NeuePartei(region * r)
sprintf(buf, "%d=%s; ", i, race[i].name[0]);
q += strlen(buf);
if (q > SX - 20) {
q = strlen(buf);
y++;
wmove(win, y, 4);
q = strlen(buf);
y++;
wmove(win, y, 4);
}
wAddstr(buf);
}
wrefresh(win);
y++;
do {
frace = (char) map_input(win, 2, 2, "Rasse", -1, MAXRACES-1, 0);
frace = (char) map_input(win, 2, y, "Rasse", -1, MAXRACES-1, 0);
} while(race[frace].nonplayer);
if(frace == -1) {
delwin(win);
return;
}
late = (int) map_input(win, 2, 5, "Startbonus", 0, 99, 0);
y++;
late = (int) map_input(win, 2, y, "Startbonus", -1, 99, 0);
if(late == -1) {
delwin(win);
return;
}
i = 0; q = 0; y++;
wmove(win, y, 4);
while(locales[i] != NULL) {
sprintf(buf, "%d=%s; ", i, locales[i]);
q += strlen(buf);
if (q > SX - 20) {
q = strlen(buf);
y++;
wmove(win, y, 4);
}
wAddstr(buf);
i++;
}
wrefresh(win);
y++;
locale_nr = map_input(win, 2, 8, "Locale", -1, i-1, 0);
if(locale_nr == -1) {
delwin(win);
return;
}
delwin(win);
modified = 1;
u = addplayer(r, email, frace);
u = addplayer(r, email, frace, find_locale(locales[locale_nr]));
if(late) give_latestart_bonus(r, u, late);