53 lines
2.5 KiB
C
53 lines
2.5 KiB
C
#ifdef WORKBENCH
|
|
class ERR_TextProbeHeader
|
|
{
|
|
static ref SCR_MissionHeader Value;
|
|
static MissionHeader Get() { return Value; }
|
|
}
|
|
modded class ArmaReforgerScripted
|
|
{
|
|
void ProbeRestoreText() { ERR_RestoreTerrainPresentation(); }
|
|
}
|
|
modded class SCR_LoadingScreenComponent
|
|
{
|
|
string ProbeDescription() { return m_Widgets.m_wDescription.GetText(); }
|
|
}
|
|
modded class ERR_GameMode
|
|
{
|
|
protected override void StartScenario() {}
|
|
protected override void EOnInit(IEntity owner)
|
|
{
|
|
super.EOnInit(owner);
|
|
if (!SCR_Global.IsEditMode()) GetGame().GetCallqueue().CallLater(TextProbe, 8000, false);
|
|
}
|
|
void TextProbe()
|
|
{
|
|
string description, details;
|
|
if (!ERR_TerrainMissionText.Load(description, details) || description.IsEmpty() || details.IsEmpty())
|
|
{ Print("ERR SMOKE FAIL: authored text resource", LogLevel.ERROR); return; }
|
|
SCR_MissionHeader header = new SCR_MissionHeader();
|
|
ERR_TextProbeHeader.Value = header;
|
|
string oldDescription = header.m_sDescription, oldDetails = header.m_sDetails;
|
|
header.m_sDescription = "Source terrain description"; header.m_sDetails = "Source terrain details";
|
|
Widget root = GetGame().GetWorkspace().CreateWidgets("{4C8B29889444BDA3}UI/layouts/Menus/LoadingScreen/ScenarioLoadingScreen.layout");
|
|
SCR_LoadingScreenComponent loading = new SCR_LoadingScreenComponent();
|
|
root.AddHandler(loading);
|
|
if (!loading) { Print("ERR SMOKE FAIL: native loading component", LogLevel.ERROR); return; }
|
|
loading.OnMissionDataRetrieved(header);
|
|
if (loading.ProbeDescription() != "Source terrain details") { Print("ERR SMOKE FAIL: original loading text", LogLevel.ERROR); return; }
|
|
GetGame().ERR_PresentTerrainTakeover();
|
|
loading.Update(0.6);
|
|
if (header.m_sDescription != description || header.m_sDetails != details || loading.ProbeDescription() != WidgetManager.Translate(details))
|
|
{ Print("ERR SMOKE FAIL: confirmed takeover loading text", LogLevel.ERROR); return; }
|
|
Print("ERR SMOKE PASS: authored Escape text replaces terrain details in actual loading widget after takeover");
|
|
GetGame().ProbeRestoreText(); loading.Update(0.6);
|
|
if (header.m_sDescription != "Source terrain description" || header.m_sDetails != "Source terrain details" || loading.ProbeDescription() != "Source terrain details")
|
|
{ Print("ERR SMOKE FAIL: restore terrain text", LogLevel.ERROR); return; }
|
|
header.m_sDescription = oldDescription; header.m_sDetails = oldDetails;
|
|
root.RemoveFromHierarchy();
|
|
Print("ERR SMOKE PASS: original description and details restored in header and widget");
|
|
Print("ERR SMOKE COMPLETE: terrain-text");
|
|
}
|
|
}
|
|
#endif
|