当前位置: 首页>>代码示例>>Python>>正文


Python BugDll.widgetVersion方法代码示例

本文整理汇总了Python中BugDll.widgetVersion方法的典型用法代码示例。如果您正苦于以下问题:Python BugDll.widgetVersion方法的具体用法?Python BugDll.widgetVersion怎么用?Python BugDll.widgetVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BugDll的用法示例。


在下文中一共展示了BugDll.widgetVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Grid_WorstEnemy

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import widgetVersion [as 别名]
	def Grid_WorstEnemy(self, iRow, iLeader):
		pWorstEnemy = PlayerUtil.getWorstEnemy(iLeader, self.iActivePlayer)
		if pWorstEnemy:
			self.iconGrid.addIcon(iRow, self.Col_WEnemy,
									gc.getLeaderHeadInfo(pWorstEnemy.getLeaderType()).getButton(), 45,  
									*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLeader, pWorstEnemy.getID(),
														WidgetTypes.WIDGET_LEADERHEAD, iLeader, pWorstEnemy.getID()))
		else:
			pass
开发者ID:Imperator-Knoedel,项目名称:RFC-Dawn-of-Knoedel,代码行数:11,代码来源:CvBUGMilitaryAdvisor.py

示例2: showSituationReport

# 需要导入模块: import BugDll [as 别名]
# 或者: from BugDll import widgetVersion [as 别名]
	def showSituationReport(self):

		self.timer.start()
		self.deleteAllWidgets()
		screen = self.getScreen()
		
		# get Player arrays
		pVassals = [[]] * gc.getMAX_PLAYERS()
		pDefPacts = [[]] * gc.getMAX_PLAYERS()
		bVassals = False
		bDefPacts = False
		for iLoopPlayer in range(gc.getMAX_PLAYERS()):
			pPlayer = gc.getPlayer(iLoopPlayer)

			if (pPlayer.isAlive()
			and (gc.getTeam(pPlayer.getTeam()).isHasMet(gc.getPlayer(self.iActivePlayer).getTeam())
			or gc.getGame().isDebugMode())
			and iLoopPlayer != self.iActivePlayer
			and not pPlayer.isBarbarian()
			and not pPlayer.isMinorCiv()):
				pVassals[iLoopPlayer] = PlayerUtil.getVassals(iLoopPlayer, self.iActivePlayer)
				pDefPacts[iLoopPlayer] = PlayerUtil.getDefensivePacts(iLoopPlayer, self.iActivePlayer)

				if len(pVassals[iLoopPlayer]) > 0:
					bVassals = True

				if len(pDefPacts[iLoopPlayer]) > 0:
					bDefPacts = True

		bVassals = True
		bDefPacts = True
		self.initIconGrid(screen, bVassals, bDefPacts)
		self.initPower()
		
		activePlayer = gc.getPlayer(self.iActivePlayer)		
		
		# Assemble the panel
		iPANEL_X = 5
		iPANEL_Y = 60
		iPANEL_WIDTH = self.W_SCREEN - 20
		iPANEL_HEIGHT = self.H_SCREEN - 120

		self.tradePanel = self.getNextWidgetName()
		screen.addPanel(self.tradePanel, "", "", True, True, iPANEL_X, iPANEL_Y, iPANEL_WIDTH, iPANEL_HEIGHT, PanelStyles.PANEL_STYLE_MAIN )
		
		self.iconGrid.createGrid()
		self.iconGrid.clearData()

		iRow = 0
		for iLoopPlayer in range(gc.getMAX_PLAYERS()):
			pPlayer = gc.getPlayer(iLoopPlayer)

			if (pPlayer.isAlive()
			and (gc.getTeam(pPlayer.getTeam()).isHasMet(gc.getPlayer(self.iActivePlayer).getTeam())
			or gc.getGame().isDebugMode())
			and iLoopPlayer != self.iActivePlayer
			and not pPlayer.isBarbarian()
			and not pPlayer.isMinorCiv()):


#				szPlayerName = pPlayer.getName() + "/" + pPlayer.getCivilizationShortDescription(0)
#				BugUtil.debug("Grid_ThreatIndex - Start %i %s" % (iLoopPlayer, szPlayerName))
#				BugUtil.debug("Grid_ThreatIndex - Start %i" % (iLoopPlayer))

				self.iconGrid.appendRow(pPlayer.getCivilizationShortDescription(0), "", 3)

				# add leaderhead icon
				self.iconGrid.addIcon(iRow, self.Col_Leader,
										gc.getLeaderHeadInfo(pPlayer.getLeaderType()).getButton(), 64, 
										WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, self.iActivePlayer)

				# add worst enemy
				self.Grid_WorstEnemy(iRow, iLoopPlayer)

				# add current war opponents
				pActiveWars = PlayerUtil.getActiveWars(iLoopPlayer, self.iActivePlayer)
				bCurrentWar = len(pActiveWars) > 0
				for pLoopPlayer in pActiveWars:
					self.iconGrid.addIcon(iRow, self.Col_Curr_Wars, 
											gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32, 
											*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
																WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))

				# show vassals
				if bVassals:
					for pLoopPlayer in pVassals[iLoopPlayer]:
						self.iconGrid.addIcon(iRow, self.Col_Vassals, 
												gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32, 
												*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
																	WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))

				# show defensive pacts
				if bDefPacts:
					for pLoopPlayer in pDefPacts[iLoopPlayer]:
						self.iconGrid.addIcon(iRow, self.Col_DefPacts, 
												gc.getLeaderHeadInfo (pLoopPlayer.getLeaderType()).getButton(), 32, 
												*BugDll.widgetVersion(2, "WIDGET_LEADERHEAD_RELATIONS", iLoopPlayer, pLoopPlayer.getID(),
																	WidgetTypes.WIDGET_LEADERHEAD, iLoopPlayer, pLoopPlayer.getID()))

				# show players that the current player will declare on
#.........这里部分代码省略.........
开发者ID:Imperator-Knoedel,项目名称:RFC-Dawn-of-Knoedel,代码行数:103,代码来源:CvBUGMilitaryAdvisor.py


注:本文中的BugDll.widgetVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。