blob: 625cbab33af458157fd1d848c383781d9f6b9a83 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
using I2.Loc;
using TMPro;
using UnityEngine;
public class QuestEntry : MonoBehaviour
{
public TextMeshProUGUI questText;
public TextMeshProUGUI numericalCondition;
public GameObject equippableConditionsParent;
public QuestConditionEquippable equippableConditionPrefab;
public CanvasGroup canvasGroup;
public void Init(Quest data, int index, bool completed)
{
string text = "<style=\"Body Bold Italic\">";
switch (index)
{
case 0:
text += "A.";
break;
case 1:
text += "B.";
break;
case 2:
text += "C.";
break;
case 3:
text += "D.";
break;
case 4:
text += "E.";
break;
case 5:
text += "F.";
break;
case 6:
text += "G.";
break;
case 7:
text += "H.";
break;
}
text += " ";
text += "<style=\"Body Light\">";
switch (data.questType)
{
case Quest.EType.AchieveScoreOf:
equippableConditionsParent.SetActive(value: false);
numericalCondition.gameObject.SetActive(value: true);
numericalCondition.text = data.achieveScoreOf.ToString();
text += LocalizationManager.GetTranslation("Quests/Achieve Score");
break;
case Quest.EType.BeatTheLevel:
equippableConditionsParent.SetActive(value: false);
numericalCondition.gameObject.SetActive(value: false);
text += LocalizationManager.GetTranslation("Quests/Achieve Victory");
break;
case Quest.EType.BeatTheLevelWith:
equippableConditionsParent.SetActive(value: true);
numericalCondition.gameObject.SetActive(value: false);
text += LocalizationManager.GetTranslation("Quests/Achieve Victory With");
foreach (Equippable item in data.beatTheLevelWith)
{
Object.Instantiate(equippableConditionPrefab, equippableConditionsParent.transform).SetData(item);
}
break;
case Quest.EType.BeatTheLevelWithout:
equippableConditionsParent.SetActive(value: true);
numericalCondition.gameObject.SetActive(value: false);
text += LocalizationManager.GetTranslation("Quests/Achieve Victory Without");
foreach (Equippable item2 in data.beatTheLevelWithout)
{
Object.Instantiate(equippableConditionPrefab, equippableConditionsParent.transform).SetData(item2);
}
break;
}
questText.text = text;
if (completed)
{
canvasGroup.alpha = 0.1f;
}
}
}
|