Jump to content
Korean Random
Sign in to follow this  
KoSoVsKy2013

Список танков в ангаре

Recommended Posts

Подскажите, пожалуйста, как получить список танков после входа в ангар? 

 

Пробовал вот так,

from gui.Scaleform.daapi.view.lobby.storage.inhangar import StorageCarouselDataProvider

print StorageCarouselDataProvider.sortedCollection

Но вывод показывает

<property object at 0x3A59FB10>

Возможно StorageCarouselDataProvider не инициализирован, но где-то же должен храниться список в реалтайме, а где понять не могу(

Edited by KoSoVsKy2013

Share this post


Link to post

Short link
Share on other sites
from skeletons.gui.shared import IItemsCache
from helpers import dependency

from gui.Scaleform.daapi.view.common.vehicle_carousel.carousel_environment import CarouselEnvironment


class Test:
    _itemsCache = dependency.descriptor(IItemsCache)
    dp = None

    def some(self):
        print(self._itemsCache.items.inventory.getIventoryVehiclesCDs())

        print(self.dp._getCurrentVehicles())

        print(self.dp._vehicles)


t = Test()


@g_overrideLib_main.overrideMethod(CarouselEnvironment, '_populate')
def CarouselEnvironment_populate(base, self):
    print('CarouselEnvironment_populate')
    base(self)
    t.dp = self._carouselDP
*** [3089, 3329, 577, 5201, 113, 1329, 609, 129, 161, 1169, 51489, 23041, 1025, 46097, 769, 16385, 34593]

*** [Vehicle<id:17, intCD:16385, nation:0, lock:(0, 0)>, Vehicle<id:12, intCD:51489, nation:2, lock:(0, 0)>, Vehicle<id:13, intCD:23041, nation:0, lock:(0, 0)>, Vehicle<id:14, intCD:1025, nation:0, lock:(0, 0)>, Vehicle<id:16, intCD:769, nation:0, lock:(0, 0)>]

*** [Vehicle<id:4, intCD:577, nation:4, lock:(0, 0)>, Vehicle<id:15, intCD:46097, nation:1, lock:(0, 0)>, Vehicle<id:6, intCD:113, nation:7, lock:(0, 0)>, Vehicle<id:17, intCD:16385, nation:0, lock:(0, 0)>, Vehicle<id:5, intCD:5201, nation:5, lock:(0, 0)>, Vehicle<id:7, intCD:1329, nation:3, lock:(0, 0)>, Vehicle<id:9, intCD:129, nation:8, lock:(0, 0)>, Vehicle<id:10, intCD:161, nation:10, lock:(0, 0)>, Vehicle<id:11, intCD:1169, nation:9, lock:(0, 0)>, Vehicle<id:2, intCD:3329, nation:0, lock:(0, 0)>, Vehicle<id:12, intCD:51489, nation:2, lock:(0, 0)>, Vehicle<id:1, intCD:3089, nation:1, lock:(0, 0)>, Vehicle<id:13, intCD:23041, nation:0, lock:(0, 0)>, Vehicle<id:14, intCD:1025, nation:0, lock:(0, 0)>, Vehicle<id:8, intCD:609, nation:6, lock:(0, 0)>, Vehicle<id:16, intCD:769, nation:0, lock:(0, 0)>, Vehicle<id:18, intCD:34593, nation:2, lock:(0, 0)>]

_getCurrentVehicles  вернет то что нужно
 

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

@baka01998 Спасибо за ответ, как раз писал, что разобрался, мое решение примерно такое:

from skeletons.gui.shared import IItemsCache

itemsCache = dependency.instance(IItemsCache)

print itemsCache.items.getVehicles(REQ_CRITERIA.INVENTORY)

 

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...