Build independent Everon successor foundation and native regressions
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
MatPBRBasic {
|
||||
Color 0.882 0.847 0.792 1
|
||||
AlphaTest 0.5
|
||||
AllowUserAlphaBias 1
|
||||
BCRMap "$rendertarget"
|
||||
OpacityMap "{A64A8C63E0FBAE87}system/textures/defWhite.edds" "{A64A8C63E0FBAE87}system/textures/defWhite.edds" anim( 0 )
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
MetaFileClass {
|
||||
Name "{03D6DE777C8E411C}Materials/ERRM_MapRenderTarget.emat"
|
||||
Configurations {
|
||||
ResourceClass PC {
|
||||
}
|
||||
ResourceClass XBOX_ONE : PC {
|
||||
}
|
||||
ResourceClass XBOX_SERIES : PC {
|
||||
}
|
||||
ResourceClass PS4 : PC {
|
||||
}
|
||||
ResourceClass PS5 : PC {
|
||||
}
|
||||
ResourceClass HEADLESS : PC {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
GameEntity : "{C95E11C60810F432}Prefabs/Items/Core/Item_Base.et" {
|
||||
ID "6FB475409DE44320"
|
||||
components {
|
||||
InventoryItemComponent "{5222EB4D0C73006B}" {
|
||||
Attributes SCR_ItemAttributeCollection "{5222EB4D0A2B466B}" {
|
||||
ItemDisplayName UIInfo "{7236A6DB18BD574C}" {
|
||||
Name "Shared Field Map"
|
||||
Description "A field map whose visible surface can be read by nearby players."
|
||||
}
|
||||
ItemPhysAttributes ItemPhysicalAttributes PhysicalAttributes {
|
||||
Weight 0.1
|
||||
SizeSetupStrategy Manual
|
||||
ItemDimensions 5 5 5
|
||||
ItemVolume 200
|
||||
DimensionScaler 1
|
||||
RestingAdditiveRotationLS 0 0 0
|
||||
RestingAdditiveOffsetLS 0 0 0
|
||||
}
|
||||
ItemAnimationAttributes ItemAnimationAttributes "{4AC999738D39BA9A}" {
|
||||
AnimationAttachments {
|
||||
AnimationAttachmentInfo "{1D66E5B861D2F00A}" {
|
||||
AnimGraph "{83675D0B0AB1B2C3}Assets/Items/Equipment/workspaces/paper_map.agr"
|
||||
AnimInstance "{56794534F6B8C3D7}Assets/Items/Equipment/workspaces/player_map.asi"
|
||||
BindingName "Gadget"
|
||||
}
|
||||
}
|
||||
AllowInspection 1
|
||||
}
|
||||
CustomAttributes {
|
||||
PreviewRenderAttributes "{D12878E6C065B83D}" {
|
||||
CameraPreset Top
|
||||
CameraOrbitAngles -25 35 -25
|
||||
CameraDistanceToItem 2
|
||||
CameraOffset -0.01 0 0
|
||||
ItemRenderRotation 0 0 180
|
||||
FOV 10.5
|
||||
AspectRatio 1
|
||||
LodModel 1
|
||||
}
|
||||
CharacterModifierAttributes "{78A32EF06ED3CB42}" {
|
||||
ADSSpeedLimit 1
|
||||
}
|
||||
}
|
||||
m_eQuickSlotSize SLOT_1x1
|
||||
m_SlotType SLOT_GADGETS_STORAGE
|
||||
}
|
||||
}
|
||||
MeshObject "{E66421D681D64AB7}" {
|
||||
Object "{E443663E5241622A}Assets/Items/Equipment/Maps/Map_Paper_01/Map_Paper_01_folded.xob"
|
||||
Materials {
|
||||
MaterialAssignClass "{667CE655A40B0E50}" {
|
||||
SourceMaterial "01__Default"
|
||||
AssignedMaterial "{03D6DE777C8E411C}Materials/ERRM_MapRenderTarget.emat"
|
||||
}
|
||||
}
|
||||
InheritVisibility 1
|
||||
}
|
||||
RigidBody "{B29D8B091D657415}" {
|
||||
Enabled 1
|
||||
LinearDamping 0.5
|
||||
AngularDamping 0.5
|
||||
AngularSleepingThreashold 1
|
||||
ModelGeometry 1
|
||||
}
|
||||
ERRM_SharedMapComponent "{B576912A7A69396F}" {
|
||||
m_sLayoutName "{255E1265F702B4AE}UI/layouts/ERRMap/SharedMapRenderTarget.layout"
|
||||
m_eAnimVariable MAP
|
||||
}
|
||||
SCR_SoundDataComponent "{B6F06259A1F25D94}" {
|
||||
m_aAudioSourceConfiguration {
|
||||
SCR_AudioSourceConfiguration "{1F4628334AB3CE95}" {
|
||||
m_sSoundProject "{13F8D0DE67678118}Sounds/Items/_SharedData/PickUp/Items_PickUp_Map.acp"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
coords 0 0 0
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
MetaFileClass {
|
||||
Name "{A46500E4A30B653B}Prefabs/Items/Equipment/ERRM_SharedFieldMap.et"
|
||||
Configurations {
|
||||
EntityTemplateResourceClass PC {
|
||||
}
|
||||
EntityTemplateResourceClass XBOX_ONE : PC {
|
||||
}
|
||||
EntityTemplateResourceClass XBOX_SERIES : PC {
|
||||
}
|
||||
EntityTemplateResourceClass PS4 : PC {
|
||||
}
|
||||
EntityTemplateResourceClass PS5 : PC {
|
||||
}
|
||||
EntityTemplateResourceClass HEADLESS : PC {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// Read replicated discovery locally. A server-wide marker list never leaks
|
||||
// locations which have not been recovered through gameplay.
|
||||
modded class ERR_LocationComponent
|
||||
{
|
||||
protected ref SCR_MapMarkerBase m_ERRMarker;
|
||||
protected int m_ERRShown;
|
||||
|
||||
protected override void EOnInit(IEntity owner)
|
||||
{
|
||||
super.EOnInit(owner);
|
||||
if (RplSession.Mode() != RplMode.Dedicated && !SCR_Global.IsEditMode())
|
||||
GetGame().GetCallqueue().CallLater(ERR_UpdateMarker, 1500, true);
|
||||
}
|
||||
protected void ERR_UpdateMarker()
|
||||
{
|
||||
if (!GetGame().GetPlayerController() || Knowledge() <= 0 || Knowledge() == m_ERRShown) return;
|
||||
SCR_MapMarkerManagerComponent manager = SCR_MapMarkerManagerComponent.GetInstance();
|
||||
if (!manager || !manager.GetMarkerConfig()) return;
|
||||
if (!m_ERRMarker)
|
||||
{
|
||||
m_ERRMarker = new SCR_MapMarkerBase();
|
||||
m_ERRMarker.SetType(SCR_EMapMarkerType.PLACED_CUSTOM);
|
||||
vector p = Position();
|
||||
m_ERRMarker.SetWorldPos(Math.Round(p[0]), Math.Round(p[2]));
|
||||
m_ERRMarker.SetMarkerConfigID(0);
|
||||
manager.InsertStaticMarker(m_ERRMarker, true);
|
||||
}
|
||||
string label = "Unknown location";
|
||||
if (Knowledge() == 2)
|
||||
{
|
||||
if (Kind() == ERR_LocationKind.RADIO) label = "Radio station";
|
||||
else if (Kind() == ERR_LocationKind.EXTRACTION) label = "Extraction helicopter";
|
||||
else label = Id();
|
||||
}
|
||||
m_ERRMarker.SetCustomText(label);
|
||||
m_ERRShown = Knowledge();
|
||||
}
|
||||
protected override void OnDelete(IEntity owner)
|
||||
{
|
||||
if (GetGame()) GetGame().GetCallqueue().Remove(ERR_UpdateMarker);
|
||||
SCR_MapMarkerManagerComponent manager = SCR_MapMarkerManagerComponent.GetInstance();
|
||||
if (manager && m_ERRMarker) manager.RemoveStaticMarker(m_ERRMarker);
|
||||
m_ERRMarker = null;
|
||||
super.OnDelete(owner);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
modded class ERR_ScenarioComponent
|
||||
{
|
||||
protected override ResourceName FieldMap()
|
||||
{
|
||||
return "{A46500E4A30B653B}Prefabs/Items/Equipment/ERRM_SharedFieldMap.et";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
[ComponentEditorProps(category: "GameScripted/Gadgets", description: "Vanilla map gadget with a world-visible rendered surface")]
|
||||
class ERRM_SharedMapComponentClass : SCR_MapGadgetComponentClass
|
||||
{
|
||||
[Attribute("{255E1265F702B4AE}UI/layouts/ERRMap/SharedMapRenderTarget.layout", UIWidgets.ResourcePickerThumbnail, "Off-screen map render target", "layout")]
|
||||
protected ResourceName m_sLayoutName;
|
||||
|
||||
[Attribute("0.12", UIWidgets.EditBox, "Initial map zoom in pixels per metre", "0.01 20", category: "Shared Map")]
|
||||
protected float m_fInitialZoom;
|
||||
|
||||
ResourceName GetSharedMapLayout()
|
||||
{
|
||||
return m_sLayoutName;
|
||||
}
|
||||
|
||||
float GetInitialZoom()
|
||||
{
|
||||
return m_fInitialZoom;
|
||||
}
|
||||
}
|
||||
|
||||
// This remains a real SCR_MapGadgetComponent, so the normal M-key map,
|
||||
// animations, ruler and faction-specific protractor settings keep working.
|
||||
// The extra off-screen widget supplies the texture used by the held model.
|
||||
class ERRM_SharedMapComponent : SCR_MapGadgetComponent
|
||||
{
|
||||
protected const ResourceName MAP_CONFIG = "{A786DD4868598F15}Configs/Map/MapPlain.conf";
|
||||
protected const int MAP_SETUP_DELAY_MS = 100;
|
||||
protected const int MAP_CAPTURE_DELAY_MS = 500;
|
||||
protected const int MAP_RETRY_DELAY_MS = 250;
|
||||
|
||||
protected Widget m_ESMRootWidget;
|
||||
protected RTTextureWidget m_ESMRenderTarget;
|
||||
protected SCR_MapEntity m_ESMMapEntity;
|
||||
protected IEntity m_ESMCharacterOwner;
|
||||
protected bool m_bESMInHand;
|
||||
protected bool m_bESMOwnsMapRenderer;
|
||||
|
||||
protected override void EOnInit(IEntity owner)
|
||||
{
|
||||
super.EOnInit(owner);
|
||||
|
||||
ERRM_SharedMapComponentClass data = ERRM_SharedMapComponentClass.Cast(GetComponentData(owner));
|
||||
WorkspaceWidget workspace = GetGame().GetWorkspace();
|
||||
if (!data || !workspace || data.GetSharedMapLayout().IsEmpty())
|
||||
return;
|
||||
|
||||
m_ESMRootWidget = workspace.CreateWidgets(data.GetSharedMapLayout());
|
||||
if (!m_ESMRootWidget)
|
||||
return;
|
||||
|
||||
m_ESMRenderTarget = RTTextureWidget.Cast(m_ESMRootWidget.FindAnyWidget("RTTexture0"));
|
||||
if (!m_ESMRenderTarget)
|
||||
return;
|
||||
|
||||
m_ESMRenderTarget.SetRenderTarget(owner);
|
||||
m_ESMRenderTarget.SetEnabled(false);
|
||||
}
|
||||
|
||||
protected override void ModeSwitch(EGadgetMode mode, IEntity charOwner)
|
||||
{
|
||||
if (mode != EGadgetMode.IN_HAND || !m_ESMRootWidget || !m_ESMRenderTarget)
|
||||
{
|
||||
super.ModeSwitch(mode, charOwner);
|
||||
return;
|
||||
}
|
||||
|
||||
m_bESMInHand = true;
|
||||
m_ESMCharacterOwner = charOwner;
|
||||
TryCaptureMapSurface();
|
||||
}
|
||||
|
||||
protected override void ModeClear(EGadgetMode mode)
|
||||
{
|
||||
if (mode == EGadgetMode.IN_HAND)
|
||||
StopMapCapture();
|
||||
|
||||
super.ModeClear(mode);
|
||||
}
|
||||
|
||||
protected void TryCaptureMapSurface()
|
||||
{
|
||||
if (!m_bESMInHand)
|
||||
return;
|
||||
|
||||
if (!m_ESMRootWidget || !m_ESMRenderTarget)
|
||||
{
|
||||
CompleteMapModeSwitch();
|
||||
return;
|
||||
}
|
||||
|
||||
m_ESMMapEntity = SCR_MapEntity.GetMapInstance();
|
||||
if (!m_ESMMapEntity)
|
||||
{
|
||||
CompleteMapModeSwitch();
|
||||
return;
|
||||
}
|
||||
|
||||
// The owner's normal map has priority. Capture only after it closes;
|
||||
// otherwise this auxiliary render would replace or close the M-key UI.
|
||||
if (m_ESMMapEntity.IsOpen())
|
||||
{
|
||||
GetGame().GetCallqueue().CallLater(TryCaptureMapSurface, MAP_RETRY_DELAY_MS, false);
|
||||
return;
|
||||
}
|
||||
|
||||
m_ESMRenderTarget.SetEnabled(true);
|
||||
MapConfiguration mapConfig = m_ESMMapEntity.SetupMapConfig(EMapEntityMode.PLAIN, MAP_CONFIG, m_ESMRootWidget);
|
||||
if (!mapConfig)
|
||||
{
|
||||
CompleteMapModeSwitch();
|
||||
return;
|
||||
}
|
||||
|
||||
m_ESMMapEntity.OpenMap(mapConfig);
|
||||
m_bESMOwnsMapRenderer = true;
|
||||
RestoreCharacterCamera();
|
||||
|
||||
GetGame().GetCallqueue().CallLater(CenterMapOnHolder, MAP_SETUP_DELAY_MS, false);
|
||||
GetGame().GetCallqueue().CallLater(FinishMapCapture, MAP_CAPTURE_DELAY_MS, false);
|
||||
}
|
||||
|
||||
protected void CenterMapOnHolder()
|
||||
{
|
||||
if (!m_bESMOwnsMapRenderer || !m_ESMMapEntity || !m_ESMCharacterOwner)
|
||||
return;
|
||||
|
||||
ERRM_SharedMapComponentClass data = ERRM_SharedMapComponentClass.Cast(GetComponentData(GetOwner()));
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
vector holderPosition = m_ESMCharacterOwner.GetOrigin();
|
||||
m_ESMMapEntity.ZoomPanSmooth(data.GetInitialZoom(), holderPosition[0], holderPosition[2], 0.1);
|
||||
}
|
||||
|
||||
protected void FinishMapCapture()
|
||||
{
|
||||
if (!m_bESMOwnsMapRenderer)
|
||||
return;
|
||||
|
||||
// Freeze the last rendered frame before closing the auxiliary map.
|
||||
// Leaving the widget enabled would redraw the closed map as an empty
|
||||
// texture and make the physical map appear to vanish.
|
||||
if (m_ESMRenderTarget)
|
||||
m_ESMRenderTarget.SetEnabled(false);
|
||||
|
||||
if (m_ESMMapEntity && m_ESMMapEntity.IsOpen())
|
||||
m_ESMMapEntity.CloseMap();
|
||||
|
||||
m_bESMOwnsMapRenderer = false;
|
||||
RestoreCharacterCamera();
|
||||
CompleteMapModeSwitch();
|
||||
}
|
||||
|
||||
protected void CompleteMapModeSwitch()
|
||||
{
|
||||
if (!m_bESMInHand || !m_ESMCharacterOwner)
|
||||
return;
|
||||
|
||||
// Start the stock map only after the world-visible surface owns a frame.
|
||||
super.ModeSwitch(EGadgetMode.IN_HAND, m_ESMCharacterOwner);
|
||||
}
|
||||
|
||||
protected void StopMapCapture()
|
||||
{
|
||||
m_bESMInHand = false;
|
||||
GetGame().GetCallqueue().Remove(TryCaptureMapSurface);
|
||||
GetGame().GetCallqueue().Remove(CenterMapOnHolder);
|
||||
GetGame().GetCallqueue().Remove(FinishMapCapture);
|
||||
|
||||
if (m_bESMOwnsMapRenderer && m_ESMMapEntity && m_ESMMapEntity.IsOpen())
|
||||
m_ESMMapEntity.CloseMap();
|
||||
|
||||
m_bESMOwnsMapRenderer = false;
|
||||
m_ESMCharacterOwner = null;
|
||||
RestoreCharacterCamera();
|
||||
}
|
||||
|
||||
protected void RestoreCharacterCamera()
|
||||
{
|
||||
if (!GetGame()) return;
|
||||
PlayerController playerController = GetGame().GetPlayerController();
|
||||
if (playerController)
|
||||
playerController.SetCharacterCameraRenderActive(true);
|
||||
}
|
||||
|
||||
protected override void OnDelete(IEntity owner)
|
||||
{
|
||||
StopMapCapture();
|
||||
|
||||
// The entity may already be destroyed when this callback runs during a
|
||||
// world restart. Destroying the widget releases its render binding without
|
||||
// passing the deleted entity back into the native renderer.
|
||||
if (m_ESMRootWidget)
|
||||
m_ESMRootWidget.RemoveFromHierarchy();
|
||||
|
||||
m_ESMRenderTarget = null;
|
||||
m_ESMRootWidget = null;
|
||||
super.OnDelete(owner);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
FrameWidgetClass {
|
||||
Name "rootFrame"
|
||||
Slot FrameWidgetSlot {
|
||||
SizeX 1024
|
||||
OffsetRight -1024
|
||||
SizeY 1024
|
||||
OffsetBottom -1024
|
||||
}
|
||||
{
|
||||
RTTextureWidgetClass {
|
||||
Name "RTTexture0"
|
||||
Slot FrameWidgetSlot {
|
||||
Anchor 0 0 1 1
|
||||
SizeX -1024
|
||||
OffsetRight 0
|
||||
SizeY -1024
|
||||
OffsetBottom 0
|
||||
}
|
||||
{
|
||||
MapWidgetClass {
|
||||
Name "MapWidget"
|
||||
Slot FrameWidgetSlot {
|
||||
Anchor 0 0 1 1
|
||||
SizeX -1024
|
||||
OffsetRight 0
|
||||
SizeY -1024
|
||||
OffsetBottom 0
|
||||
}
|
||||
Clipping False
|
||||
Color 1 1 1 1
|
||||
SizeInUnits 1024 1024
|
||||
OffsetPixels 0 0
|
||||
Clear 1
|
||||
ClearColor 0.78 0.74 0.62 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
MetaFileClass {
|
||||
Name "{255E1265F702B4AE}UI/layouts/ERRMap/SharedMapRenderTarget.layout"
|
||||
Configurations {
|
||||
LayoutResourceClass PC {
|
||||
}
|
||||
LayoutResourceClass XBOX_ONE : PC {
|
||||
}
|
||||
LayoutResourceClass XBOX_SERIES : PC {
|
||||
}
|
||||
LayoutResourceClass PS4 : PC {
|
||||
}
|
||||
LayoutResourceClass PS5 : PC {
|
||||
}
|
||||
LayoutResourceClass HEADLESS : PC {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
GameProject {
|
||||
ID "ERR_Map"
|
||||
GUID "9AAEE9041D79809E"
|
||||
TITLE "Escapists Rereintroduced - Map"
|
||||
Dependencies {
|
||||
"58D0FB3206B6F859"
|
||||
"2528466DE220D91C"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user