bit more work on vendors

This commit is contained in:
Light2
2014-05-21 19:02:12 +02:00
parent fea0ddbe75
commit 4e8a9ae47c
3 changed files with 40 additions and 2 deletions
+2
View File
@@ -158,6 +158,8 @@ def handleVendorName(actor, window, eventType, returnList):
actor.setAttachment('selectedVendorTemplate', None)
vendor.setAttachment('isVendor', True)
vendor.setAttachment('onMap', True)
vendor.setAttachment('maintenanceAmount', 0)
vendor.setAttachment('vendorOwner', actor.getObjectID())
vendor.setAttachment('initialized', False)
vendor.setAttachment('vendorSearchEnabled', False)
+14 -1
View File
@@ -13,7 +13,7 @@ def createRadial(core, owner, target, radials):
radials.add(RadialOptions(3, 53, 1, ''))
radials.add(RadialOptions(3, 54, 1, ''))
if not owner.getPlayerObject().getOwnedVendors().contains(target.getObjectID())
if not owner.getPlayerObject().getOwnedVendors().contains(target.getObjectID()):
return
radials.add(RadialOptions(0, 112, 3, '@player_structure:vendor_control'))
if target.getAttachment('initialized') == False:
@@ -35,5 +35,18 @@ def createRadial(core, owner, target, radials):
return
def handleSelection(core, owner, target, option):
if not owner.getPlayerObject().getOwnedVendors().contains(target.getObjectID()):
return
if target.getAttachment('initialized') == False:
if option == 118:
owner.sendSystemMessage('@player_structure:vendor_initialized', 0)
vendor.setAttachment('initialized', True)
core.bazaarService.startVendorUpdateTask(owner, target)
else:
return