-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMonitoringStrategy.cs
More file actions
94 lines (81 loc) · 3 KB
/
MonitoringStrategy.cs
File metadata and controls
94 lines (81 loc) · 3 KB
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
namespace MWC_Localization_Core
{
/// <summary>
/// Defines how frequently a TextMesh should be monitored for changes.
/// </summary>
public enum MonitoringStrategy
{
/// <summary>
/// Translate once during the initial scene scan, then stop monitoring.
/// Use for static UI elements that never change.
/// </summary>
TranslateOnce,
/// <summary>
/// Monitor every frame without throttling.
/// Use for interaction prompts, subtitles, and other critical real-time UI.
/// </summary>
EveryFrame,
/// <summary>
/// Monitor at a fast polling interval for responsive UI.
/// Use for active HUD elements that update frequently.
/// </summary>
FastPolling,
/// <summary>
/// Monitor at a slow polling interval for less critical content.
/// Use for teletext, FSM-generated content, and weather displays.
/// </summary>
SlowPolling,
/// <summary>
/// Keep checking even after translation for content that is frequently rebuilt.
/// Use for magazine text and similar regenerated content.
/// </summary>
Persistent,
/// <summary>
/// Translate only when a GameObject becomes active in the hierarchy.
/// Use for menus, dialogs, and other show/hide UI panels.
/// </summary>
OnVisibilityChange,
/// <summary>
/// Translate once when the TextMesh becomes available later.
/// Use for dynamically created TextMeshes that appear after the initial scan.
/// </summary>
LateTranslateOnce,
/// <summary>
/// Apply the localized font once when the TextMesh becomes available, then stop monitoring.
/// Use for TextMeshes whose text is already translated upstream at the data source
/// (e.g. TeletextHandler / ArrayListProxyHandler / FsmTextHook mutate the backing data),
/// so no translation is needed - only the font swap.
/// </summary>
LateApplyFontOnce,
}
/// <summary>
/// Defines which translation method to use.
/// </summary>
public enum TranslationMode
{
/// <summary>
/// Simple dictionary lookup for exact text keys.
/// </summary>
SimpleLookup,
/// <summary>
/// Pattern matching with {0}, {1}, and similar placeholders.
/// </summary>
FsmPattern,
/// <summary>
/// Regular expression extraction and replacement.
/// </summary>
RegexExtract,
/// <summary>
/// Split by comma and translate each item independently.
/// </summary>
CommaSeparated,
/// <summary>
/// Use a custom handler for more complex translation logic.
/// </summary>
CustomHandler,
/// <summary>
/// Pattern matching with placeholders plus translation of extracted parameters.
/// </summary>
FsmPatternWithTranslation
}
}