Simplified class menu translations. Small improvement in logic when selected classes.

This commit is contained in:
ricard 2009-08-15 01:28:28 +02:00
parent d1cbda40c4
commit 35c3f80ed1
3 changed files with 45 additions and 79 deletions

View File

@ -216,49 +216,29 @@
"no" "Klassevalg:" "no" "Klassevalg:"
} }
"Classes menu zombie" "Classes menu active"
{ {
"no" "Velg zombieklasse:" "no" "Aktiv: {1}"
} }
"Classes menu zombie current" "Classes menu next"
{ {
"no" "Velg zombieklasse\n {1}" "no" "Påfølgende: {1}"
} }
"Classes menu zombie next" "Classes menu select zombie"
{ {
"no" "Velg zombieklasse\n Aktiv: {1}\n Påfølgende: {2}" "no" "Velg zombieklasse"
} }
"Classes menu human" "Classes menu select human"
{ {
"no" "Velg menneskeklasse:" "no" "Velg menneskeklasse"
} }
"Classes menu human current" "Classes menu select admin"
{ {
"no" "Velg menneskeklasse\n {1}" "no" "Velg administratormodusklasse"
}
"Classes menu human next"
{
"no" "Velg menneskeklasse\n Aktiv: {1}\n Påfølgende: {2}"
}
"Classes menu admin"
{
"no" "Velg administratormodusklasse:"
}
"Classes menu admin current"
{
"no" "Velg administratormodusklasse\n {1}"
}
"Classes menu admin next"
{
"no" "Velg administratormodusklasse\n Active: {1}\n Next spawn: {2}"
} }
"Classes menu admin mode toggle" "Classes menu admin mode toggle"

View File

@ -228,55 +228,31 @@
"en" "Class Selection:" "en" "Class Selection:"
} }
"Classes menu zombie" "Classes menu active"
{
"en" "Select Zombie Class:"
}
"Classes menu zombie current"
{ {
"#format" "{1:s}" "#format" "{1:s}"
"en" "Select Zombie Class\n {1}" "en" "Active: {1}"
} }
"Classes menu zombie next" "Classes menu next"
{
"#format" "{1:s},{2:s}"
"en" "Select Zombie Class\n Active: {1}\n Next spawn: {2}"
}
"Classes menu human"
{
"en" "Select Human Class:"
}
"Classes menu human current"
{ {
"#format" "{1:s}" "#format" "{1:s}"
"en" "Select Human Class\n {1}" "en" "Next spawn: {1}"
} }
"Classes menu human next" "Classes menu select zombie"
{ {
"#format" "{1:s},{2:s}" "en" "Select Zombie Class"
"en" "Select Human Class\n Active: {1}\n Next spawn: {2}"
} }
"Classes menu admin" "Classes menu select human"
{ {
"en" "Select Admin Mode Class:" "en" "Select Human Class"
} }
"Classes menu admin current" "Classes menu select admin"
{ {
"#format" "{1:s}" "en" "Select Admin Mode Class"
"en" "Select Admin Mode Class\n {1}"
}
"Classes menu admin next"
{
"#format" "{1:s},{2:s}"
"en" "Select Admin Mode Class\n Active: {1}\n Next spawn: {2}"
} }
"Classes menu admin mode toggle" "Classes menu admin mode toggle"

View File

@ -67,7 +67,7 @@ ClassMenuMain(client)
new humancount = ClassCountTeam(ZR_CLASS_TEAM_ZOMBIES); new humancount = ClassCountTeam(ZR_CLASS_TEAM_ZOMBIES);
new admincount = ClassCountTeam(ZR_CLASS_TEAM_ADMINS); new admincount = ClassCountTeam(ZR_CLASS_TEAM_ADMINS);
// Get previously selected class indexes, if set. // Get next class indexes, if set.
new nextzombie = ClassSelectedNext[client][ZR_CLASS_TEAM_ZOMBIES]; new nextzombie = ClassSelectedNext[client][ZR_CLASS_TEAM_ZOMBIES];
new nexthuman = ClassSelectedNext[client][ZR_CLASS_TEAM_HUMANS]; new nexthuman = ClassSelectedNext[client][ZR_CLASS_TEAM_HUMANS];
new nextadmin = ClassSelectedNext[client][ZR_CLASS_TEAM_ADMINS]; new nextadmin = ClassSelectedNext[client][ZR_CLASS_TEAM_ADMINS];
@ -93,18 +93,18 @@ ClassMenuMain(client)
// Get current class name. // Get current class name.
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ZOMBIES], zombieclass, sizeof(zombieclass), ZR_CLASS_CACHE_MODIFIED); ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ZOMBIES], zombieclass, sizeof(zombieclass), ZR_CLASS_CACHE_MODIFIED);
// Check if previous index is set. // Check if next index is set.
if (ClassValidateIndex(nextzombie)) if (ClassValidateIndex(nextzombie))
{ {
// Get name of previous class index and format item text. // Get name of previous class index and format item text.
ClassGetName(nextzombie, nextzombiename, sizeof(nextzombiename), ZR_CLASS_CACHE_MODIFIED); ClassGetName(nextzombie, nextzombiename, sizeof(nextzombiename), ZR_CLASS_CACHE_MODIFIED);
Format(zombieselect, sizeof(zombieselect), "%t", "Classes menu zombie next", zombieclass, nextzombiename); Format(zombieselect, sizeof(zombieselect), "%t\n %t\n %t", "Classes menu select zombie", "Classes menu active", zombieclass, "Classes menu next", nextzombiename);
} }
else else
{ {
// Use current class name and format item text. // Use current class name and format item text.
Format(zombieselect, sizeof(zombieselect), "%t", "Classes menu zombie current", zombieclass); Format(zombieselect, sizeof(zombieselect), "%t\n %s", "Classes menu select zombie", zombieclass);
} }
// Add item to list. // Add item to list.
@ -117,18 +117,18 @@ ClassMenuMain(client)
// Get current class name. // Get current class name.
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_HUMANS], humanclass, sizeof(humanclass), ZR_CLASS_CACHE_MODIFIED); ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_HUMANS], humanclass, sizeof(humanclass), ZR_CLASS_CACHE_MODIFIED);
// Check if previous index is set. // Check if next index is set.
if (ClassValidateIndex(nexthuman)) if (ClassValidateIndex(nexthuman))
{ {
// Get name of previous class index and format item text. // Get name of previous class index and format item text.
ClassGetName(nexthuman, nexthumanname, sizeof(nexthumanname), ZR_CLASS_CACHE_MODIFIED); ClassGetName(nexthuman, nexthumanname, sizeof(nexthumanname), ZR_CLASS_CACHE_MODIFIED);
Format(humanselect, sizeof(humanselect), "%t", "Classes menu human next", humanclass, nexthumanname); Format(humanselect, sizeof(humanselect), "%t\n %t\n %t", "Classes menu select human", "Classes menu active", humanclass, "Classes menu next", nexthumanname);
} }
else else
{ {
// Use current class name and format item text. // Use current class name and format item text.
Format(humanselect, sizeof(humanselect), "%t", "Classes menu human current", humanclass); Format(humanselect, sizeof(humanselect), "%t\n %s", "Classes menu select human", humanclass);
} }
// Add item to list. // Add item to list.
@ -144,17 +144,17 @@ ClassMenuMain(client)
// Get current class name. // Get current class name.
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ADMINS], adminclass, sizeof(adminclass), ZR_CLASS_CACHE_MODIFIED); ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ADMINS], adminclass, sizeof(adminclass), ZR_CLASS_CACHE_MODIFIED);
// Check if previous index is set. // Check if next index is set.
if (ClassValidateIndex(nextadmin)) if (ClassValidateIndex(nextadmin))
{ {
// Get name of previous class index and format item text. // Get name of previous class index and format item text.
ClassGetName(nextadmin, nextadminname, sizeof(nextadminname), ZR_CLASS_CACHE_MODIFIED); ClassGetName(nextadmin, nextadminname, sizeof(nextadminname), ZR_CLASS_CACHE_MODIFIED);
Format(adminselect, sizeof(adminselect), "%t", "Classes menu admin next", adminclass, nextadminname); Format(adminselect, sizeof(adminselect), "%t\n %t\n %t", "Classes menu select admin", "Classes menu active", adminclass, "Classes menu next", nextadminname);
} }
else else
{ {
// Use current class name and format item text. // Use current class name and format item text.
Format(adminselect, sizeof(adminselect), "%t", "Classes menu admin current", adminclass); Format(adminselect, sizeof(adminselect), "%t\n %s", "Classes menu select admin", adminclass);
} }
// Add item to list. // Add item to list.
@ -260,15 +260,15 @@ ClassMenuSelect(client, teamid)
{ {
case ZR_CLASS_TEAM_ZOMBIES: case ZR_CLASS_TEAM_ZOMBIES:
{ {
Format(title, sizeof(title), "%t\n", "Classes menu zombie"); Format(title, sizeof(title), "%t:\n", "Classes menu select zombie");
} }
case ZR_CLASS_TEAM_HUMANS: case ZR_CLASS_TEAM_HUMANS:
{ {
Format(title, sizeof(title), "%t\n", "Classes menu human"); Format(title, sizeof(title), "%t:\n", "Classes menu select human");
} }
case ZR_CLASS_TEAM_ADMINS: case ZR_CLASS_TEAM_ADMINS:
{ {
Format(title, sizeof(title), "%t\n", "Classes menu admin"); Format(title, sizeof(title), "%t:\n", "Classes menu select admin");
} }
} }
SetMenuTitle(menu, title); SetMenuTitle(menu, title);
@ -364,8 +364,18 @@ public ClassMenuSelectHandle(Handle:menu, MenuAction:action, client, slot)
(!iszombie && teamid == ZR_CLASS_TEAM_HUMANS) || (!iszombie && teamid == ZR_CLASS_TEAM_HUMANS) ||
(ClassPlayerInAdminMode[client] && teamid == ZR_CLASS_TEAM_ADMINS)) (ClassPlayerInAdminMode[client] && teamid == ZR_CLASS_TEAM_ADMINS))
{ {
// Set class to be used on next spawn. // Check if player selected the same class that he already is.
ClassSelectedNext[client][teamid] = classindex; if (ClassSelected[client][teamid] == classindex)
{
// Player is already the specified class. Disable
// next class for the specified team.
ClassSelectedNext[client][teamid] = -1;
}
else
{
// Set class to be used on next spawn.
ClassSelectedNext[client][teamid] = classindex;
}
} }
else else
{ {