コード例 #1
0
ファイル: __init__.py プロジェクト: freezingdart/bl-sdk-mods
        def BringWeaponsUpAfterPutDown(caller: unrealsdk.UObject,
                                       function: unrealsdk.UFunction,
                                       params: unrealsdk.FStruct) -> bool:
            if caller.MyWillowPC != unrealsdk.GetEngine().GamePlayers[0].Actor:
                return True

            weapon = caller.MyWillowPawn.InvManager.InventoryChain
            while weapon is not None:
                if weapon.QuickSelectSlot == params.MainHandWeaponSlot:
                    break
                weapon = weapon.Inventory

            # If you dropped the equiped slot default to the start of the list - not sure if other
            #  behaviour might be better?
            if weapon is None:
                weapon = caller.MyWillowPawn.InvManager.InventoryChain
                # If you dropped all weapons just let the game handle it
                if weapon is None:
                    return True

            caller.ForceRefreshSkills()
            caller.ClientBringWeaponsUpAfterPutDown(weapon,
                                                    self.DupeWeapon(weapon))

            return False
コード例 #2
0
        def BringWeaponsUpAfterPutDown(caller: unrealsdk.UObject,
                                       function: unrealsdk.UFunction,
                                       params: unrealsdk.FStruct) -> bool:
            Pawn = unrealsdk.GetEngine().GamePlayers[0].Actor.Pawn

            # There is a function that *should* return this in list form, but it doesn't work properly so,
            #  we have to parse down the linked list instead
            weapon = Pawn.InvManager.InventoryChain
            while weapon is not None:
                if weapon.QuickSelectSlot == params.MainHandWeaponSlot:
                    break
                weapon = weapon.Inventory
            # If you dropped the equiped slot
            if weapon is None:
                weapon = Pawn.InvManager.InventoryChain

            caller.ForceRefreshSkills()
            caller.ClientBringWeaponsUpAfterPutDown(weapon,
                                                    self.DupeWeapon(weapon))

            return False