-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
34 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,7 @@ MetaFileClass { | |
} | ||
CONFResourceClass HEADLESS : PC { | ||
} | ||
CONFResourceClass PS5 : PC { | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ns/GME/Scripts/Game/GME/Editor/Containers/Attributes/GME_ToggleDamageCharacterAttribute.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//------------------------------------------------------------------------------------------------ | ||
//! Entity attribute for toggle damage on unit | ||
[BaseContainerProps(), SCR_BaseEditorAttributeCustomTitle()] | ||
class GME_ToggleDamageCharacterAttribute : GME_ToggleDamageEditorAttribute | ||
{ | ||
//------------------------------------------------------------------------------------------------ | ||
override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager) | ||
{ | ||
if (!SCR_EditableCharacterComponent.Cast(item)) | ||
return null; | ||
|
||
return super.ReadVariable(item, manager); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 7 additions & 39 deletions
46
addons/GME/Scripts/Game/GME/Editor/Containers/Attributes/GME_ToggleDamageVehicleAttribute.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,14 @@ | ||
/** | ||
Entity Attribute for toggle damage on unit | ||
*/ | ||
//------------------------------------------------------------------------------------------------ | ||
//! Entity attribute for toggle damage on vehicle | ||
[BaseContainerProps(), SCR_BaseEditorAttributeCustomTitle()] | ||
class GME_ToggleDamageVehicleEditorAttribute : SCR_BaseEditorAttribute | ||
class GME_ToggleDamageVehicleEditorAttribute : GME_ToggleDamageEditorAttribute | ||
{ | ||
//------------------------------------------------------------------------------------------------ | ||
override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager) | ||
{ | ||
|
||
SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item); | ||
if (!editableEntity) | ||
return null; | ||
|
||
IEntity owner = editableEntity.GetOwner(); | ||
if (!owner) | ||
if (!SCR_EditableVehicleComponent.Cast(item)) | ||
return null; | ||
|
||
if (!Vehicle.Cast(owner)) | ||
return null; | ||
|
||
DamageManagerComponent damageComponent = DamageManagerComponent.Cast(owner.FindComponent(DamageManagerComponent)); | ||
|
||
if (!damageComponent) | ||
return null; | ||
|
||
return SCR_BaseEditorAttributeVar.CreateBool(damageComponent.IsDamageHandlingEnabled()); | ||
} | ||
override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID) | ||
{ | ||
if (!var) | ||
return; | ||
|
||
SCR_EditableEntityComponent editableEntity = SCR_EditableEntityComponent.Cast(item); | ||
|
||
IEntity owner = editableEntity.GetOwner(); | ||
if (!owner) | ||
return; | ||
|
||
DamageManagerComponent damageComponent = DamageManagerComponent.Cast(owner.FindComponent(DamageManagerComponent)); | ||
if (!damageComponent) | ||
return; | ||
|
||
// toggle damage handling | ||
damageComponent.EnableDamageHandling(var.GetBool()); | ||
return super.ReadVariable(item, manager); | ||
} | ||
}; | ||
} |
26 changes: 0 additions & 26 deletions
26
addons/GME/Scripts/GameCode/GME/Components/SCR_DamageManagerComponent.c
This file was deleted.
Oops, something went wrong.