NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

qa.py (1592B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\assetholding\client\qa.py
      2 import blue
      3 
      4 def get_entitlement_qa_menu_entries(asset_ids, goal_id, is_daily_goal = False):
      5     menu_entries = (('QA - Expire Entitlement', lambda : _request_expire_entitlement(asset_ids, goal_id, is_daily_goal)), ('QA - Copy Goal ID {goal_id}'.format(goal_id=goal_id), lambda : blue.pyos.SetClipboardData(str(goal_id))))
      6     return menu_entries
      7 
      8 
      9 def _request_expire_entitlement(asset_ids, goal_id, is_daily_goal):
     10     if is_daily_goal:
     11         return
     12     group_name = 'eve-organization-goals'
     13     for asset_id in asset_ids:
     14         command = '/assetholding expire {asset_id} {external_id} {group_name}'.format(asset_id=asset_id, external_id=goal_id, group_name=group_name)
     15         sm.RemoteSvc('slash').SlashCmd(command)
     16 
     17 
     18 def get_insider_qa_menu():
     19     return ('Asset Holding', [get_toggle_entry('Bypass validation when consuming items', sm.GetService('assetHoldingSvc').toggle_item_validation, not sm.GetService('assetHoldingSvc').is_item_validation_enabled), get_toggle_entry('Simulate failures in hold and spawn', sm.GetService('assetHoldingSvc').toggle_item_failure, sm.GetService('assetHoldingSvc').is_item_failure_enabled)])
     20 
     21 
     22 def get_toggle_entry(label, callback, enabled):
     23     texture = {True: 'res:/UI/Texture/classes/insider/toggle_on_18.png',
     24      False: 'res:/UI/Texture/classes/insider/toggle_off_18.png'}[enabled]
     25     return ('{} ({})'.format(label, '<color=green>on</color>' if enabled else '<color=red>off</color>'),
     26      callback,
     27      (),
     28      (texture, 18))