Added game files from TMP4

This commit is contained in:
2023-07-21 21:55:58 +03:00
parent bb44b31af9
commit eb47a22455
9325 changed files with 276198 additions and 69890 deletions

View File

@ -21,8 +21,8 @@ import chr
import uiScriptLocale
from _weakref import proxy
DISABLE_GUILD_SKILL = FALSE
DISABLE_DECLARE_WAR = FALSE
DISABLE_GUILD_SKILL = False
DISABLE_DECLARE_WAR = False
def NumberToMoneyString(n):
return localeInfo.NumberToMoneyString(n)
@ -484,13 +484,13 @@ class MouseReflector(ui.Window):
self.SetParent(parent)
self.AddFlag("not_pick")
self.width = self.height = 0
self.isDown = FALSE
self.isDown = False
def Down(self):
self.isDown = TRUE
self.isDown = True
def Up(self):
self.isDown = FALSE
self.isDown = False
def OnRender(self):
@ -512,7 +512,7 @@ class EditableTextSlot(ui.ImageBox):
self.mouseReflector = MouseReflector(self)
self.mouseReflector.SetSize(self.GetWidth(), self.GetHeight())
self.Enable = TRUE
self.Enable = True
self.textLine = ui.MakeTextLine(self)
self.event = lambda *arg: None
self.arg = 0
@ -531,7 +531,7 @@ class EditableTextSlot(ui.ImageBox):
self.arg = arg
def Disable(self):
self.Enable = FALSE
self.Enable = False
def OnMouseOverIn(self):
if not self.Enable:
@ -569,7 +569,7 @@ class CheckBox(ui.ImageBox):
image.SetWindowHorizontalAlignCenter()
image.SetWindowVerticalAlignCenter()
image.Hide()
self.Enable = TRUE
self.Enable = True
self.image = image
self.event = event
self.Show()
@ -586,7 +586,7 @@ class CheckBox(ui.ImageBox):
self.image.Hide()
def Disable(self):
self.Enable = FALSE
self.Enable = False
def OnMouseOverIn(self):
if not self.Enable:
@ -622,7 +622,7 @@ class ChangeGradeNameDialog(ui.ScriptWindow):
def Close(self):
self.gradeNameSlot.KillFocus()
self.Hide()
return TRUE
return True
def SetGradeNumber(self, gradeNumber):
self.gradeNumber = gradeNumber
@ -633,7 +633,7 @@ class ChangeGradeNameDialog(ui.ScriptWindow):
def OnPressEscapeKey(self):
self.Close()
return TRUE
return True
class CommentSlot(ui.Window):
@ -647,8 +647,13 @@ class CommentSlot(ui.Window):
self.slotSimpleText = ui.MakeTextLine(self)
self.slotSimpleText.SetPosition(2, 0)
self.slotSimpleText.SetWindowHorizontalAlignLeft()
self.slotSimpleText.SetHorizontalAlignLeft()
## 13.12.02 <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
if localeInfo.IsARABIC() :
self.slotSimpleText.SetWindowHorizontalAlignCenter()
self.slotSimpleText.SetHorizontalAlignCenter()
else :
self.slotSimpleText.SetWindowHorizontalAlignLeft()
self.slotSimpleText.SetHorizontalAlignLeft()
self.bar = ui.SlotBar()
self.bar.SetParent(self)
@ -1036,8 +1041,11 @@ class GuildWindow(ui.ScriptWindow):
page.Children.append(noticeMarkImage)
## Name
## 13.12.02 <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
if localeInfo.IsJAPAN():
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 9, yPos)
elif localeInfo.IsARABIC():
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 255, yPos)
else:
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 15, yPos)
nameSlot = ui.MakeTextLine(nameSlotImage)
@ -1045,14 +1053,21 @@ class GuildWindow(ui.ScriptWindow):
page.Children.append(nameSlot)
## Delete Button
deleteButton = ui.MakeButton(page, 340, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub")
if localeInfo.IsARABIC():
deleteButton = ui.MakeButton(page, 3, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub")
else:
deleteButton = ui.MakeButton(page, 340, yPos + 3, localeInfo.GUILD_DELETE, "d:/ymir work/ui/public/", "close_button_01.sub", "close_button_02.sub", "close_button_03.sub")
deleteButton.SetEvent(ui.__mem_func__(self.OnDeleteComment), i)
page.Children.append(deleteButton)
## Comment
## 13.12.02 <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
commentSlot = CommentSlot()
commentSlot.SetParent(page)
commentSlot.SetPosition(114, yPos)
if localeInfo.IsARABIC():
commentSlot.SetPosition(25, yPos)
else:
commentSlot.SetPosition(114, yPos)
commentSlot.Show()
page.Children.append(commentSlot)
@ -1063,7 +1078,11 @@ class GuildWindow(ui.ScriptWindow):
page.boardDict[i] = boardSlotList
## PostComment - Have to make this here for that fit tooltip's position.
postCommentButton = ui.MakeButton(page, 337, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub")
## 13.12.02 <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
if localeInfo.IsARABIC():
postCommentButton = ui.MakeButton(page, 3, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub")
else:
postCommentButton = ui.MakeButton(page, 337, 273, localeInfo.GUILD_COMMENT, "d:/ymir work/ui/game/taskbar/", "Send_Chat_Button_01.sub", "Send_Chat_Button_02.sub", "Send_Chat_Button_03.sub")
postCommentButton.SetEvent(ui.__mem_func__(self.OnPostComment))
page.Children.append(postCommentButton)
@ -1078,10 +1097,12 @@ class GuildWindow(ui.ScriptWindow):
inverseLineIndex = self.MEMBER_LINE_COUNT - i - 1
yPos = 28 + inverseLineIndex*lineStep
## 13.12.02 <20>ƶ<EFBFBD> <20><><EFBFBD><EFBFBD>
## Name
if localeInfo.IsJAPAN():
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 15, yPos)
elif localeInfo.IsARABIC():
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_100x18.sub", 255, yPos)
else:
nameSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_03.sub", 10, yPos)
nameSlot = ui.MakeTextLine(nameSlotImage)
@ -1093,6 +1114,8 @@ class GuildWindow(ui.ScriptWindow):
gradeSlot.SetParent(page)
if localeInfo.IsJAPAN():
gradeSlot.SetPosition(117, yPos-1)
elif localeInfo.IsARABIC():
gradeSlot.SetPosition(192, yPos-1)
else:
gradeSlot.SetPosition(101, yPos-1)
gradeSlot.SetSize(61, 18)
@ -1103,6 +1126,8 @@ class GuildWindow(ui.ScriptWindow):
## Job
if localeInfo.IsJAPAN():
jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 181, yPos)
elif localeInfo.IsARABIC():
jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 145, yPos)
else:
jobSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 170, yPos)
jobSlot = ui.MakeTextLine(jobSlotImage)
@ -1112,6 +1137,8 @@ class GuildWindow(ui.ScriptWindow):
## Level
if localeInfo.IsJAPAN():
levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 221, yPos)
elif localeInfo.IsARABIC():
levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 106, yPos)
else:
levelSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 210, yPos)
levelSlot = ui.MakeTextLine(levelSlotImage)
@ -1121,6 +1148,8 @@ class GuildWindow(ui.ScriptWindow):
## Offer
if localeInfo.IsJAPAN():
offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 261, yPos)
elif localeInfo.IsARABIC():
offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 66, yPos)
else:
offerSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 250, yPos)
offerSlot = ui.MakeTextLine(offerSlotImage)
@ -1131,6 +1160,8 @@ class GuildWindow(ui.ScriptWindow):
event = lambda argSelf=proxy(self), argIndex=inverseLineIndex: apply(argSelf.OnEnableGeneral, (argIndex,))
if localeInfo.IsJAPAN():
generalEnableCheckBox = CheckBox(page, 307, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
elif localeInfo.IsARABIC():
generalEnableCheckBox = CheckBox(page, 22, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
else:
generalEnableCheckBox = CheckBox(page, 297, yPos, event, "d:/ymir work/ui/public/Parameter_Slot_00.sub")
page.Children.append(generalEnableCheckBox)
@ -1250,37 +1281,55 @@ class GuildWindow(ui.ScriptWindow):
yPos = 22 + i*lineStep
index = i+1
## 13.12.02 <20>ƶ<EFBFBD> <20><><EFBFBD><EFBFBD>
## GradeNumber
gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 14, yPos)
if localeInfo.IsARABIC():
gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 310, yPos)
else:
gradeNumberSlotImage = ui.MakeImageBox(page, "d:/ymir work/ui/public/Parameter_Slot_00.sub", 14, yPos)
gradeNumberSlot = ui.MakeTextLine(gradeNumberSlotImage)
gradeNumberSlot.SetText(str(i+1))
page.Children.append(gradeNumberSlotImage)
page.Children.append(gradeNumberSlot)
## GradeName
gradeNameSlot = EditableTextSlot(page, 58, yPos)
if localeInfo.IsARABIC():
gradeNameSlot = EditableTextSlot(page, 242, yPos)
else:
gradeNameSlot = EditableTextSlot(page, 58, yPos)
gradeNameSlot.SetEvent(ui.__mem_func__(self.OnOpenChangeGradeName), index)
page.Children.append(gradeNameSlot)
## Invite Authority
event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<0: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
inviteAuthorityCheckBox = CheckBox(page, 124, yPos, event)
if localeInfo.IsARABIC():
inviteAuthorityCheckBox = CheckBox(page, 185, yPos, event)
else:
inviteAuthorityCheckBox = CheckBox(page, 124, yPos, event)
page.Children.append(inviteAuthorityCheckBox)
## DriveOut Authority
event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<1: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
driveoutAuthorityCheckBox = CheckBox(page, 181, yPos, event)
if localeInfo.IsARABIC():
driveoutAuthorityCheckBox = CheckBox(page, 128, yPos, event)
else:
driveoutAuthorityCheckBox = CheckBox(page, 181, yPos, event)
page.Children.append(driveoutAuthorityCheckBox)
## Notice Authority
event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<2: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
noticeAuthorityCheckBox = CheckBox(page, 238, yPos, event)
if localeInfo.IsARABIC():
noticeAuthorityCheckBox = CheckBox(page, 71, yPos, event)
else:
noticeAuthorityCheckBox = CheckBox(page, 238, yPos, event)
page.Children.append(noticeAuthorityCheckBox)
## Skill Authority
event = lambda argSelf=proxy(self), argIndex=index, argAuthority=1<<3: apply(argSelf.OnCheckAuthority, (argIndex,argAuthority))
skillAuthorityCheckBox = CheckBox(page, 295, yPos, event)
if localeInfo.IsARABIC():
skillAuthorityCheckBox = CheckBox(page, 14, yPos, event)
else:
skillAuthorityCheckBox = CheckBox(page, 295, yPos, event)
page.Children.append(skillAuthorityCheckBox)
gradeSlotList = []
@ -1305,6 +1354,9 @@ class GuildWindow(ui.ScriptWindow):
guildID = net.GetGuildID()
self.largeMarkBox.SetIndex(guildID)
self.largeMarkBox.SetScale(3)
## 13.12.02 <20>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
if localeInfo.IsARABIC():
self.largeMarkBox.SetPosition(self.largeMarkBox.GetWidth()+32,1)
def Close(self):
self.__CloseAllGuildMemberPageGradeComboBox()
@ -1533,7 +1585,7 @@ class GuildWindow(ui.ScriptWindow):
slotList[2].SetText("")
slotList[3].SetText("")
slotList[4].SetText("")
slotList[5].SetCheck(FALSE)
slotList[5].SetCheck(False)
continue
pid, name, grade, race, level, offer, general = self.GetMemberData(line)
@ -1745,11 +1797,11 @@ class GuildWindow(ui.ScriptWindow):
text = self.commentSlot.GetText()
if not text:
return FALSE
return False
net.SendGuildPostCommentPacket(text[:50])
self.commentSlot.SetText("")
return TRUE
return True
def OnDeleteComment(self, index):
@ -1762,7 +1814,7 @@ class GuildWindow(ui.ScriptWindow):
def OnKeyDownInBoardPage(self, key):
if key == 63:
self.OnRefreshComments()
return TRUE
return True
## Member
## OnEnableGeneral
@ -1794,7 +1846,7 @@ class GuildWindow(ui.ScriptWindow):
gradeName = localeInfo.GUILD_DEFAULT_GRADE
net.SendGuildChangeGradeNamePacket(gradeNumber, gradeName)
return TRUE
return True
def OnCheckAuthority(self, argIndex, argAuthority):
name, authority = guild.GetGradeData(argIndex)
@ -1858,7 +1910,7 @@ class GuildWindow(ui.ScriptWindow):
mouseController = mouseModule.mouseController
if FALSE == mouseController.isAttached():
if False == mouseController.isAttached():
skillIndex = player.GetSkillIndex(skillSlotIndex)
skillLevel = guild.GetSkillLevel(skillSlotIndex)
@ -1944,7 +1996,7 @@ class GuildWindow(ui.ScriptWindow):
def OnPressEscapeKey(self):
self.Close()
return TRUE
return True
class BuildGuildBuildingWindow(ui.ScriptWindow):
@ -2361,42 +2413,42 @@ class BuildGuildBuildingWindow(ui.ScriptWindow):
def __IsEnoughMoney(self):
if app.IsEnableTestServerFlag():
return TRUE
return True
curMoney = player.GetMoney()
if curMoney < self.needMoney:
return FALSE
return TRUE
return False
return True
def __IsEnoughMaterialStone(self):
if app.IsEnableTestServerFlag():
return TRUE
return True
curStoneCount = player.GetItemCountByVnum(MATERIAL_STONE_ID)
if curStoneCount < self.needStoneCount:
return FALSE
return TRUE
return False
return True
def __IsEnoughMaterialLog(self):
if app.IsEnableTestServerFlag():
return TRUE
return True
curLogCount = player.GetItemCountByVnum(MATERIAL_LOG_ID)
if curLogCount < self.needLogCount:
return FALSE
return TRUE
return False
return True
def __IsEnoughMaterialPlywood(self):
if app.IsEnableTestServerFlag():
return TRUE
return True
curPlywoodCount = player.GetItemCountByVnum(MATERIAL_PLYWOOD_ID)
if curPlywoodCount < self.needPlywoodCount:
return FALSE
return TRUE
return False
return True
def __OnSelectCategory(self):
self.listScrollBar.SetPos(0.0)
@ -2565,17 +2617,17 @@ class BuildGuildBuildingWindow(ui.ScriptWindow):
def IsPositioningMode(self):
if self.MODE_POSITIONING == self.mode:
return TRUE
return FALSE
return True
return False
def IsPreviewMode(self):
if self.MODE_PREVIEW == self.mode:
return TRUE
return FALSE
return True
return False
def OnPressEscapeKey(self):
self.Close()
return TRUE
return True
"""
- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@ -2628,10 +2680,10 @@ if __name__ == "__main__":
import grp
import ui
#wndMgr.SetOutlineFlag(TRUE)
#wndMgr.SetOutlineFlag(True)
app.SetMouseHandler(mouseModule.mouseController)
app.SetHairColorEnable(TRUE)
app.SetHairColorEnable(True)
wndMgr.SetMouseHandler(mouseModule.mouseController)
wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
@ -2681,11 +2733,11 @@ if __name__ == "__main__":
if len(tokens) < LIMIT_TOKEN_COUNT:
import dbg
dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), TOKEN_COUNT, line))
dbg.TraceError("Strange token count [%d/%d] [%s]" % (len(tokens), LIMIT_TOKEN_COUNT, line))
continue
ENABLE_FLAG_TYPE_NOT_USE = FALSE
ENABLE_FLAG_TYPE_USE = TRUE
ENABLE_FLAG_TYPE_NOT_USE = False
ENABLE_FLAG_TYPE_USE = True
ENABLE_FLAG_TYPE_USE_BUT_HIDE = 2
if ENABLE_FLAG_TYPE_NOT_USE == int(tokens[TOKEN_ENABLE_FLAG]):
@ -2742,10 +2794,10 @@ if __name__ == "__main__":
"Z_ROT_LIMIT":zRotLimit,
"PRICE":price,
"MATERIAL":materialList,
"SHOW" : TRUE }
"SHOW" : True }
if ENABLE_FLAG_TYPE_USE_BUT_HIDE == int(tokens[TOKEN_ENABLE_FLAG]):
appendingData["SHOW"] = FALSE
appendingData["SHOW"] = False
BUILDING_DATA_LIST.append(appendingData)
@ -2800,7 +2852,7 @@ if __name__ == "__main__":
def OnKeyUp(self, key):
if key in self.onClickKeyDict:
self.onClickKeyDict[key]()
return TRUE
return True
def OnMouseLeftButtonDown(self):
if self.wndGuildBuilding:
@ -2809,22 +2861,22 @@ if __name__ == "__main__":
return
player.SetMouseState(player.MBT_LEFT, player.MBS_PRESS);
return TRUE
return True
def OnMouseLeftButtonUp(self):
if self.wndGuildBuilding:
return
player.SetMouseState(player.MBT_LEFT, player.MBS_CLICK)
return TRUE
return True
def OnMouseRightButtonDown(self):
player.SetMouseState(player.MBT_RIGHT, player.MBS_PRESS);
return TRUE
return True
def OnMouseRightButtonUp(self):
player.SetMouseState(player.MBT_RIGHT, player.MBS_CLICK);
return TRUE
return True
def OnMouseMiddleButtonDown(self):
player.SetMouseMiddleButtonState(player.MBS_PRESS)