summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2012-06-09 16:54:02 +0200
committerBardur Arantsson <bardur@scientician.net>2012-06-09 16:55:01 +0200
commit5ccc3347038709ba87f5b04d19d800aca459158e (patch)
tree788fefe694c2afe76ece0879d926e782798310df /src
parent0bd0bab14018806a9fafe8db624323ce4699fe9b (diff)
Lua: Move "class" help to C
Diffstat (limited to 'src')
-rw-r--r--src/birth.c10
-rw-r--r--src/externs.h1
-rw-r--r--src/help.c62
3 files changed, 71 insertions, 2 deletions
diff --git a/src/birth.c b/src/birth.c
index 595a8dfa..58debca0 100644
--- a/src/birth.c
+++ b/src/birth.c
@@ -2196,7 +2196,10 @@ static bool_ player_birth_aux_ask()
}
k = (islower(c) ? A2I(c) : (D2I(c) + 26));
if ((k >= 0) && (k < n)) break;
- if (c == '?') exec_lua(format("ingame_help('select_context', 'class', '%s')", class_info[class_types[sel]].title + c_name));
+ if (c == '?')
+ {
+ help_class(class_info[class_types[sel]].title + c_name);
+ }
else if (c == '=')
{
screen_save();
@@ -2275,7 +2278,10 @@ static bool_ player_birth_aux_ask()
}
k = (islower(c) ? A2I(c) : (D2I(c) + 26));
if ((k >= 0) && (k < n)) break;
- if (c == '?') exec_lua(format("ingame_help('select_context', 'class', '%s')", class_info[p_ptr->pclass].spec[sel].title + c_name));
+ if (c == '?')
+ {
+ help_class(class_info[p_ptr->pclass].spec[sel].title + c_name);
+ }
else if (c == '=')
{
screen_save();
diff --git a/src/externs.h b/src/externs.h
index 6be9776b..3ea6d2d6 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -620,6 +620,7 @@ extern void initialize_bookable_spells();
extern void init_hooks_help();
extern void help_race(cptr race);
extern void help_subrace(cptr subrace);
+extern void help_class(cptr klass);
/* birth.c */
extern void print_desc_aux(cptr txt, int y, int x);
diff --git a/src/help.c b/src/help.c
index b924017d..4d894044 100644
--- a/src/help.c
+++ b/src/help.c
@@ -142,6 +142,63 @@ context_help_type subrace_table[] =
};
/**
+ * Class help files
+ */
+context_help_type class_table[] =
+{
+ /* ToME */
+ { "Alchemist", "c_alchem.txt", 0 },
+ { "Archer", "c_archer.txt", 0 },
+ { "Assassin", "c_assass.txt", 0 },
+ { "Axemaster", "c_axemas.txt", 0 },
+ { "Bard", "c_bard.txt", 0 },
+ { "Dark-Priest", "c_pr_drk.txt", 0 },
+ { "Demonologist", "c_demono.txt", 0 },
+ { "Druid", "c_druid.txt", 0 },
+ { "Geomancer", "c_geoman.txt", 0 },
+ { "Haftedmaster", "c_hafted.txt", 0 },
+ { "Loremaster", "c_lorema.txt", 0 },
+ { "Mage", "c_mage.txt", 0 },
+ { "Mimic", "c_mimic.txt", 0 },
+ { "Mindcrafter", "c_mindcr.txt", 0 },
+ { "Monk", "c_monk.txt", 0 },
+ { "Necromancer", "c_necro.txt", 0 },
+ { "Paladin", "c_palad.txt", 0 },
+ { "Polearmmaster", "c_polear.txt", 0 },
+ { "Possessor", "c_posses.txt", 0 },
+ { "Priest", "c_priest.txt", 0 },
+ { "Priest(Eru)", "c_pr_eru.txt", 0 },
+ { "Priest(Manwe)", "c_pr_man.txt", 0 },
+ { "Ranger", "c_ranger.txt", 0 },
+ { "Rogue", "c_rogue.txt", 0 },
+ { "Runecrafter", "c_runecr.txt", 0 },
+ { "Sorceror", "c_sorcer.txt", 0 },
+ { "Summoner", "c_summon.txt", 0 },
+ { "Swordmaster", "c_swordm.txt", 0 },
+ { "Symbiant", "c_symbia.txt", 0 },
+ { "Thaumaturgist", "c_thaum.txt", 0 },
+ { "Unbeliever", "c_unbel.txt", 0 },
+ { "Warper", "c_warper.txt", 0 },
+ { "Warrior", "c_warrio.txt", 0 },
+ /* Theme */
+ { "Ascetic", "c_ascet.txt", 0 },
+ { "Clairvoyant", "c_clairv.txt", 0 },
+ { "Mercenary", "c_mercen.txt", 0 },
+ { "Pacifist", "c_pacif.txt", 0 },
+ { "Peace-mage", "c_peacemag.txt", 0 },
+ { "Priest(Mandos)", "c_pr_mand.txt", 0 },
+ { "Priest(Ulmo)", "c_pr_ulmo.txt", 0 },
+ { "Priest(Varda)", "c_pr_varda.txt", 0 },
+ { "Sniper", "c_sniper.txt", 0 },
+ { "Stonewright", "c_stonewr.txt", 0 },
+ { "Trapper", "c_trapper.txt", 0 },
+ { "Wainrider", "c_wainrid.txt", 0 },
+ { "War-mage", "c_warmage.txt", 0 },
+ /* End of list */
+ { NULL, NULL, 0 },
+};
+
+/**
* Trigger functions
*/
static bool_ trigger_void_jumpgate(void *in, void *out) {
@@ -546,3 +603,8 @@ void help_subrace(cptr subrace)
{
show_context_help(find_context_help(subrace_table, subrace));
}
+
+void help_class(cptr klass)
+{
+ show_context_help(find_context_help(class_table, klass));
+}