Skip to content

Commit a6b39b1

Browse files
committed
Re-added vehicle previews with added codex info
1 parent 0bfdcd9 commit a6b39b1

File tree

1 file changed

+153
-0
lines changed

1 file changed

+153
-0
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/** @file Quests - Vehicle Previews
2+
3+
Quests have a type enum, vehicle quests can be filtered by `gameJournalQuestType.VehicleQuest`
4+
5+
DJ_Kovrik and I couldn't find any references between the quest and the journal messages from the
6+
fixer with the car image, so the codex references are currently hardcoded by questID
7+
*/
8+
9+
@wrapMethod(QuestDetailsPanelController)
10+
private final func PopulateCodexLinks(trackedObjective: ref<JournalQuestObjective>) -> Void {
11+
wrappedMethod(trackedObjective);
12+
13+
// Iterate up the journal hierarchy until we find the parent quest (or nothing?)
14+
let parentEntry: ref<JournalEntry> = trackedObjective;
15+
while (IsDefined(parentEntry) && !parentEntry.IsA(n"gameJournalQuest")) {
16+
parentEntry = this.m_journalManager.GetParentEntry(parentEntry);
17+
}
18+
19+
if IsDefined(parentEntry) {
20+
let parentQuest = parentEntry as JournalQuest;
21+
if IsDefined(parentQuest) && Equals(parentQuest.GetType(), gameJournalQuestType.VehicleQuest) {
22+
let ent = this.flibGetVehicleCodexEntry(parentQuest.GetId());
23+
if IsDefined(ent) {
24+
this.SpawnCodexLink(ent);
25+
}
26+
}
27+
}
28+
}
29+
30+
@addMethod(QuestDetailsPanelController)
31+
private func flibGetVehicleCodexEntry(questId: String) -> ref<JournalEntry> {
32+
let codexPath: String = "codex/glossary/vehicles/";
33+
switch (questId) {
34+
// --- Bikes:
35+
// Kusanagi CT-3X
36+
case "yaiba_kusanagi":
37+
codexPath += "ow_v_sportbike1_yaiba_kusanagi_player";
38+
break;
39+
// ARCH Nazare Racer
40+
case "arch":
41+
codexPath += "ow_v_sportbike2_arch_player";
42+
break;
43+
// Apollo
44+
case "brennan_apollo":
45+
codexPath += "ow_v_sportbike3_brennan_apollo_player";
46+
break;
47+
// --- Sport 1:
48+
// Outlaw GTS
49+
case "herrera_outlaw":
50+
codexPath += "ow_v_sport1_herrera_outlaw_player";
51+
break;
52+
// Turbo-R 740
53+
case "quadra_turbo":
54+
codexPath += "ow_v_sport1_quadra_turbo_player";
55+
break;
56+
// Rayfield Aerondight "Guinevere"
57+
case "rayfield_aerondight":
58+
codexPath += "ow_v_sport1_rayfield_aerondight_player";
59+
break;
60+
// Rayfield Caliburn
61+
case "rayfield_caliburn":
62+
codexPath += "ow_v_sport1_rayfield_caliburn_player";
63+
break;
64+
// --- Sport 2:
65+
// Shion MZ2
66+
case "mizutani_shion":
67+
codexPath += "ow_v_sport2_mizutani_shion_player";
68+
break;
69+
// Shion "Coyote"
70+
case "mizutani_shion_nomad":
71+
codexPath += "ow_v_sport2_mizutani_shion_nomad_player";
72+
break;
73+
// Type-66 640 TS
74+
case "quadra_type66":
75+
codexPath += "ow_v_sport2_quadra_type66_player";
76+
break;
77+
// Quadra Type-66 Avenger
78+
case "quadra_type66_avenger":
79+
codexPath += "ow_v_sport2_quadra_type66_avenger_player";
80+
break;
81+
// Quadra Type-66 "Javelina"
82+
case "quadra_type66_nomad":
83+
codexPath += "ow_v_sport2_quadra_type66_nomad_player";
84+
break;
85+
// Quadra Type-66 "Cthulhu"
86+
case "quadra_type66_nomad_ncu":
87+
codexPath += "quadra_type_66_nc_deathrace";
88+
break;
89+
// Alvarado V4F 570 Delegate
90+
case "villefort_alvarado":
91+
codexPath += "ow_v_sport2_villefort_alvarado_player";
92+
break;
93+
// --- Standard 2:
94+
// Quartz EC-L r275
95+
case "archer_quartz":
96+
codexPath += "ow_v_standard2_archer_quartz_player";
97+
break;
98+
// Thrax 388 Jefferson
99+
case "chevalier_thrax":
100+
codexPath += "ow_v_standard2_chevalier_thrax_player";
101+
break;
102+
// MaiMai P126
103+
case "makigai_maimai":
104+
codexPath += "ow_v_standard2_makigai_maimai_player";
105+
break;
106+
// Thorton Colby C240t
107+
case "thorton_colby":
108+
codexPath += "ow_v_standard2_thorton_colby_player";
109+
break;
110+
// Galena G240
111+
case "thorton_galena":
112+
codexPath += "ow_v_standard2_thorton_galena_player";
113+
break;
114+
// Thorton Galena "Gecko"
115+
case "thorton_galena_nomad":
116+
codexPath += "ow_v_standard2_thorton_galena_nomad_player";
117+
break;
118+
// Cortes V5000 Valor
119+
case "villefort_cortes":
120+
codexPath += "ow_v_standard2_villefort_cortes_player";
121+
break;
122+
// --- Standard 2.5:
123+
// Supron FS3
124+
case "mahir_supron":
125+
codexPath += "ow_v_standard25_mahir_supron_player";
126+
break;
127+
// Thorton Colby "Little Mule"
128+
case "thorton_colby_nomad":
129+
codexPath += "ow_v_standard25_thorton_colby_nomad_player";
130+
break;
131+
// Thorton Colby CX410 Butte
132+
case "thorton_colby_pickup":
133+
codexPath += "ow_v_standard25_thorton_colby_pickup_player";
134+
break;
135+
// Columbus V340-F Freight
136+
case "villefort_columbus":
137+
codexPath += "ow_v_standard25_villefort_columbus_player";
138+
break;
139+
// --- Standard 3:
140+
// Emperor 620 Ragnar
141+
case "chevalier_emperor":
142+
codexPath += "ow_v_standard3_chevalier_emperor_player";
143+
break;
144+
// Mackinaw MTL1
145+
case "thorton_mackinaw":
146+
codexPath += "ow_v_standard3_thorton_mackinaw_player";
147+
break;
148+
default:
149+
return null;
150+
};
151+
152+
return this.m_journalManager.GetEntryByString(codexPath, "gameJournalCodexEntry");
153+
}

0 commit comments

Comments
 (0)