mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-24 16:31:39 +00:00
Support custom hint & button captions in the tutorial
This patch allows steps to override the default hint caption and button caption set by the PanelControlSection class. This allows them to better communicate what the player is supposed to do, e.g. don't show "Follow the instructions" if the player is only supposed to wait.
This commit is contained in:
@@ -44,11 +44,12 @@ class TutorialPanel
|
||||
return;
|
||||
}
|
||||
|
||||
this.button.caption = step.continueButton || this.ButtonCaptions.Continue;
|
||||
this.hint.caption = step.isDone ?
|
||||
this.HintCaptions.Done :
|
||||
step.showContinueButton ?
|
||||
step.hint || (step.showContinueButton ?
|
||||
this.HintCaptions.Continue :
|
||||
this.HintCaptions.Instruction;
|
||||
this.HintCaptions.Instruction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("Welcome to the 0\xa0A.D. tutorial.")
|
||||
"text": markForTranslation("Welcome to the 0\xa0A.D. tutorial."),
|
||||
"hint": markForTranslation("Click to start the tutorial."),
|
||||
"continueButton": markForTranslation("Start")
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -115,7 +117,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("Let's wait for the Farmstead to be built.")
|
||||
"text": markForTranslation("Let's wait for them to finish building the Farmstead, so they can use it as a dropsite."),
|
||||
"hint": markForTranslation("Wait for the Farmstead to be built.")
|
||||
},
|
||||
"OnTrainingFinished": function(msg)
|
||||
{
|
||||
@@ -130,7 +133,7 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("Once the Farmstead is constructed, its builders will automatically begin gathering food if there is any nearby. Select the builders and instead make them construct a Field beside the Farmstead.")
|
||||
"text": markForTranslation("Now its builders will automatically begin gathering food if there is any nearby. Select the builders and instead make them construct a Field beside the Farmstead.")
|
||||
},
|
||||
"Init": function()
|
||||
{
|
||||
@@ -238,7 +241,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("While waiting for the phasing up, you may reassign your idle workers to gathering the resources you are short of.")
|
||||
"text": markForTranslation("While waiting for the phasing up, you may reassign your idle workers to gathering the resources you are short of."),
|
||||
"hint": markForTranslation("Wait until you reach the Town Phase.")
|
||||
},
|
||||
"IsDone": function()
|
||||
{
|
||||
@@ -393,7 +397,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("While waiting for the phase change, you may train more soldiers at the Barracks.")
|
||||
"text": markForTranslation("While waiting for the phase change, you may train more soldiers at the Barracks."),
|
||||
"hint": markForTranslation("Wait until you reach the City Phase")
|
||||
},
|
||||
"IsDone": function()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,9 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("This tutorial will teach the basics of developing your economy. Typically, you will start with a Civic Center and a couple units in Village Phase and ultimately, your goal will be to develop and expand your empire, often by evolving to Town Phase and City Phase afterward.")
|
||||
"text": markForTranslation("This tutorial will teach the basics of developing your economy. Typically, you will start with a Civic Center and a couple units in Village Phase and ultimately, your goal will be to develop and expand your empire, often by evolving to Town Phase and City Phase afterward."),
|
||||
"hint": markForTranslation("Click to start."),
|
||||
"continueButton": markForTranslation("Start")
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -22,7 +24,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("To start off, select your building, the Civic Center, by clicking on it. A selection ring in the color of your player will be displayed after clicking.")
|
||||
"text": markForTranslation("To start off, select your building, the Civic Center, by clicking on it. A selection ring in the color of your player will be displayed after clicking."),
|
||||
"hint": markForTranslation("Click to continue when you have selected the Civic Center.")
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -180,7 +183,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("Let's wait for the units to be trained.")
|
||||
"text": markForTranslation("Let's wait until the batch of Hoplites has finished training."),
|
||||
"hint": markForTranslation("Wait for the training to finish.")
|
||||
},
|
||||
"IsDone": function()
|
||||
{
|
||||
@@ -216,7 +220,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INFO,
|
||||
"panelData": {
|
||||
"text": markForTranslation("The selected Citizens will automatically start constructing the building once you place the foundation.")
|
||||
"text": markForTranslation("The selected Citizens will automatically start constructing the building once you place the foundation."),
|
||||
"hint": markForTranslation("Wait for the storehouse to be built.")
|
||||
},
|
||||
"OnStructureBuilt": function(msg)
|
||||
{
|
||||
@@ -267,7 +272,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("The units should be ready soon.\nIn the meantime, direct your attention to your population count on the top panel. It is the fifth item from the left, after the resources. It would be prudent to keep an eye on it. It indicates your current population (including those being trained) and the current population limit, which is determined by your built structures.")
|
||||
"text": markForTranslation("The units should be ready soon.\nIn the meantime, direct your attention to your population count on the top panel. It is the fifth item from the left, after the resources. It would be prudent to keep an eye on it. It indicates your current population (including those being trained) and the current population limit, which is determined by your built structures."),
|
||||
"hint": markForTranslation("Wait for the training of the Civilians to finish.")
|
||||
},
|
||||
"OnTrainingFinished": function(msg)
|
||||
{
|
||||
@@ -364,7 +370,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
"panelData": {
|
||||
"text":
|
||||
markForTranslation("When the Farmstead construction is finished, its builders will automatically look for food, and in this case, they will go after the nearby goats.\n") +
|
||||
markForTranslation("But your House builders will only look for something else to build and, if nothing found, become idle. Let's wait for them to build the Houses.")
|
||||
markForTranslation("But your House builders will only look for something else to build and, if nothing found, become idle."),
|
||||
"hint": markForTranslation("Wait until the houses are built.")
|
||||
},
|
||||
"IsDone": function()
|
||||
{
|
||||
@@ -381,7 +388,7 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("When both Houses are built, select your two Civilians and order them to build a Field as close as possible to the Farmstead, which is a dropsite for all types of food.")
|
||||
"text": markForTranslation("Select your two Civilians and order them to build a Field as close as possible to the Farmstead, which is a dropsite for all types of food.")
|
||||
},
|
||||
"OnPlayerCommand": function(msg)
|
||||
{
|
||||
@@ -497,7 +504,8 @@ Trigger.prototype.tutorialSteps = [
|
||||
{
|
||||
"type": TUTORIAL_STEP_TYPE.INSTRUCTION,
|
||||
"panelData": {
|
||||
"text": markForTranslation("Let's wait for the Barracks to be built. As this construction is lengthy, you can add two soldiers to build it faster. To do so, select your Civic Center and set up a rally point on the Barracks foundation by right-clicking on it (you should see a hammer icon). Then produce two more builders by clicking on the Hoplite icon twice.")
|
||||
"text": markForTranslation("As the construction of a Barracks is lengthy, you can add two soldiers to build it faster. To do so, select your Civic Center and set up a rally point on the Barracks foundation by right-clicking on it (you should see a hammer icon). Then produce two more builders by clicking on the Hoplite icon twice."),
|
||||
"hint": markForTranslation("Wait for the Barracks to be built.")
|
||||
},
|
||||
"OnStructureBuilt": function(msg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user