-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-games_insecure_compatibility.tp2
100 lines (80 loc) · 2.04 KB
/
setup-games_insecure_compatibility.tp2
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
88
89
90
91
92
93
94
95
96
97
98
99
100
// Never Forget: Comments can "lie", but code not so much ;P
BACKUP ~./weidu_external/games_insecure_compatibility/backup~ // %MOD_FOLDER% doesn't work here
AUTHOR ~YOU~
VERSION ~v0.0.0~
//AUTO_EVAL_STRINGS// This will prevent the need of EVAL for string variables
// --------------
// Initialization
// --------------
ALWAYS
// LIBRARY INCLUDES(Don't change these)
// ------------------------------------
INCLUDE ~%MOD_FOLDER%/lib/warnings.tph~
// CREATING ITEM FILE(for testing patch version)
// ----------------------------------------------
CREATE ~ITM~ ~Testfile~
END// End of "ALWAYS"
LANGUAGE
~English~ // Language
~English~ // Directory
~%MOD_FOLDER%/en_US/!_warnings.tra~
LANGUAGE
~Deutsch~ // Language
~German~ // Directory
~%MOD_FOLDER%/de_DE/!_warnings.tra~
// -----------
// Start Tests
// -----------
BEGIN ~Games insecure compatibility~
// Creates an array with game shortcuts whose compatibilty with the mod is uncertain
ACTION_DEFINE_ARRAY games_insecure_compatibility
BEGIN
~bg2~
~tob~
~iwd2~
~pst~
~bg1~
~totsc~
~iwd1~
~how~
~totlm~
~tutu~
~tutu_totsc~
~bgt~
~ca~
~iwd_in_bg2~
~bgee~
~bg2ee~
~eet~
~iwdee~
~pstee~
END
// OUTSIDE OF PATCHING
// -------------------
OUTER_SPRINT warning @2147483646
// Checks all game shortcuts
OUTER_FOR (index = 0; VARIABLE_IS_SET $games_insecure_compatibility(~%index%~); ++index) BEGIN
// Gets specific game shortcut
OUTER_TEXT_SPRINT game $games_insecure_compatibility(~%index%~)
// Calls warning
LAF WARN_EVALUATE_GAME_EXISTANCE
STR_VAR
game = EVAL ~%game%~
message = EVAL ~%warning%~
END
END
// PATCHING ITEM TESTFILE
// ----------------------
COPY_EXISTING ~Testfile.ITM~ ~%MOD_FOLDER%~
SPRINT warning @2147483646
// Checks all game shortcuts
FOR (index = 0; VARIABLE_IS_SET $games_insecure_compatibility(~%index%~); ++index) BEGIN
// Gets specific game shortcut
TEXT_SPRINT game $games_insecure_compatibility(~%index%~)
// Calls warning
LPF WARN_EVALUATE_GAME_EXISTANCE
STR_VAR
game = EVAL ~%game%~
message = EVAL ~%warning%~
END
END