From f6554cb5adb417cf6796921c0089a8cd94f0b3ee Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 10 May 2016 22:56:44 +0200 Subject: [PATCH] Initial commit with Hungarian texts (eww) --- Makefile | 19 ++ adatok.xml | 6 + config.h | 2 + convert.c | 72 +++++++ defines.h | 44 +++++ functions.h | 25 +++ kap_update.c | 224 ++++++++++++++++++++++ karakter.c | 64 +++++++ kargen.c | 233 +++++++++++++++++++++++ kargen.dat | 38 ++++ lapok.c | 455 ++++++++++++++++++++++++++++++++++++++++++++ magus_kargen_res.ui | 50 +++++ main.c | 298 +++++++++++++++++++++++++++++ ruin.xml | 26 +++ variables.h | 9 + 15 files changed, 1565 insertions(+) create mode 100644 Makefile create mode 100644 adatok.xml create mode 100644 config.h create mode 100644 convert.c create mode 100644 defines.h create mode 100644 functions.h create mode 100644 kap_update.c create mode 100644 karakter.c create mode 100644 kargen.c create mode 100644 kargen.dat create mode 100644 lapok.c create mode 100644 magus_kargen_res.ui create mode 100644 main.c create mode 100644 ruin.xml create mode 100644 variables.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..729ffc5 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +EXE = kargen +OBJECTS = main.o convert.o lapok.o karakter.o +MODULES = gtk+-3.0 libxml-2.0 +LIBS = $(shell pkg-config --libs $(MODULES)) -lm +LDFLAGS = -g -Wall +CFLAGS = $(shell pkg-config --cflags $(MODULES)) -g -Wall +RM = rm -f + +all: $(OBJECTS) + $(CC) -o $(EXE) $(LIBS) $(LDFLAGS) $(OBJECTS) + +.c.o: + $(CC) $(CFLAGS) -c -o $@ $< + +clean: + $(RM) $(OBJECTS) $(EXE) + +.PHONY: all clean + diff --git a/adatok.xml b/adatok.xml new file mode 100644 index 0000000..38cebc3 --- /dev/null +++ b/adatok.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/config.h b/config.h new file mode 100644 index 0000000..1a7c2ef --- /dev/null +++ b/config.h @@ -0,0 +1,2 @@ +#define KEZDO_KAP 375 + diff --git a/convert.c b/convert.c new file mode 100644 index 0000000..81a93f8 --- /dev/null +++ b/convert.c @@ -0,0 +1,72 @@ +#include +#include +#include +#include + +gint +convert_string(char *from_string, char **to_string) +{ + char *src = g_strdup(from_string); + int src_len = strlen(src); + char *outbuf = NULL; + int outlen = src_len; + char *final = NULL; + char *out_ptr = NULL; + + if (src && src_len) + { + iconv_t ic = iconv_open("UTF-8", "ISO-8859-2"); + unsigned int inlenleft = src_len; + char *src_ptr = (char *)src; + unsigned int outlenleft = src_len; + + if (ic != (iconv_t)-1) + { + size_t st; + + outbuf = (char *)g_malloc(outlen + 1); + + if (outbuf) + { + out_ptr = (char *)outbuf; + + while (inlenleft) + { + st = iconv(ic, &src_ptr, &inlenleft, &out_ptr, &outlenleft); + + if (st == -1) + { + if (errno == E2BIG) + { + int diff = out_ptr - outbuf; + + outlen += inlenleft; + outlenleft += inlenleft; + outbuf = (char *)g_realloc(outbuf, outlen + 1); + if (!outbuf) + return -1; + out_ptr = outbuf + diff; + } + else + { + g_free(outbuf); + outbuf = NULL; + return -1; + } + } + } + } + } + } + final = g_malloc((out_ptr - outbuf) + 1); + memset(final, 0, (out_ptr - outbuf) + 1); + strncpy(final, outbuf, (out_ptr - outbuf)); + g_free(outbuf); + + if (to_string) + *to_string = final; + + + return 0; +} + diff --git a/defines.h b/defines.h new file mode 100644 index 0000000..5930d29 --- /dev/null +++ b/defines.h @@ -0,0 +1,44 @@ +#ifndef _MAGUS_KARGEN_DEFINES_H +# define _MAGUS_KARGEN_DEFINES_H + +# define CONVERT(x) convert_string(x, &buf); + +#define A_JATEKOS_ES_A_KARAKTER_ADATAI "A játékos és a karakter adatai" +#define EGYBOL_LATHATO_HALLHATO_DOLGOK "Egyből látható, hallható dolgok" +#define KEPESSEGEK "Képességek" +#define A_KARAKTER_FOBB_ADATAI "A karakter főbb adatai (név, család, származás, rangok)" +#define MEGJELENES "Megjelenés" +#define ALLANDO_ERZELMEK "Állandó érzelmek" +#define SZIMPATIKUS_VISZONYOK "Szimpatikus viszonyok" +#define ISMERTSEG "Kapcsolatok, ismertség" +#define KULONLEGES_KEPESSEGEK "Különleges képességek, hátrányok" +#define TAPASZTALATI_PONTOK "Tapasztalati pontok, átváltás" +#define KEPZETTSEGEK "Képzettségek" +#define NYELVEK "Nyelvek" +#define HARCERTEKEK "Harcértékek (fegyver nélkül)" +#define ELETERO "Életerő" +#define PSZI "Pszi (Ψ), mágiaellenállás" +#define MAGIA "Mágia" +#define FEGYVEREK_PAJZS "Fegyverek, pajzs" +#define ALLATOK_CSATLOSOK "Állatok, csatlósok, szolgák" +#define MESTEREK "Mesterek" +#define BIRTOKOK_BEFEKTETESEK "Birtokok, befektetések, intézmények" +#define ALAKULATOK "Alakulatok" +#define ISKOLAK "Iskolák" +#define MUVEK "Főbb művek" +#define ERTEKEK "Pénz, drágakövek, nemesfémek, ékszerek" +#define RUHAK "Ruhák, álruhák" +#define VARAZSTARGYAK "Varázstárgyak" +#define FELSZERELES "Felszerelés" +#define VARAZSLATOK "Varázslatok" +#define TANULAS "Tanulás" +#define SEBESULESEK "Sebesülések" +#define BETEGSEGEK "Betegségek, mérgezések" +#define VARAZSLAT_KUTATAS "Varázslat kutatás" +#define KULONLEGES_DOLGOK "Különleges fegyverek, tárgyak" +#define MEGJEGYZESEK "Megjegyzések" +#define TORTENET "Történet" +#define KEPEK "Képek" + +#endif /* _MAGUS_KARGEN_DEFINES_H */ + diff --git a/functions.h b/functions.h new file mode 100644 index 0000000..7055f9d --- /dev/null +++ b/functions.h @@ -0,0 +1,25 @@ +#ifndef _MAGUS_KARGEN_FUNCTIONS_H +# define _MAGUS_KARGEN_FUNCTIONS_H + +# include + +/* convert.c */ +gint convert_string(char *from_string, char **to_string); + +/* lapok.c */ +void azonnal_lathato_dolgok_lap(GtkTable *azonnal_tabla); +void kepessegek_lap(GtkTable *kepessegek_tabla); +void jatekos_es_karakter_lap(GtkTable *jatekos_tabla); +void fobb_adatok_lap(GtkTable *adat_tabla); +void megjelenes_lap(GtkTable *megj_tabla); +void erzelmek_lap(GtkTable *erzelem_tabla); +void tapasztalat_lap(GtkTable *tp_tabla); +void harcertekek_lap(GtkTable *hm_tabla); +void eletero_lap(GtkTable *eletero_tabla); +void pszi_lap(GtkTable *pszi_lap); + +/* karakter.c */ +void karakter_betoltes(gchar *filenev); + +#endif /* _MAGUS_KARGEN_FUNCTIONS_H */ + diff --git a/kap_update.c b/kap_update.c new file mode 100644 index 0000000..d1eea23 --- /dev/null +++ b/kap_update.c @@ -0,0 +1,224 @@ +#include +#include "config.h" + +extern gint aktiv_kap; +extern GtkWidget *ero_spin, + *gyorsasag_spin, + *ugyesseg_spin, + *allokepesseg_spin, + *egeszseg_spin, + *szepseg_spin, + *intelligencia_spin, + *akaratero_spin, + *asztral_spin, + *erzekeles_spin, + *ke_spin, + *te_spin, + *ve_spin, + *ce_spin, + *epalap_spin, + *fpalap_spin, + *mpalap_spin, + *ppalap_spin; + +void set_kap_ertek(); + +void +update_kap() +{ + gint kepesseg, + levonando; + + levonando = 0; + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ero_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(gyorsasag_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ugyesseg_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(allokepesseg_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(egeszseg_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(szepseg_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(intelligencia_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(akaratero_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(asztral_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(erzekeles_spin)); + while (kepesseg > 18) + { + kepesseg--; + levonando += 3; + } + while (kepesseg > 15) + { + kepesseg--; + levonando += 2; + } + while (kepesseg > 0) + { + kepesseg--; + levonando++; + } + + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ke_spin)); + levonando += kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(te_spin)); + levonando += kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ve_spin)); + levonando += kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ce_spin)); + levonando += 2 * kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(epalap_spin)); + levonando += 2 * kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(fpalap_spin)); + levonando += kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(mpalap_spin)); + levonando += 2 * kepesseg; + kepesseg = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(ppalap_spin)); + levonando += 2 * kepesseg; + + aktiv_kap = KEZDO_KAP - levonando; + set_kap_ertek(); +} + diff --git a/karakter.c b/karakter.c new file mode 100644 index 0000000..b1a5ad8 --- /dev/null +++ b/karakter.c @@ -0,0 +1,64 @@ +#include +#include +#include +#include + +static void +print_element_names(xmlNode *root, xmlNode * a_node) +{ + xmlNode *cur_node = NULL; + + for (cur_node = a_node; cur_node; cur_node = cur_node->next) + { + if (cur_node->type == XML_ELEMENT_NODE) + { + gchar *path; + xmlNode *a; + gint len = 1; + xmlNode *last, *prev; + + for (a = cur_node; a; a = a->parent) + if (a->name != NULL) + len += 1 + strlen((gchar *)a->name); + + path = g_malloc(len); + memset(path, 0, len); + + last = prev = root; + + while (last != cur_node) + for (a = cur_node; a != root->parent; a = a->parent) + { + if (last == a) + { + strcat(path, "/"); + strcat(path, (gchar *)a->name); + last = prev; + } + prev = a; + } + strcat(path, "/"); + strcat(path, (gchar *)cur_node->name); + + printf("len: %d; path: %s\n", len, path); + //printf("node type: Element, name: %s, parent: %s\n", cur_node->name, cur_node->parent->name); + } + + print_element_names(root, cur_node->children); + } +} + +void +karakter_betoltes(gchar *filenev) +{ + xmlDocPtr doc; + xmlNode *root; + + doc = xmlReadFile(filenev, "UTF-8", 0); + + root = xmlDocGetRootElement(doc); + print_element_names(root, root); + + xmlFreeDoc(doc); +} + diff --git a/kargen.c b/kargen.c new file mode 100644 index 0000000..0a65d37 --- /dev/null +++ b/kargen.c @@ -0,0 +1,233 @@ +#include +#include +#include +#include "config.h" + +#define KEP_ATTACH(o, x, y) gtk_table_attach_defaults(GTK_TABLE(kepesseg_tabla), o, x, x + 1, y, y + 1) +#define ATTACH(o, x, y) gtk_table_attach_defaults(GTK_TABLE(tabla), o, x, x + 1, y, y + 1) +#define HE_ATTACH(o, x, y) gtk_table_attach_defaults(GTK_TABLE(harcertekek_tabla), o, x, x + 1, y, y + 1) +#define EE_ATTACH(o, x, y) gtk_table_attach_defaults(GTK_TABLE(eletero_tabla), o, x, x + 1, y, y + 1) +#define MA_ATTACH(o, x, y) gtk_table_attach_defaults(GTK_TABLE(magia_tabla), o, x, x + 1, y, y + 1) +#define ADJ gtk_adjustment_new(3.0, 3.0, 100.0, 1.0, 5.0, 1.0) +#define HE_ADJ gtk_adjustment_new(0.0, 0.0, 100.0, 1.0, 5.0, 1.0) +#define NEW_SPIN gtk_spin_button_new(GTK_ADJUSTMENT(ADJ), 1, 0) +#define NEW_HE_SPIN gtk_spin_button_new(GTK_ADJUSTMENT(HE_ADJ), 1, 0) +#define SIGNAL(x) gtk_signal_connect(GTK_OBJECT(x), "output", GTK_SIGNAL_FUNC(spin_valtozott), NULL) + +GtkWidget *kap_ertek, + *ero_spin, + *gyorsasag_spin, + *ugyesseg_spin, + *allokepesseg_spin, + *egeszseg_spin, + *szepseg_spin, + *intelligencia_spin, + *akaratero_spin, + *asztral_spin, + *erzekeles_spin, + *ke_spin, + *te_spin, + *ve_spin, + *ce_spin, + *epalap_spin, + *fpalap_spin, + *mpalap_spin, + *ppalap_spin; +gint aktiv_kap; + +gint convert_string(char *from_string, char **to_string); +void update_kap(); + +void +main_window_destroy(GtkWidget *window, gpointer data) +{ + gtk_main_quit(); +} + +void +set_kap_ertek() +{ + gchar *ertek; + int len; + + if (aktiv_kap < 0) + { + convert_string("rvnytelen karakter!", &buf); + gtk_entry_set_text(GTK_ENTRY(kap_ertek), buf); + return; + } + + if (aktiv_kap == 0) + { + ertek = "0"; + } + else + { + len = (int)log10((double)aktiv_kap) + 2; + ertek = g_malloc(len); + memset(ertek, 0, len); + sprintf(ertek, "%d", aktiv_kap); + } + gtk_entry_set_text(GTK_ENTRY(kap_ertek), (const gchar *)ertek); +} + +gboolean +spin_valtozott(GtkSpinButton *melyik, gpointer arg1, gpointer data) +{ + update_kap(); + + return FALSE; +} + +int +main(int argc, char **argv) +{ + GtkWidget *main_window, + *kepesseg_tabla, + *kepesseg_keret, + *tabla, + *kap_box, + *harcertekek_keret, + *harcertekek_tabla, + *eletero_keret, + *eletero_tabla, + *magia_keret, + *magia_tabla; + + aktiv_kap = KEZDO_KAP; + + gtk_init(&argc, &argv); + + main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_signal_connect(GTK_OBJECT(main_window), "destroy", GTK_SIGNAL_FUNC(main_window_destroy), NULL); + + tabla = gtk_table_new(4, 2, FALSE); + kepesseg_tabla = gtk_table_new(10, 2, FALSE); + harcertekek_tabla = gtk_table_new(4, 2, FALSE); + eletero_tabla = gtk_table_new(2, 2, FALSE); + magia_tabla = gtk_table_new(2, 2, FALSE); + + kap_box = gtk_hbox_new(FALSE, 0); + gtk_box_pack_start(GTK_BOX(kap_box), gtk_label_new("KAP:"), FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(kap_box), (kap_ertek = gtk_entry_new()), FALSE, FALSE, 0); + gtk_entry_set_editable(GTK_ENTRY(kap_ertek), FALSE); + + CONVERT("Er:"); + KEP_ATTACH(gtk_label_new(buf), 0, 1); + KEP_ATTACH((ero_spin = NEW_SPIN), 1, 1); + SIGNAL(ero_spin); + + CONVERT("Gyorsasg:"); + KEP_ATTACH(gtk_label_new(buf), 0, 2); + KEP_ATTACH((gyorsasag_spin = NEW_SPIN), 1, 2); + SIGNAL(gyorsasag_spin); + + CONVERT("gyessg:"); + KEP_ATTACH(gtk_label_new(buf), 0, 3); + KEP_ATTACH((ugyesseg_spin = NEW_SPIN), 1, 3); + SIGNAL(ugyesseg_spin); + + CONVERT("llkpessg:"); + KEP_ATTACH(gtk_label_new(buf), 0, 4); + KEP_ATTACH((allokepesseg_spin = NEW_SPIN), 1, 4); + SIGNAL(allokepesseg_spin); + + CONVERT("Egszsg:"); + KEP_ATTACH(gtk_label_new(buf), 0, 5); + KEP_ATTACH((egeszseg_spin = NEW_SPIN), 1, 5); + SIGNAL(egeszseg_spin); + + CONVERT("Szpsg:"); + KEP_ATTACH(gtk_label_new(buf), 0, 6); + KEP_ATTACH((szepseg_spin = NEW_SPIN), 1, 6); + SIGNAL(szepseg_spin); + + KEP_ATTACH(gtk_label_new("Intelligencia:"), 0, 7); + KEP_ATTACH((intelligencia_spin = NEW_SPIN), 1, 7); + SIGNAL(intelligencia_spin); + + CONVERT("Akarater:"); + KEP_ATTACH(gtk_label_new(buf), 0, 8); + KEP_ATTACH((akaratero_spin = NEW_SPIN), 1, 8); + SIGNAL(akaratero_spin); + + CONVERT("Asztrl:"); + KEP_ATTACH(gtk_label_new(buf), 0, 9); + KEP_ATTACH((asztral_spin = NEW_SPIN), 1, 9); + SIGNAL(asztral_spin); + + CONVERT("rzkels:"); + KEP_ATTACH(gtk_label_new(buf), 0, 10); + KEP_ATTACH((erzekeles_spin = NEW_SPIN), 1, 10); + SIGNAL(erzekeles_spin); + + CONVERT("K:"); + HE_ATTACH(gtk_label_new(buf), 0, 0); + HE_ATTACH((ke_spin = NEW_HE_SPIN), 1, 0); + SIGNAL(ke_spin); + + CONVERT("T:"); + HE_ATTACH(gtk_label_new(buf), 0, 1); + HE_ATTACH((te_spin = NEW_HE_SPIN), 1, 1); + SIGNAL(te_spin); + + CONVERT("V:"); + HE_ATTACH(gtk_label_new(buf), 0, 2); + HE_ATTACH((ve_spin = NEW_HE_SPIN), 1, 2); + SIGNAL(ve_spin); + + CONVERT("C:"); + HE_ATTACH(gtk_label_new(buf), 0, 3); + HE_ATTACH((ce_spin = NEW_HE_SPIN), 1, 3); + SIGNAL(ce_spin); + + CONVERT("p alap:"); + EE_ATTACH(gtk_label_new(buf), 0, 0); + EE_ATTACH((epalap_spin = NEW_HE_SPIN), 1, 0); + SIGNAL(epalap_spin); + + EE_ATTACH(gtk_label_new("Fp alap:"), 0, 1); + EE_ATTACH((fpalap_spin = NEW_HE_SPIN), 1, 1); + SIGNAL(fpalap_spin); + + MA_ATTACH(gtk_label_new("Mp alap:"), 0, 0); + MA_ATTACH((mpalap_spin = NEW_HE_SPIN), 1, 0); + SIGNAL(mpalap_spin); + + MA_ATTACH(gtk_label_new("Pszi alap:"), 0, 1); + MA_ATTACH((ppalap_spin = NEW_HE_SPIN), 1, 1); + SIGNAL(ppalap_spin); + + CONVERT("Kpessgek"); + kepesseg_keret = gtk_frame_new((const gchar *)buf); + + CONVERT("Harcrtkek"); + harcertekek_keret = gtk_frame_new((const gchar *)buf); + + CONVERT("leter"); + eletero_keret = gtk_frame_new((const gchar *)buf); + + CONVERT("Mgia, pszi"); + magia_keret = gtk_frame_new((const gchar *)buf); + + ATTACH(kap_box, 0, 0); + gtk_table_attach_defaults(GTK_TABLE(tabla), kepesseg_keret, 0, 1, 1, 4); + ATTACH(harcertekek_keret, 1, 1); + ATTACH(eletero_keret, 1, 2); + ATTACH(magia_keret, 1, 3); + + gtk_container_add(GTK_CONTAINER(harcertekek_keret), harcertekek_tabla); + gtk_container_add(GTK_CONTAINER(kepesseg_keret), kepesseg_tabla); + gtk_container_add(GTK_CONTAINER(eletero_keret), eletero_tabla); + gtk_container_add(GTK_CONTAINER(magia_keret), magia_tabla); + gtk_container_add(GTK_CONTAINER(main_window), tabla); + + gtk_widget_show_all(main_window); + + set_kap_ertek(); + + gtk_main(); + + return 0; +} + diff --git a/kargen.dat b/kargen.dat new file mode 100644 index 0000000..42debaa --- /dev/null +++ b/kargen.dat @@ -0,0 +1,38 @@ +# Ebben a fileban van a kargen sszes adata. Minden szekcinak megvan a maga +# adatszerkezete. Csak akkor vltoztasd meg, ha a hzi szablyrendszeretek ezt +# szksgess teszi! Az sszes kulcs (szekcinv s szekcin belli rtk neve) +# kezetmentes!! A #-tel kezdd s az res sorok kommentnek szmtanak, a +# program ezeket nem veszi figyelembe. A file kdolsa ISO-8859-2!! + +[global] +kezdo_kap = 375 + +[kap] +kepesseg = 3:15:1 +kepesseg = 15:18:2 +kepesseg = 19::3 +ke = ::1 +te = ::1 +ve = ::1 +ce = ::2 +hmperszint = :20:3 +epalap = ::2 +fpalap = ::2 +fpperszint = :20:3 +kpalap = ::1 +kpperszint = :20:2 +elsodleges_kepzettseg = ::1 +masodlagos_kepzettseg = ::2 +tiltott_kepzettseg = ::3 + +[kepesseg] +nev = Er +nev = Gyorsasg +nev = gyessg +nev = llkpessg +nev = Egszsg +nev = Szpsg +nev = Intelligencia +nev = Akarater +nev = Asztrl +nev = rzkels diff --git a/lapok.c b/lapok.c new file mode 100644 index 0000000..d3d24c5 --- /dev/null +++ b/lapok.c @@ -0,0 +1,455 @@ +#include + +void +azonnal_lathato_dolgok_lap(GtkTable *azonnal_tabla) +{ + GtkWidget *align; + + align = gtk_alignment_new(0, 0, 0, 0); + gtk_container_add(GTK_CONTAINER(align), gtk_label_new("Faj")); + gtk_table_attach(azonnal_tabla, align, 0, 1, 0, 1, GTK_FILL, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Származás"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Nem"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Életkor"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Egészségi állapot"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Súly"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Magasság"), 0, 1, 6, 7, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Szépség"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Szemszín"), 0, 1, 8, 9, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Hajszín"), 0, 1, 9, 10, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Hajviselet"), 0, 1, 10, 11, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Ékszerek"), 0, 1, 11, 12, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 11, 12, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Ruha stílusa"), 0, 1, 12, 13, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 12, 13, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Ruha állapota"), 0, 1, 13, 14, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 13, 14, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Parfüm stílusa"), 0, 1, 14, 15, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 14, 15, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Beszédstílus"), 0, 1, 15, 16, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 15, 16, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Akcentus"), 0, 1, 16, 17, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 16, 17, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(azonnal_tabla, gtk_label_new("Ismertetőjel"), 0, 1, 17, 18, 0, 0, 2, 2); + gtk_table_attach(azonnal_tabla, gtk_entry_new(), 1, 2, 17, 18, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +kepessegek_lap(GtkTable *kepessegek_tabla) +{ + gtk_table_attach(kepessegek_tabla, gtk_label_new("Erő"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Gyorsaság"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Ügyesség"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Állóképesség"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Egészség"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Szépség"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Intelligencia"), 0, 1, 6, 7, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Akaraterő"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Asztrál"), 0, 1, 8, 9, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(kepessegek_tabla, gtk_label_new("Érzékelés"), 0, 1, 9, 10, 0, 0, 2, 2); + gtk_table_attach(kepessegek_tabla, gtk_entry_new(), 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +jatekos_es_karakter_lap(GtkTable *jatekos_tabla) +{ + gtk_table_attach(jatekos_tabla, gtk_label_new("A játékos neve"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(jatekos_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(jatekos_tabla, gtk_label_new("Indítás dátuma"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(jatekos_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(jatekos_tabla, gtk_label_new("Karakter neve"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(jatekos_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(jatekos_tabla, gtk_label_new("Karakter faja"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(jatekos_tabla, gtk_combo_box_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +fobb_adatok_lap(GtkTable *adat_tabla) +{ + gtk_table_attach(adat_tabla, gtk_label_new("A család neve"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("A karakter álneve"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Apja neve"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Anyja neve"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Testvér(ek) neve(i)"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 4, 5, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 4, 5, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Házastárs"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Gyermekek"), 0, 1, 6, 7, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 6, 7, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 6, 7, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Szeretők"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 7, 8, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 7, 8, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_hseparator_new(), 0, 4, 8, 9, GTK_EXPAND | GTK_FILL, 0, 2, 4); + + gtk_table_attach(adat_tabla, gtk_label_new("Szülőföld"), 0, 1, 9, 10, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Származás"), 0, 1, 10, 11, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Lakóhely"), 0, 1, 11, 12, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 11, 12, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Valós kor"), 0, 1, 12, 13, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 12, 13, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Látszólagos kor"), 0, 1, 13, 14, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 13, 14, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Születésnap"), 0, 1, 14, 15, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 14, 15, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Nem"), 0, 1, 15, 16, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_new(), 1, 2, 15, 16, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Klán/család"), 0, 1, 16, 17, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 16, 17, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_hseparator_new(), 0, 4, 17, 18, GTK_EXPAND | GTK_FILL, 0, 2, 4); + + gtk_table_attach(adat_tabla, gtk_label_new("Jellem"), 0, 1, 18, 19, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_new(), 1, 2, 18, 19, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Vallás"), 0, 1, 19, 20, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 19, 20, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Isten"), 0, 1, 20, 21, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 20, 21, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Örökölt cím(ek)"), 0, 1, 21, 22, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 21, 22, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 21, 22, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 21, 22, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Szerzett cím(ek)"), 0, 1, 22, 23, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 22, 23, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 22, 23, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 22, 23, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Hűbérúr"), 0, 1, 23, 24, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 23, 24, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Hűbéresek"), 0, 1, 24, 25, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 24, 25, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 24, 25, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 24, 25, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Előjogok"), 0, 1, 25, 26, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_combo_box_entry_new(), 1, 2, 25, 26, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 25, 26, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 25, 26, 0, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Jövedelem"), 0, 1, 26, 27, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 26, 27, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(adat_tabla, gtk_label_new("Jelmondat"), 0, 1, 27, 28, 0, 0, 2, 2); + gtk_table_attach(adat_tabla, gtk_entry_new(), 1, 2, 27, 28, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +megjelenes_lap(GtkTable *megj_tabla) +{ + gtk_table_attach(megj_tabla, gtk_label_new("Szemszín"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Hajszín"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Hajviselet"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Testsúly"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Magasság"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Testalkat"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Ékszerek"), 0, 1, 6, 7, 0, 0, 2, 2); + /* TODO: Ezt úgy kéne megcsinálni, hogy a hozzáadásnál csak azt lehessen hozzáadni, ami a karakternél van mint értéktárgy */ + gtk_table_attach(megj_tabla, gtk_combo_box_new(), 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_button_new_from_stock(GTK_STOCK_ADD), 2, 3, 6, 7, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_button_new_from_stock(GTK_STOCK_REMOVE), 3, 4, 6, 7, 0, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Stílus"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Smink stílus"), 0, 1, 8, 9, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(megj_tabla, gtk_label_new("Parfüm stílus"), 0, 1, 9, 10, 0, 0, 2, 2); + gtk_table_attach(megj_tabla, gtk_entry_new(), 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +erzelmek_lap(GtkTable *erzelem_tabla) +{ + gtk_table_attach(erzelem_tabla, gtk_label_new("Szeretet"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Gyűlölet"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Bátorság"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Félelem"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Vágy"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Undor"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Nyugalom"), 0, 1, 6, 7, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Ingerültség"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Hűség"), 0, 1, 8, 9, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 8, 9, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Hűtlenség"), 0, 1, 9, 10, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 9, 10, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Tisztelet"), 0, 1, 10, 11, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 10, 11, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Tiszteletlenség"), 0, 1, 11, 12, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 11, 12, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Szerelem"), 0, 1, 12, 13, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 12, 13, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Elvakultság"), 0, 1, 13, 14, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 13, 14, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(erzelem_tabla, gtk_label_new("Semlegesség"), 0, 1, 14, 15, 0, 0, 2, 2); + gtk_table_attach(erzelem_tabla, gtk_entry_new(), 1, 2, 14, 15, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +tapasztalat_lap(GtkTable *tp_tabla) +{ + GtkWidget *frame; + GtkTable *tabla; + + gtk_table_attach(tp_tabla, gtk_label_new("Eddig szerzett tapasztalati pontok"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(tp_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tp_tabla, gtk_label_new("Elkölthető tapasztalati pontok"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(tp_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + frame = gtk_frame_new("TP-átváltás"); + gtk_table_attach(tp_tabla, frame, 0, 2, 2, 3, 0, 0, 2, 2); + tabla = GTK_TABLE(gtk_table_new(8, 2, FALSE)); + gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(tabla)); + + gtk_table_attach(tabla, gtk_label_new("KÉ"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("TÉ"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("VÉ"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("CÉ"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Kp"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Ψp"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Mp"), 0, 1, 6, 7, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Fp"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +harcertekek_lap(GtkTable *hm_tabla) +{ + gtk_table_attach(hm_tabla, gtk_label_new("Alap"), 1, 2, 0, 1, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_label_new("Módosítók"), 2, 3, 0, 1, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_label_new("Vásárolt HM"), 3, 4, 0, 1, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_label_new("Összesen"), 4, 5, 0, 1, 0, 0, 2, 2); + + gtk_table_attach(hm_tabla, gtk_label_new("KÉ"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 3, 4, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 4, 5, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(hm_tabla, gtk_label_new("TÉ"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 2, 3, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 3, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 4, 5, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(hm_tabla, gtk_label_new("VÉ"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 3, 4, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 4, 5, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(hm_tabla, gtk_label_new("CÉ"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 2, 3, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 3, 4, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(hm_tabla, gtk_entry_new(), 4, 5, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +eletero_lap(GtkTable *eletero_tabla) +{ + gtk_table_attach(eletero_tabla, gtk_label_new("Alap"), 1, 2, 0, 1, 0, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_label_new("Módosítók"), 2, 3, 0, 1, 0, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_label_new("Vásárolt"), 3, 4, 0, 1, 0, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_label_new("Összesen"), 4, 5, 0, 1, 0, 0, 2, 2); + + gtk_table_attach(eletero_tabla, gtk_label_new("Ép"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 2, 3, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 4, 5, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(eletero_tabla, gtk_label_new("Fp"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 2, 3, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 3, 4, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + gtk_table_attach(eletero_tabla, gtk_entry_new(), 4, 5, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); +} + +void +pszi_lap(GtkTable *pszi_tabla) +{ + GtkWidget *frame; + GtkTable *tabla; + + gtk_table_attach(pszi_tabla, gtk_label_new("Iskola típusa"), 0, 1, 0, 1, 0, 0, 2, 2); + gtk_table_attach(pszi_tabla, gtk_entry_new(), 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(pszi_tabla, gtk_label_new("Képzettség foka"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(pszi_tabla, gtk_entry_new(), 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(pszi_tabla, gtk_label_new("Alap Ψ-pontok"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(pszi_tabla, gtk_entry_new(), 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(pszi_tabla, gtk_label_new("Vásárolt Ψ-pontok"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(pszi_tabla, gtk_entry_new(), 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + gtk_table_attach(pszi_tabla, gtk_label_new("Ψ-pontok összesen"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(pszi_tabla, gtk_entry_new(), 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 2); + + frame = gtk_frame_new("Mágiaellenállás"); + tabla = GTK_TABLE(gtk_table_new(1, 3, FALSE)); + gtk_container_add(GTK_CONTAINER(frame), GTK_WIDGET(tabla)); + gtk_table_attach(pszi_tabla, frame, 0, 2, 5, 6, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Asztrál"), 1, 2, 0, 1, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_label_new("Mentál"), 2, 3, 0, 1, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Tudatalatti"), 0, 1, 1, 2, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 1, 2, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 1, 2, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Tudatalattit befolyásoló módosítók"), 0, 1, 2, 3, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 2, 3, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 2, 3, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Statikus pajzs"), 0, 1, 3, 4, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 3, 4, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 3, 4, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Dinamikus pajzs"), 0, 1, 4, 5, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 4, 5, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 4, 5, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Egyéb"), 0, 1, 5, 6, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 5, 6, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 5, 6, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_hseparator_new(), 0, 3, 6, 7, GTK_EXPAND | GTK_FILL, 0, 4, 4); + + gtk_table_attach(tabla, gtk_label_new("ME összesen"), 0, 1, 7, 8, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 7, 8, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 7, 8, 0, 0, 2, 2); + + gtk_table_attach(tabla, gtk_label_new("Dinamikus nélkül"), 0, 1, 8, 9, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 1, 2, 8, 9, 0, 0, 2, 2); + gtk_table_attach(tabla, gtk_entry_new(), 2, 3, 8, 9, 0, 0, 2, 2); +} + diff --git a/magus_kargen_res.ui b/magus_kargen_res.ui new file mode 100644 index 0000000..567a95e --- /dev/null +++ b/magus_kargen_res.ui @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/main.c b/main.c new file mode 100644 index 0000000..f0fba0b --- /dev/null +++ b/main.c @@ -0,0 +1,298 @@ +/* + * vim:encoding=utf-8: + * Menü: + * + * * Karakter + * *** Új -- Ekkor kerül elő a karaktergeneráló panel, és el lehet osztani a 375 KAP-ot + * *** Betöltés -- Ez betölti a karakter adatait + * *** Mentés -- Ez kimenti egy előre meghatározott formátumú file-ba a karakter adatait + * *** Kilépés -- Ez meg kilép a probramból ;) + */ +#include +#include +#include + +#include "functions.h" +#include "defines.h" + +GtkWidget *main_window, + *book; +GtkActionGroup *action_group; + +static GtkRadioActionEntry +menu_items[] = { + { "egybol-lathato", NULL, EGYBOL_LATHATO_HALLHATO_DOLGOK, NULL, NULL, 1 }, + { "jatekos-es-karakter", NULL, A_JATEKOS_ES_A_KARAKTER_ADATAI, NULL, NULL, 2 }, + { "kepessegek", NULL, KEPESSEGEK, NULL, NULL, 3 }, + { "fobb-adatok", NULL, A_KARAKTER_FOBB_ADATAI, NULL, NULL, 4 }, + { "megjelenes", NULL, MEGJELENES, NULL, NULL, 5 }, + { "allando-erzelmek", NULL, ALLANDO_ERZELMEK, NULL, NULL, 6 }, + { "szimpatia", NULL, SZIMPATIKUS_VISZONYOK, NULL, NULL, 7 }, + { "ismertseg", NULL, ISMERTSEG, NULL, NULL, 8 }, + { "kulonleges-kepessegek", NULL, KULONLEGES_KEPESSEGEK, NULL, NULL, 9 }, + { "tapasztalati-pontok", NULL, TAPASZTALATI_PONTOK, NULL, NULL, 10 }, + { "kepzettsegek", NULL, KEPZETTSEGEK, NULL, NULL, 11 }, + { "nyelvek", NULL, NYELVEK, NULL, NULL, 12 }, + { "harcertekek", NULL, HARCERTEKEK, NULL, NULL, 13 }, + { "eletero", NULL, ELETERO, NULL, NULL, 14 }, + { "pszi", NULL, PSZI, NULL, NULL, 15 }, + { "magia", NULL, MAGIA, NULL, NULL, 16 }, + { "fegyverek", NULL, FEGYVEREK_PAJZS, NULL, NULL, 17 }, + { "allatok", NULL, ALLATOK_CSATLOSOK, NULL, NULL, 18 }, + { "mesterek", NULL, MESTEREK, NULL, NULL, 19 }, + { "birtokok", NULL, BIRTOKOK_BEFEKTETESEK, NULL, NULL, 20 }, + { "alakulatok", NULL, ALAKULATOK, NULL, NULL, 21 }, + { "iskolak", NULL, ISKOLAK, NULL, NULL, 22 }, + { "muvek", NULL, MUVEK, NULL, NULL, 23 }, + { "ertekek", NULL, ERTEKEK, NULL, NULL, 24 }, + { "ruhak", NULL, RUHAK, NULL, NULL, 25 }, + { "varazstargyak", NULL, VARAZSTARGYAK, NULL, NULL, 26 }, + { "felszereles", NULL, FELSZERELES, NULL, NULL, 27 }, + { "varazslatok", NULL, VARAZSLATOK, NULL, NULL, 28 }, + { "tanulas", NULL, TANULAS, NULL, NULL, 29 }, + { "sebesulesek", NULL, SEBESULESEK, NULL, NULL, 30 }, + { "betegsegek", NULL, BETEGSEGEK, NULL, NULL, 31 }, + { "varazslat-kutatas", NULL, VARAZSLAT_KUTATAS, NULL, NULL, 32 }, + { "kulonleges-dolgok", NULL, KULONLEGES_DOLGOK, NULL, NULL, 33 }, + { "megjegyzesek", NULL, MEGJEGYZESEK, NULL, NULL, 34 }, + { "tortenet", NULL, TORTENET, NULL, NULL, 35 }, + { "kepek", NULL, KEPEK, NULL, NULL, 36 }, +}; + +static gint +nezet_menu_szama = sizeof(menu_items) / sizeof(menu_items[0]); + +void +main_window_destroy(GtkWidget *window, gpointer data) +{ + gtk_main_quit(); +} + +void +kilepes_func(GtkAction *action, gpointer data) +{ + /* TODO: Ide kell majd egy ellenőrzés, hogy az aktív karakter el van-e mentve */ + g_signal_emit_by_name(G_OBJECT(main_window), "destroy", NULL); +} + +void +nezet_menu(GtkAction *action, gint melyik, gpointer data) +{ + gtk_notebook_set_current_page(GTK_NOTEBOOK(book), gtk_radio_action_get_current_value(GTK_RADIO_ACTION(action)) - 1); +} + +void +lapvaltas(GtkNotebook *book, gint arg1, gpointer data) +{ + /* TODO: Ide kéne egy működő kód, ami megváltoztatja a kijelölt menüpontot... */ + gtk_action_activate(gtk_action_group_get_action(action_group, menu_items[gtk_notebook_get_current_page(book)].name)); +} + +int +main(int argc, char **argv) +{ + GtkWidget *menubar, + *pri_vbox, + *tabla, + *scroll; + GtkAccelGroup *accel_group; + GtkUIManager *ui_manager; + GtkAction *action; + + LIBXML_TEST_VERSION + + karakter_betoltes("ruin.xml"); + //return 0; + + gtk_init(&argc, &argv); + + action_group = gtk_action_group_new("main_menu"); + + action = gtk_action_new("uj-karakter", "Új karakter", "Új karakter létrehozása", GTK_STOCK_NEW); + gtk_action_group_add_action_with_accel(action_group, action, "N"); + + action = gtk_action_new("karakter-megnyitas", "Karakter megnyitása", "Elmentett karakter megnyitása", GTK_STOCK_OPEN); + gtk_action_group_add_action_with_accel(action_group, action, "O"); + + action = gtk_action_new("karakter-mentes", "Karakter mentése", "Karakter adatainak mentése", GTK_STOCK_SAVE); + gtk_action_group_add_action_with_accel(action_group, action, "S"); + + action = gtk_action_new("kilepes", "Kilépés", "Kilépés a programból", GTK_STOCK_QUIT); + gtk_action_group_add_action_with_accel(action_group, action, "Q"); + g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(kilepes_func), NULL); + + action = gtk_action_new("karakter-menu", "Karakter", "Karakter", NULL); + gtk_action_group_add_action(action_group, action); + + gtk_action_group_add_radio_actions(action_group, menu_items, nezet_menu_szama, 0, G_CALLBACK(nezet_menu), NULL); + action = gtk_action_new("nezet-menu", "Nézet", "Nézet", NULL); + gtk_action_group_add_action(action_group, action); + + ui_manager = gtk_ui_manager_new(); + gtk_ui_manager_set_add_tearoffs(ui_manager, FALSE); + gtk_ui_manager_insert_action_group(ui_manager, action_group, 0); + gtk_ui_manager_add_ui_from_file(ui_manager, "magus_kargen_res.ui", NULL); + + accel_group = gtk_accel_group_new(); + + main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + g_signal_connect(G_OBJECT(main_window), "destroy", G_SIGNAL_FUNC(main_window_destroy), NULL); + gtk_window_add_accel_group(GTK_WINDOW(main_window), accel_group); + gtk_window_set_title(GTK_WINDOW(main_window), "M.A.G.U.S. - Reneszánsz karakternyilvántartó"); + + menubar = gtk_ui_manager_get_widget(ui_manager, "/menu"); + + book = gtk_notebook_new(); + gtk_notebook_set_scrollable(GTK_NOTEBOOK(book), TRUE); + gtk_notebook_popup_enable(GTK_NOTEBOOK(book)); + g_signal_connect(GTK_OBJECT(book), "change-current-page", G_SIGNAL_FUNC(lapvaltas), NULL); + + /* Azonnal látható és hallható dolgok */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(18, 2, FALSE); + azonnal_lathato_dolgok_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(EGYBOL_LATHATO_HALLHATO_DOLGOK)); + + /* A játékos és a karakter adatai */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(4, 2, FALSE); + jatekos_es_karakter_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(A_JATEKOS_ES_A_KARAKTER_ADATAI)); + + /* Képességek */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(10, 2, FALSE); + kepessegek_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(KEPESSEGEK)); + + /* Főbb adatok */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(26, 4, FALSE); + fobb_adatok_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(A_KARAKTER_FOBB_ADATAI)); + + /* Megjelenés */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(10, 4, FALSE); + megjelenes_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(MEGJELENES)); + + /* Állandó érzelmek */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(15, 2, FALSE); + erzelmek_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(ALLANDO_ERZELMEK)); + + /* Szimpatikus viszonyok. Ide majd egy TableView kene */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(SZIMPATIKUS_VISZONYOK)); + + /* Kapcsolatok, ismertseg. Ide majd egy TableView kene */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(ISMERTSEG)); + + /* Kulonleges kepessegek, hatranyok. Ide is TableView kene */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(KULONLEGES_KEPESSEGEK)); + + /* Tapasztalati pontok, átváltás */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(3, 2, FALSE); + tapasztalat_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(TAPASZTALATI_PONTOK)); + + /* Képzettségek. Ide majd egy TableView kell */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(KEPZETTSEGEK)); + + /* Nyelvek. Ide is TableView */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(NYELVEK)); + + /* Harcértékek */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(5, 4, FALSE); + harcertekek_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(HARCERTEKEK)); + + /* Életerő */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(3, 4, FALSE); + eletero_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(ELETERO)); + + /* Pszi */ + scroll = gtk_scrolled_window_new(NULL, NULL); + tabla = gtk_table_new(5, 2, FALSE); + pszi_lap(GTK_TABLE(tabla)); + gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scroll), tabla); + gtk_notebook_append_page(GTK_NOTEBOOK(book), scroll, gtk_label_new(PSZI)); + + /* Mágia */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(MAGIA)); + + /* Fegyverek és pajzsok. Ide két TableView kell. */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(FEGYVEREK_PAJZS)); + + /* Állatok, csatlósok, szolgák. Ide sok TableView kell */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(ALLATOK_CSATLOSOK)); + + /* Mesterek és tanítók. Ide két TableView kell */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(MESTEREK)); + + /* Földbirtokok. Ide is TableView kell */ + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(BIRTOKOK_BEFEKTETESEK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(ALAKULATOK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(ISKOLAK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(MUVEK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(ERTEKEK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(RUHAK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(VARAZSTARGYAK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(FELSZERELES)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(VARAZSLATOK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(TANULAS)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(SEBESULESEK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(BETEGSEGEK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(VARAZSLAT_KUTATAS)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(KULONLEGES_DOLGOK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(MEGJEGYZESEK)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(TORTENET)); + + gtk_notebook_append_page(GTK_NOTEBOOK(book), gtk_table_new(1, 1, FALSE), gtk_label_new(KEPEK)); + + pri_vbox = gtk_vbox_new(FALSE, 0); + + gtk_box_pack_start(GTK_BOX(pri_vbox), menubar, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(pri_vbox), book, TRUE, TRUE, 0); + + gtk_container_add(GTK_CONTAINER(main_window), pri_vbox); + + gtk_widget_show_all(main_window); + gtk_window_maximize(GTK_WINDOW(main_window)); + + gtk_main(); + + xmlCleanupParser(); + + return 0; +} + diff --git a/ruin.xml b/ruin.xml new file mode 100644 index 0000000..07ecee9 --- /dev/null +++ b/ruin.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/variables.h b/variables.h new file mode 100644 index 0000000..1bbc884 --- /dev/null +++ b/variables.h @@ -0,0 +1,9 @@ +#ifndef _MAGUS_KARGEN_VARIABLES_H +# define _MAGUS_KARGEN_VARIABLES_H + +# include + +extern GtkWidget *main_window; + +#endif /* _MAGUS_KARGEN_VARIABLES_H */ +