當前位置: 首頁>>代碼示例>>Python>>正文


Python CharGenCommon.close方法代碼示例

本文整理匯總了Python中CharGenCommon.close方法的典型用法代碼示例。如果您正苦於以下問題:Python CharGenCommon.close方法的具體用法?Python CharGenCommon.close怎麽用?Python CharGenCommon.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CharGenCommon的用法示例。


在下文中一共展示了CharGenCommon.close方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setAccept

# 需要導入模塊: import CharGenCommon [as 別名]
# 或者: from CharGenCommon import close [as 別名]
def setAccept():	
	#set my character up
	MyChar = GemRB.GetVar ("Slot")

	ClassName = GUICommon.GetClassRowName (MyChar)
	
	#reputation
	AllignID = GemRB.GetPlayerStat (MyChar, IE_ALIGNMENT)
	
	TmpTable=GemRB.LoadTable ("repstart")
	t = TmpTable.GetValue (AllignID,0) * 10
	GemRB.SetPlayerStat (MyChar, IE_REPUTATION, t)

	#lore, thac0, hp, and saves
	GemRB.SetPlayerStat (MyChar, IE_MAXHITPOINTS, 0)
	GemRB.SetPlayerStat (MyChar, IE_HITPOINTS, 0)
	LUCommon.SetupSavingThrows (MyChar)
	LUCommon.SetupThaco (MyChar)
	LUCommon.SetupLore (MyChar)
	LUCommon.SetupHP (MyChar)

	#slot 1 is the protagonist
	if MyChar == 1:
		GemRB.GameSetReputation( t )

	#gold
	TmpTable=GemRB.LoadTable ("strtgold")
	t = GemRB.Roll (TmpTable.GetValue (ClassName,"ROLLS"),TmpTable.GetValue(ClassName,"SIDES"), TmpTable.GetValue (ClassName,"MODIFIER") )
	GemRB.SetPlayerStat (MyChar, IE_GOLD, t*TmpTable.GetValue (ClassName,"MULTIPLIER") )

	#set the base number of attacks; effects will add the proficiency bonus
	GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2)

	#colors
	GUICommon.SetColorStat (MyChar, IE_METAL_COLOR, 0x1B )
	GUICommon.SetColorStat (MyChar, IE_LEATHER_COLOR, 0x16 )
	GUICommon.SetColorStat (MyChar, IE_ARMOR_COLOR, 0x17 )

	#does all the rest
	LargePortrait = GemRB.GetToken ("LargePortrait")
	SmallPortrait = GemRB.GetToken ("SmallPortrait")
	GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait)
	#10 is a weapon slot (see slottype.2da row 10)
	GemRB.CreateItem (MyChar, "staf01", 10, 1, 0, 0)
	GemRB.SetEquippedQuickSlot (MyChar, 0)
	#LETS PLAY!!
	playmode = GemRB.GetVar ("PlayMode")
	
	GUICommon.CloseOtherWindow(None)
	
	if playmode >=0:
		CharGenCommon.close()
		if GemRB.GetVar("GUIEnhancements"):
			GemRB.SaveCharacter ( GemRB.GetVar ("Slot"), "gembak" )
		GemRB.EnterGame()
	else:
		#show the export window
		GemRB.SetToken("NextScript","CharGen")
		GemRB.SetNextScript ("ExportFile")
開發者ID:shadowphoenix,項目名稱:gemrb,代碼行數:61,代碼來源:CharGenGui.py

示例2: DonePress

# 需要導入模塊: import CharGenCommon [as 別名]
# 或者: from CharGenCommon import close [as 別名]
def DonePress():
    FileNameEditBox = ExportWindow.GetControl(7)
    FileName = FileNameEditBox.QueryText()
    Slot = GemRB.GetVar("Slot")
    GemRB.SaveCharacter(Slot, FileName)
    GUICommon.CloseOtherWindow(None)
    CharGenCommon.close()
    GemRB.SetNextScript("Start")
    return
開發者ID:a2920074,項目名稱:gemrb,代碼行數:11,代碼來源:ExportFile.py

示例3: DonePress

# 需要導入模塊: import CharGenCommon [as 別名]
# 或者: from CharGenCommon import close [as 別名]
def DonePress ():
	FileNameEditBox = ExportWindow.GetControl (7)
	FileName = FileNameEditBox.QueryText ()
	Slot = GemRB.GetVar ("Slot")
	GemRB.SaveCharacter (Slot, FileName)
	if GameCheck.IsBG1():
		GUICommon.CloseOtherWindow (None)
		CharGenCommon.close()
		GemRB.SetNextScript ("Start")
	else:
		if ExportWindow:
			ExportWindow.Unload ()
		GemRB.SetNextScript (GemRB.GetToken("NextScript"))
	return
開發者ID:ChunHungLiu,項目名稱:gemrb,代碼行數:16,代碼來源:ExportFile.py

示例4: setAccept

# 需要導入模塊: import CharGenCommon [as 別名]
# 或者: from CharGenCommon import close [as 別名]
def setAccept():	
	#set my character up
	MyChar = GemRB.GetVar ("Slot")

	ClassName = GUICommon.GetClassRowName (MyChar)
	
	#reputation
	AllignID = GemRB.GetPlayerStat (MyChar, IE_ALIGNMENT)
	
	TmpTable=GemRB.LoadTable ("repstart")
	t = TmpTable.GetValue (AllignID,0) * 10
	GemRB.SetPlayerStat (MyChar, IE_REPUTATION, t)

	#lore, thac0, hp, and saves
	GemRB.SetPlayerStat (MyChar, IE_MAXHITPOINTS, 0)
	GemRB.SetPlayerStat (MyChar, IE_HITPOINTS, 0)
	LUCommon.SetupSavingThrows (MyChar)
	LUCommon.SetupThaco (MyChar)
	LUCommon.SetupLore (MyChar)
	LUCommon.SetupHP (MyChar)

	#slot 1 is the protagonist
	if MyChar == 1:
		GemRB.GameSetReputation( t )

	#gold
	TmpTable=GemRB.LoadTable ("strtgold")
	t = GemRB.Roll (TmpTable.GetValue (ClassName,"ROLLS"),TmpTable.GetValue(ClassName,"SIDES"), TmpTable.GetValue (ClassName,"MODIFIER") )
	GemRB.SetPlayerStat (MyChar, IE_GOLD, t*TmpTable.GetValue (ClassName,"MULTIPLIER") )

	#set the base number of attacks; effects will add the proficiency bonus
	GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2)

	#colors
	GUICommon.SetColorStat (MyChar, IE_METAL_COLOR, 0x1B )
	GUICommon.SetColorStat (MyChar, IE_LEATHER_COLOR, 0x16 )
	GUICommon.SetColorStat (MyChar, IE_ARMOR_COLOR, 0x17 )

	#does all the rest
	LargePortrait = GemRB.GetToken ("LargePortrait")
	SmallPortrait = GemRB.GetToken ("SmallPortrait")
	GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait)
	#10 is a weapon slot (see slottype.2da row 10)
	GemRB.CreateItem (MyChar, "staf01", 10, 1, 0, 0)
	GemRB.SetEquippedQuickSlot (MyChar, 0)

	# apply class/kit abilities
	IsMulti = GUICommon.IsMultiClassed (MyChar, 1)
	Levels = [GemRB.GetPlayerStat (MyChar, IE_LEVEL), GemRB.GetPlayerStat (MyChar, IE_LEVEL2), \
			GemRB.GetPlayerStat (MyChar, IE_LEVEL3)]
	KitIndex = GUICommon.GetKitIndex (MyChar)
	if IsMulti[0]>1:
		#get the class abilites for each class
		for i in range (IsMulti[0]):
			TmpClassName = GUICommon.GetClassRowName (IsMulti[i+1], "class")
			ABTable = CommonTables.ClassSkills.GetValue (TmpClassName, "ABILITIES")
			if ABTable != "*" and GemRB.HasResource (ABTable, RES_2DA, 1):
				GUICommon.AddClassAbilities (MyChar, ABTable, Levels[i], Levels[i])
	else:
		if KitIndex:
			ABTable = CommonTables.KitList.GetValue (str(KitIndex), "ABILITIES")
		else:
			ABTable = CommonTables.ClassSkills.GetValue (ClassName, "ABILITIES")
		if ABTable != "*" and GemRB.HasResource (ABTable, RES_2DA, 1):
			GUICommon.AddClassAbilities (MyChar, ABTable, Levels[0], Levels[0])

	#LETS PLAY!!
	playmode = GemRB.GetVar ("PlayMode")
	
	GUICommon.CloseOtherWindow(None)
	
	if playmode >=0:
		CharGenCommon.close()
		if GemRB.GetVar("GUIEnhancements"):
			GemRB.SaveCharacter ( GemRB.GetVar ("Slot"), "gembak" )
		GemRB.EnterGame()
	else:
		#show the export window
		GemRB.SetToken("NextScript","CharGen")
		GemRB.SetNextScript ("ExportFile")
開發者ID:BehoIder,項目名稱:gemrb,代碼行數:82,代碼來源:CharGenGui.py


注:本文中的CharGenCommon.close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。