Refactored health bars to SKSE events; SkyUI is now decoupled and is completely optional

This commit is contained in:
Eddoursul 2022-08-01 03:33:22 +02:00
parent 55f7e22fa3
commit 1a8a7f16aa
21 changed files with 112 additions and 106 deletions

BIN
Refactored health bars.esp Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,17 @@
Scriptname HealthBarManager Hidden
function Show(Actor akActor) global
int handle = ModEvent.Create("Enderal_ShowActorHealth")
if handle
ModEvent.PushForm(handle, akActor)
ModEvent.Send(handle)
endIf
endfunction
function Hide(Actor akActor) global
int handle = ModEvent.Create("Enderal_HideActorHealth")
if handle
ModEvent.PushForm(handle, akActor)
ModEvent.Send(handle)
endIf
endfunction

View File

@ -43,20 +43,10 @@ Function TransmuteOre(Form akSource, MineOreScript oreREF, int iCurrentResources
EndFunction
Function showActorHealthBars(Actor a)
GUI_ActorHealthBarPanel.addActors(a)
Endfunction
Function hideActorHealthBars(Actor a)
GUI_ActorHealthBarPanel.removeActors(a)
Endfunction
;=====================================================================================
; PROPERTIES
;=====================================================================================
_00E_GUI_ActorHealthBar Property GUI_ActorHealthBarPanel auto
Actor Property PlayerREF Auto
Projectile Property AlterPosProjectile Auto

View File

@ -186,10 +186,8 @@ Function EndSpecialAttack()
FS_NQR05_FatherREF.EvaluatePackage()
_00E_FS_ForgottenStories_Functions ForgottenStoriesMiscDialogue = Game.GetFormFromFile(0x01016E89, "Enderal - Forgotten Stories.esm") as _00E_FS_ForgottenStories_Functions
If FS_NQR05_SidedWithFather.GetValueInt() == 1
ForgottenStoriesMiscDialogue.showActorHealthBars(FS_NQR05_FatherREF)
HealthBarManager.Show(FS_NQR05_FatherREF)
FS_NQR05_FatherREF.StartCombat(FS_NQR05_TharaelREF)
FS_NQR05_TharaelREF.StartCombat(PlayerREF)
Else

View File

@ -2,20 +2,7 @@ Scriptname _00E_Func_CheckDependencies Hidden
Function CheckDependencies() global
; If Enderal - Forgotten Stories.esm is not loaded, kick the player back to main menu
if (Game.GetForm(0x4320E) as GlobalVariable).GetValue() as Int != 1
Utility.wait(2.0)
Game.QuitToMainMenu()
Debug.MessageBox("Enderal - Forgotten Stories.esm is not loaded! The game will not run properly. Open Data Files and enable it.")
return
EndIf
; Skip all other check on non-PC/non-VR platforms (for future ports)
; If you are porting Enderal to another platform, you may want to replace _00E_Func_CheckDependencies with your own script.
if Debug.GetPlatformName() != "Win64"
return
endif
; SKSE is currently mandatory
Int SKSEVer = SKSE.GetVersion()
if SKSEVer == 0
@ -25,6 +12,7 @@ Function CheckDependencies() global
Return
endif
; SkyUI is optional - override quest_journal.swf with the vanilla file, remove this check, and you are good to go
Quest bSkyUI = Game.GetFormFromFile(0x802, "SkyUI_SE.esp") as Quest
If bSkyUI == None
@ -34,6 +22,7 @@ Function CheckDependencies() global
Return
EndIf
; To get rid of this, make alternatives for CreatePotion and CalculateContentStrength first
if SKSE.GetPluginVersion("EnderalSE") == -1
Utility.wait(2.0)
Game.QuitToMainMenu()

View File

@ -107,7 +107,6 @@ event OnWidgetReset()
UpdateFadeOutDuration()
UpdateMoveDuration()
UpdateRemoveDuration()
endEvent
event OnGameReload()
@ -117,13 +116,27 @@ event OnGameReload()
_currentlyDisplayedActors = new Form[4]
endif
RegisterForModEvent("Enderal_ShowActorHealth", "AddActors")
RegisterForModEvent("Enderal_HideActorHealth", "RemoveActors")
UI.Invoke(HUD_MENU, WidgetRoot + ".removeAllActors")
Actor PlayerRef = Game.GetForm(0x14) as Actor
if ! PlayerRef.IsInCombat()
int n = _currentlyDisplayedActors.Length
While n > 0
n -= 1
_currentlyDisplayedActors[n] = None
EndWhile
return
endif
Utility.Wait(FadeOutDuration / 1000.0 + 0.05)
int i = _currentlyDisplayedActors.Length
While i > 0
i = i - 1
i -= 1
Actor akActor = _currentlyDisplayedActors[i] as Actor
If !akActor || akActor.GetFormID() == 0 || akActor.IsDeleted() || akActor.IsDisabled()
_currentlyDisplayedActors[i] = None
@ -132,12 +145,12 @@ event OnGameReload()
EndIf
EndWhile
Cell kCell = Game.GetPlayer().GetParentCell()
Cell kCell = PlayerRef.GetParentCell()
Int iIndex = kCell.GetNumRefs(43) ; NPC
While iIndex
iIndex -= 1
Actor akActor = kCell.GetNthRef(iIndex, 43) as Actor
if akActor.IsPlayerTeammate()
if akActor && akActor.IsPlayerTeammate()
AddActors(akActor)
endif
EndWhile
@ -168,6 +181,9 @@ Function UpdateRemoveDuration()
EndFunction
Function AddActors(Form aForm)
if ! aForm
return
endif
if _currentlyDisplayedActors.find(aForm) < 0
int i = _currentlyDisplayedActors.length
while i > 0
@ -183,6 +199,9 @@ Function AddActors(Form aForm)
EndFunction
Function RemoveActors(Form aForm)
if ! aForm
return
endif
int i = _currentlyDisplayedActors.find(aForm)
if i >= 0
_currentlyDisplayedActors[i] = None

View File

@ -1,14 +1,10 @@
Scriptname _00E_HealthBarSummons extends Actor
{Attaches and detaches the health bar to summons}
_00E_FS_ForgottenStories_Functions Property ForgottenStoriesMiscDialogue Auto
Bool Property DiesOnBleedout = False Auto
; Enderal SE: marked obsolete
Bool bRegisteredHealthBars = True ; Default to True, not False, for version update
Event OnLoad()
ForgottenStoriesMiscDialogue.showActorHealthBars(self)
HealthBarManager.Show(self)
EndEvent
Event OnEnterBleedout()
@ -30,15 +26,11 @@ Event OnUnload()
EndEvent
Function UnregisterHealthBars()
ForgottenStoriesMiscDialogue.hideActorHealthBars(self)
HealthBarManager.Hide(self)
EndFunction
Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
if aeCombatState == 1
ForgottenStoriesMiscDialogue.showActorHealthBars(self)
HealthBarManager.Show(self)
endif
endEvent
Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, Bool abPowerAttack, Bool abSneakAttack, Bool abBashAttack, Bool abHitBlocked)
ForgottenStoriesMiscDialogue.showActorHealthBars(self)
endEvent

View File

@ -90,17 +90,6 @@ Sound Property _00E_FS_IncreaseArcaneFeverM Auto
;Sound Property _00E_FS_Phasmalist_EnterWorld_Male Auto
;Sound Property _00E_FS_Phasmalist_EnterWorld_Female Auto
_00E_GUI_ActorHealthBar Property _ActorHealthBarShower Auto
_00E_GUI_ActorHealthBar Property ActorHealthBarShower
_00E_GUI_ActorHealthBar Function Get()
If (_ActorHealthBarShower == None)
_ActorHealthBarShower = Game.GetFormFromFile(0x01024b66, "Enderal - Forgotten Stories.esm") as _00E_GUI_ActorHealthBar
EndIf
return _ActorHealthBarShower
EndFunction
EndProperty
Message Property _00E_BlitzheilungArkanistenfieber_sFeverIncreased Auto
GlobalVariable Property _00E_Phasmalist_IsApparationSummoned Auto
@ -166,11 +155,11 @@ Endfunction
; utility functions ----------------------------------------------------------------------------------------------------------------------------------------------------------
Function _RemoveApparationHealthBar()
ActorHealthBarShower.RemoveActors(self.getActorReference())
HealthBarManager.Hide(self.getActorReference())
EndFunction
Function _AddApparationHealthBar()
ActorHealthBarShower.AddActors(self.getActorReference())
HealthBarManager.Show(self.getActorReference())
EndFunction
; local helper functions ---------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -79,8 +79,6 @@ ImageSpaceModifier Property _00E_Phasmalist_ApparitionEnterWorldIMOD Auto
Sound Property _00E_FS_IncreaseArcaneFeverM Auto
_00E_FS_ForgottenStories_Functions Property ForgottenStoriesMiscDialogue Auto
Message Property _00E_Player_sArcaneFeverIncreased Auto
GlobalVariable Property _00E_Phasmalist_IsApparitionSummoned Auto
@ -137,7 +135,7 @@ Function Summon(_00E_Phasmalist_TrinketSC trinket, ObjectReference moveToRef, Bo
akSelf.BlockActivation()
If bPhasmalismTankMode
akSelf.SetAV("Variable01", 1.0)
akSelf.SetActorValue("Variable01", 1.0)
akSelf.EnableAI(False)
Else
If moveToRef == PlayerREF
@ -177,7 +175,7 @@ Function Setup()
SetupBehaviour(akSelf)
SetupNotPersistentStats(akSelf)
Float fAttributeMult = (fPlayerConjSkillMult * PlayerREF.GetAV("Conjuration") + fPlayerEnchSkillMult * PlayerREF.GetAV("Enchanting")) / 100.0 + 1.0
Float fAttributeMult = (fPlayerConjSkillMult * PlayerREF.GetActorValue("Conjuration") + fPlayerEnchSkillMult * PlayerREF.GetActorValue("Enchanting")) / 100.0 + 1.0
ApplyClassBoost(akSelf, BOOST_CLASS_MAGE, _00E_Class_Phasmalist_P05_A_Shamanism_01, _00E_Class_Phasmalist_P05_A_Shamanism_02, _00E_Class_Phasmalist_P05_A_Shamanism_03)
ApplyClassBoost(akSelf, BOOST_CLASS_RANGER, _00E_Class_Phasmalist_P05_B_Mischief_01, _00E_Class_Phasmalist_P05_B_Mischief_02, _00E_Class_Phasmalist_P05_B_Mischief_03)
@ -193,14 +191,14 @@ Function Setup()
If fPlayerStamina > fMaxAttributeValue
fMaxAttributeValue = fPlayerStamina
EndIf
akSelf.ForceAV("Health", ((akSelf.GetBaseAV("Health") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceAV("Magicka", (((akSelf.GetBaseAV("Magicka") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceAV("Stamina", ((akSelf.GetBaseAV("Stamina") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActorValue("Health", ((akSelf.GetBaseAV("Health") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActorValue("Magicka", (((akSelf.GetBaseAV("Magicka") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceActorValue("Stamina", ((akSelf.GetBaseAV("Stamina") + fMaxAttributeValue * fPlayerStatsMult) * fAttributeMult) as int)
Else
akSelf.ForceAV("Health", ((akSelf.GetBaseAV("Health") + PlayerREF.GetBaseAV("Health") * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceAV("Magicka", (((akSelf.GetBaseAV("Magicka") + PlayerREF.GetBaseAV("Magicka") * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceAV("Stamina", ((akSelf.GetBaseAV("Stamina") + PlayerREF.GetBaseAV("Stamina") * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActorValue("Health", ((akSelf.GetBaseAV("Health") + PlayerREF.GetBaseAV("Health") * fPlayerStatsMult) * fAttributeMult) as int)
akSelf.ForceActorValue("Magicka", (((akSelf.GetBaseAV("Magicka") + PlayerREF.GetBaseAV("Magicka") * fPlayerStatsMult) * fAttributeMult) as int) + iCurrentBoostMagicka)
akSelf.ForceActorValue("Stamina", ((akSelf.GetBaseAV("Stamina") + PlayerREF.GetBaseAV("Stamina") * fPlayerStatsMult) * fAttributeMult) as int)
EndIf
EndFunction
@ -211,10 +209,10 @@ Function SetupBehaviour(Actor akSelf)
EndIf
akSelf.SetPlayerTeammate()
akSelf.SetAV("Confidence", 4) ; the apparition should never flee
akSelf.SetAV("Aggression", 0) ; the apparition should not initiate combat (-> stealth playstyle)
akSelf.SetAV("Sneak", 100)
akSelf.SetAV("Invisibility", 1) ; make the apparition undetectable when sneaking (-> stealth playstyle)
akSelf.SetActorValue("Confidence", 4) ; the apparition should never flee
akSelf.SetActorValue("Aggression", 0) ; the apparition should not initiate combat (-> stealth playstyle)
akSelf.SetActorValue("Sneak", 100)
akSelf.SetActorValue("Invisibility", 1) ; make the apparition undetectable when sneaking (-> stealth playstyle)
akSelf.IgnoreFriendlyHits() ; make the apparition ignore friendly fire from the PC
EndFunction
@ -222,19 +220,19 @@ Function SetupNotPersistentStats(Actor akSelf)
akSelf.GetActorBase().SetCombatStyle(SummonTrinket.GetUsedCombatStyle())
If bTeleportHealRate == False
akSelf.SetAV("HealRate", DEFAULT_HEAL_RATE)
akSelf.SetActorValue("HealRate", DEFAULT_HEAL_RATE)
Else
akSelf.SetAV("HealRate", 0.0)
akSelf.SetActorValue("HealRate", 0.0)
EndIf
akSelf.SetAV("MagickaRate", fApparitionManaRate)
akSelf.SetActorValue("MagickaRate", fApparitionManaRate)
;failsafe since setav doesn't work sometimes
If bTeleportHealRate == False
akSelf.ForceAV("HealRate", DEFAULT_HEAL_RATE)
akSelf.ForceActorValue("HealRate", DEFAULT_HEAL_RATE)
Else
akSelf.ForceAV("HealRate", 0.0)
akSelf.ForceActorValue("HealRate", 0.0)
EndIf
akSelf.ForceAV("MagickaRate", fApparitionManaRate)
akSelf.ForceActorValue("MagickaRate", fApparitionManaRate)
EndFunction
Function ApplyClassBoost(Actor akSelf, Int iBoostClass, Perk boostPerk1, Perk boostPerk2, Perk boostPerk3)
@ -262,8 +260,8 @@ Function _AddClassBoost(Actor akSelf, Int iBoostClass, Int iBoostLevel)
iDestructionPowerMod = iGhostlyMageBoostDestructionPowerMod1
iCurrentBoostMagicka = iGhostlyMageBoostMagicka1
EndIf
;akSelf.ForceAV("DestructionPowerMod", akSelf.GetAV("DestructionPowerMod") + iDestructionPowerMod)
akSelf.ModAV("DestructionPowerMod", iDestructionPowerMod)
;akSelf.ForceActorValue("DestructionPowerMod", akSelf.GetActorValue("DestructionPowerMod") + iDestructionPowerMod)
akSelf.ModActorValue("DestructionPowerMod", iDestructionPowerMod)
ElseIf iBoostClass == BOOST_CLASS_RANGER
Int iBoostArchery = 0
Int iBoostCritChance = 0
@ -278,10 +276,10 @@ Function _AddClassBoost(Actor akSelf, Int iBoostClass, Int iBoostLevel)
iBoostCritChance = iGhostlyRangerBoostCritChance1
EndIf
;akSelf.ForceAV("Marksman", akSelf.GetAV("Marksman") + iBoostArchery)
akSelf.ModAV("Marksman", iBoostArchery)
;akSelf.ForceAV("CritChance", akSelf.GetAV("CritChance") + iBoostCritChance)
akSelf.ModAV("CritChance", iBoostCritChance)
;akSelf.ForceActorValue("Marksman", akSelf.GetActorValue("Marksman") + iBoostArchery)
akSelf.ModActorValue("Marksman", iBoostArchery)
;akSelf.ForceActorValue("CritChance", akSelf.GetActorValue("CritChance") + iBoostCritChance)
akSelf.ModActorValue("CritChance", iBoostCritChance)
ElseIf iBoostClass == BOOST_CLASS_WARRIOR
Int iBoostMelee = 0
Int iBoostArmor = 0
@ -296,15 +294,15 @@ Function _AddClassBoost(Actor akSelf, Int iBoostClass, Int iBoostLevel)
iBoostArmor = iGhostlyWarriorBoostArmorSkill1
EndIf
;akSelf.ForceAV("HeavyArmor", akSelf.GetAV("HeavyArmor") + iBoostArmor)
akSelf.ModAV("HeavyArmor", iBoostArmor)
;akSelf.ForceAV("LightArmor", akSelf.GetAV("LightArmor") + iBoostArmor)
akSelf.ModAV("LightArmor", iBoostArmor)
;akSelf.ForceActorValue("HeavyArmor", akSelf.GetActorValue("HeavyArmor") + iBoostArmor)
akSelf.ModActorValue("HeavyArmor", iBoostArmor)
;akSelf.ForceActorValue("LightArmor", akSelf.GetActorValue("LightArmor") + iBoostArmor)
akSelf.ModActorValue("LightArmor", iBoostArmor)
; MeleeDamage AV seems to be not working, it's actually always zero
;akSelf.ForceAV("MeleeDamage", akSelf.GetAV("MeleeDamage") + iBoostMelee)
;akSelf.ModAV("MeleeDamage", iBoostMelee)
akSelf.ModAV("OneHanded", iBoostMelee)
akSelf.ModAV("TwoHanded", iBoostMelee)
;akSelf.ForceActorValue("MeleeDamage", akSelf.GetActorValue("MeleeDamage") + iBoostMelee)
;akSelf.ModActorValue("MeleeDamage", iBoostMelee)
akSelf.ModActorValue("OneHanded", iBoostMelee)
akSelf.ModActorValue("TwoHanded", iBoostMelee)
Else
Debug.Notification("Phasmalist Control Quest has issues: Unsupported boost class " + iBoostClass)
EndIf
@ -318,6 +316,8 @@ Endfunction
Function Unsummon(Bool bSilent)
Actor akSelf = self.GetActorReference()
HealthBarManager.Hide(akSelf)
GoToState("")
AliasFailsafeRef = None
@ -334,11 +334,13 @@ Function Unsummon(Bool bSilent)
akSelf.RemoveAllItems((akSelf.GetActorBase() as _00E_Phasmalist_ApparationSC).inventoryContainer, False, True)
akSelf.Disable()
Self.Clear()
ForgottenStoriesMiscDialogue.hideActorHealthBars(akSelf)
SummonTrinket = None
Utility.wait(1.0)
akSelf.Delete()
SendModEvent("Phasmalist_ApparationUnSummon")
EndFunction
Function AddArcaneFever()
@ -377,10 +379,10 @@ Function AddArcaneFever()
Float fArcaneFeverAdd = fMaxArcaneFeverAdd * fHealthLostPercentage
If fArcaneFeverAdd > 0
PlayerREF.ModAV("LastFlattered", -fArcaneFeverAdd)
PlayerREF.ModActorValue("LastFlattered", -fArcaneFeverAdd)
_00E_ArkanistenfieberIMOD.ApplyCrossFade()
_00E_FS_IncreaseArcaneFeverM.Play(PlayerREF)
_00E_Player_sArcaneFeverIncreased.Show(fArcaneFeverAdd, -1 * PlayerREF.GetAV("LastFlattered"))
_00E_Player_sArcaneFeverIncreased.Show(fArcaneFeverAdd, -1 * PlayerREF.GetActorValue("LastFlattered"))
EndIf
EndFunction
@ -409,7 +411,7 @@ Function TeleportToPlayer(Bool bTeleportInFront, Bool bSilent)
; Zero out-of-combat heal rate for teleport and a few seconds after it.
; This is to prevent the apparition regenerating health IN combat on "Call Apparition" spam.
UnregisterForUpdate()
akSelf.ForceAV("HealRate", 0.0)
akSelf.ForceActorValue("HealRate", 0.0)
bTeleportHealRate = True
akSelf.Disable()
@ -634,7 +636,7 @@ EndFunction
Function _ShowHealthBar()
Actor akSelf = Self.GetActorReference()
If akSelf && akSelf.IsDead() == False
ForgottenStoriesMiscDialogue.showActorHealthBars(akSelf)
HealthBarManager.Show(akSelf)
EndIf
EndFunction
@ -777,7 +779,7 @@ State Working
Event OnUpdate()
If bTeleportHealRate
bTeleportHealRate = False
GetActorReference().ForceAV("HealRate", DEFAULT_HEAL_RATE)
GetActorReference().ForceActorValue("HealRate", DEFAULT_HEAL_RATE)
EndIf
EndEvent

View File

@ -19,6 +19,7 @@ Event OnInit()
Utility.WaitMenuMode(0.1)
EndWhile
CheckForgottenStories()
_00E_Func_CheckDependencies.CheckDependencies()
If fPatchVersion == 0.00
@ -50,6 +51,7 @@ EndEvent
Event OnPlayerLoadGame()
If self == (PlayerREF as ObjectReference) ; A check just in case. Most likely this condition is always True
CheckForgottenStories()
_00E_Func_CheckDependencies.CheckDependencies()
Maintenance()
If GetState() != "RealPlayer" ; Post-1.2.5.0 version update
@ -237,6 +239,16 @@ EndFunction
; MAINTENANCE
;=====================================================================================
function CheckForgottenStories()
; If Enderal - Forgotten Stories.esm is not loaded, kick the player back to main menu
if (Game.GetForm(0x4320E) as GlobalVariable).GetValue() as Int != 1
Utility.wait(2.0)
Game.QuitToMainMenu()
Debug.MessageBox("Enderal - Forgotten Stories.esm is not loaded! The game will not run properly. Open Data Files and enable it.")
return
EndIf
endfunction
Function Maintenance()
if fPatchVersion <= 1.62

View File

@ -899,19 +899,17 @@ Function SetNPCAsCompanion(Actor akActor, bool bCompanion = True, int iCompanion
;Sets an NPC as companion, showing his health bar, making him friendly, unflagging him as ghost. Does the opposite when bCompanion is set to false.
;Additionally sets the AVs Health, Stamina, Magicka for the NPC companion
_00E_FS_ForgottenStories_Functions ForgottenStoriesMiscDialogue = Game.GetFormFromFile(0x01016E89, "Enderal - Forgotten Stories.esm") as _00E_FS_ForgottenStories_Functions
If bCompanion
akActor.SetRelationshipRank(Game.GetPlayer(), 3)
akActor.SetRelationshipRank(Game.GetForm(0x14) as Actor, 3)
akActor.SetGhost(False)
akActor.getActorbase().SetEssential(true) ; just in case, had trouble with FS_NQR05
akActor.SetPlayerTeammate(True)
akActor.IgnoreFriendlyHits()
akActor.SetAV("Health", iCompanionHealth)
akActor.SetAV("Stamina", iCompanionStamina)
akActor.SetAV("Magicka", iCompanionMagicka)
ForgottenStoriesMiscDialogue.showActorHealthBars(akActor)
akActor.SetActorValue("Health", iCompanionHealth)
akActor.SetActorValue("Stamina", iCompanionStamina)
akActor.SetActorValue("Magicka", iCompanionMagicka)
HealthBarManager.Show(akActor)
Else
@ -920,7 +918,7 @@ Function SetNPCAsCompanion(Actor akActor, bool bCompanion = True, int iCompanion
akActor.ResetHealthAndLimbs()
akActor.SetPlayerTeammate(False)
akActor.IgnoreFriendlyHits(False)
ForgottenStoriesMiscDialogue.hideActorHealthBars(akActor)
HealthBarManager.Hide(akActor)
EndIf