voting.py (3684B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\corporation\voting\voting.py 2 import localization 3 MAX_CLOSED_VOTES_FETCHED = 20 4 MAX_OPEN_VOTES = 1000 5 MAX_VOTE_DURATION = 30 6 MAX_VOTE_OPTIONS = 50 7 VOTECASE_STATUS_OPEN = 2 8 VOTECASE_STATUS_CLOSED = 1 9 VOTECASE_STATUS_ALL = 0 10 SANCTIONED_ACTION_STATUS_EXPIRED = 0 11 SANCTIONED_ACTION_STATUS_IN_EFFECT = 1 12 SANCTIONED_ACTION_STATUS_NOT_IN_EFFECT = 2 13 voteCEO = 0 14 voteWar = 1 15 voteShares = 2 16 voteKickMember = 3 17 voteGeneral = 4 18 voteItemLockdown = 5 19 voteItemUnlock = 6 20 voteTypeStrings = {voteCEO: 'New CEO', 21 voteWar: 'Declaration of War', 22 voteShares: 'Creation of shares', 23 voteKickMember: 'Expel member', 24 voteGeneral: 'General vote', 25 voteItemLockdown: 'Lockdown Blueprint', 26 voteItemUnlock: 'Unlock Blueprint'} 27 28 def GetVoteText(vote): 29 voteText = vote.voteCaseText 30 if vote.voteType == voteShares: 31 voteText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/VoteTypeCreateShares') 32 elif vote.voteType == voteWar: 33 voteText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/VoteTypeDeclareWar') 34 elif vote.voteType == voteItemLockdown: 35 voteText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/VoteTypeLockBlueprint') 36 elif vote.voteType == voteItemUnlock: 37 voteText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/VoteTypeUnlockBlueprint') 38 elif vote.voteType == voteKickMember: 39 voteText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/VoteTypeKickMember') 40 elif vote.voteType == voteGeneral: 41 voteText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/VoteTypeGeneral') 42 return voteText 43 44 45 def GetVoteOptionText(option, vote): 46 optionText = option.optionText 47 if vote.voteType == voteShares: 48 if option.optionID == 0: 49 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/CreateShares', shares=option.parameter) 50 else: 51 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/DoNotCreateShares') 52 elif vote.voteType == voteWar: 53 if option.optionID == 0: 54 victimName = cfg.eveowners.Get(option.parameter).name 55 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/DeclareWarAgainst', Name=victimName) 56 else: 57 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/DontDeclareWar') 58 elif vote.voteType == voteItemLockdown: 59 if option.optionID == 0: 60 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/LockdownItem', item=option.parameter1) 61 else: 62 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/DontLockdownItem', item=option.parameter1) 63 elif vote.voteType == voteItemUnlock: 64 if option.optionID == 0: 65 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/UnlockItem', item=option.parameter1) 66 else: 67 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/DontUnlockItem', item=option.parameter1) 68 elif vote.voteType == voteKickMember: 69 if option.optionID == 0: 70 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/ExpelFromCorporation', char=option.parameter) 71 else: 72 optionText = localization.GetByLabel('UI/Corporations/CorporationWindow/Politics/DontExpelCorporationMember') 73 elif vote.voteType == voteGeneral: 74 pass 75 return optionText