forked from metin-server/m2dev-client
py fixes
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import ui
|
||||
import uiScriptLocale
|
||||
import net
|
||||
@@ -18,7 +17,7 @@ import stringCommander
|
||||
import emotion
|
||||
|
||||
####################################
|
||||
# 빠른 실행을 위한 모듈 로딩 분담
|
||||
# 빠른 실행을 위한 모듈 로딩 분담
|
||||
####################################
|
||||
import uiRefine
|
||||
import uiToolTip
|
||||
@@ -163,7 +162,7 @@ class LoadingWindow(ui.ScriptWindow):
|
||||
self.playerX=playerX
|
||||
self.playerY=playerY
|
||||
|
||||
self.__RegisterSkill() ## 로딩 중간에 실행 하면 문제 발생
|
||||
self.__RegisterSkill() ## 로딩 중간에 실행 하면 문제 발생
|
||||
self.__RegisterTitleName()
|
||||
self.__RegisterColor()
|
||||
self.__InitData()
|
||||
@@ -184,7 +183,7 @@ class LoadingWindow(ui.ScriptWindow):
|
||||
self.playerY=playerY
|
||||
|
||||
self.__RegisterDungeonMapName()
|
||||
self.__RegisterSkill() ## 로딩 중간에 실행 하면 문제 발생
|
||||
self.__RegisterSkill() ## 로딩 중간에 실행 하면 문제 발생
|
||||
self.__RegisterTitleName()
|
||||
self.__RegisterColor()
|
||||
self.__RegisterEmotionIcon()
|
||||
@@ -222,7 +221,7 @@ class LoadingWindow(ui.ScriptWindow):
|
||||
self.errMsg.Show()
|
||||
self.loadStepList=[]
|
||||
|
||||
## 이곳에서 syserr.txt 를 보낸다.
|
||||
## 이곳에서 syserr.txt 를 보낸다.
|
||||
|
||||
import dbg
|
||||
dbg.TraceError(" !!! Failed to load game data : STEP [%d]" % (progress))
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import chr
|
||||
import grp
|
||||
import app
|
||||
@@ -17,7 +16,7 @@ import musicInfo
|
||||
import playerSettingModule
|
||||
|
||||
####################################
|
||||
# 빠른 실행을 위한 모듈 로딩 분담
|
||||
# 빠른 실행을 위한 모듈 로딩 분담
|
||||
####################################
|
||||
import uiCommon
|
||||
import uiMapNameShower
|
||||
@@ -27,7 +26,7 @@ import uiCharacter
|
||||
import uiTarget
|
||||
import consoleModule
|
||||
|
||||
# interface module이 문제야...
|
||||
# interface module이 문제야...
|
||||
import interfaceModule
|
||||
import uiTaskBar
|
||||
import uiInventory
|
||||
@@ -744,7 +743,7 @@ class SelectCharacterWindow(ui.Window):
|
||||
if -1 != self.startIndex:
|
||||
|
||||
## Temporary
|
||||
## BackGroundLoading이 지원 될때까지 임시로..
|
||||
## BackGroundLoading이 지원 될때까지 임시로..
|
||||
if app.GetTime() - self.startReservingTime > 3.0:
|
||||
if False == self.openLoadingFlag:
|
||||
chrSlot=self.stream.GetCharacterSlot()
|
||||
@@ -756,7 +755,7 @@ class SelectCharacterWindow(ui.Window):
|
||||
import player
|
||||
player.SetPlayTime(playTime)
|
||||
import chat
|
||||
chat.Clear() ## 들어갈때 Chat 을 초기화. 임시 Pos.
|
||||
chat.Clear() ## 들어갈때 Chat 을 초기화. 임시 Pos.
|
||||
## Temporary
|
||||
#######################################################
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import net
|
||||
import background
|
||||
import stringCommander
|
||||
@@ -45,7 +44,7 @@ class ServerCommandParser(object):
|
||||
def __ItemMall_Open(self):
|
||||
self.__PreserveCommand("item_mall")
|
||||
|
||||
## ÀÓ½Ã
|
||||
## 임시
|
||||
def __XMasBoom_Enable(self, mode):
|
||||
if "1"==mode:
|
||||
self.__PreserveCommand("PRESERVE_DayMode dark")
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import ui
|
||||
import grp
|
||||
import chat
|
||||
@@ -37,7 +36,7 @@ class ChatModeButton(ui.Window):
|
||||
|
||||
def __init__(self):
|
||||
ui.Window.__init__(self)
|
||||
self.state = None
|
||||
self.state = self.BUTTON_STATE_UP
|
||||
self.buttonText = None
|
||||
self.event = None
|
||||
self.SetWindowName("ChatModeButton")
|
||||
@@ -87,7 +86,6 @@ class ChatModeButton(ui.Window):
|
||||
self.event()
|
||||
|
||||
def OnRender(self):
|
||||
|
||||
(x, y) = self.GetGlobalPosition()
|
||||
|
||||
grp.SetColor(self.OUTLINE_COLOR)
|
||||
@@ -604,7 +602,7 @@ class ChatWindow(ui.Window):
|
||||
self.scrollBar = scrollBar
|
||||
|
||||
self.Refresh()
|
||||
self.chatInputSet.RefreshPosition() # RTL 시 위치를 제대로 잡으려면 위치 갱신이 필요하다
|
||||
self.chatInputSet.RefreshPosition() # RTL 시 위치를 제대로 잡으려면 위치 갱신이 필요하다
|
||||
|
||||
def __del__(self):
|
||||
ui.Window.__del__(self)
|
||||
@@ -798,7 +796,7 @@ class ChatWindow(ui.Window):
|
||||
self.Refresh()
|
||||
|
||||
if self.curHeightBar != self.heightBar:
|
||||
self.curHeightBar += (self.heightBar - self.curHeightBar) / 10
|
||||
self.curHeightBar += (self.heightBar - self.curHeightBar) // 10
|
||||
|
||||
if self.boardState == chat.BOARD_STATE_EDIT:
|
||||
grp.SetColor(self.BOARD_MIDDLE_COLOR)
|
||||
@@ -1089,7 +1087,7 @@ class ChatLogWindow(ui.Window):
|
||||
|
||||
self.chatInputSet.SetSize(self.GetWidth() - 20, 20)
|
||||
self.chatInputSet.RefreshPosition()
|
||||
self.chatInputSet.SetChatMax(self.GetWidth() / 8)
|
||||
self.chatInputSet.SetChatMax(self.GetWidth() // 8)
|
||||
|
||||
def OnScroll(self):
|
||||
self.scrollBarPos = self.scrollBar.GetPos()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import ui
|
||||
import snd
|
||||
import systemSetting
|
||||
@@ -9,8 +8,8 @@ import localeInfo
|
||||
import constInfo
|
||||
import chrmgr
|
||||
import player
|
||||
import uiPrivateShopBuilder # <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ
|
||||
import interfaceModule # <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ
|
||||
import uiPrivateShopBuilder # 占쏙옙占쏙옙호
|
||||
import interfaceModule # 占쏙옙占쏙옙호
|
||||
|
||||
blockMode = 0
|
||||
viewChatMode = 0
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import net
|
||||
|
||||
import ui
|
||||
@@ -31,15 +30,15 @@ class PointResetDialog(ui.ScriptWindow):
|
||||
import exception
|
||||
exception.Abort("PointResetDialog.LoadWindow.BindObject")
|
||||
|
||||
self.GetChild("message1").SetText("스탯/스킬 포인트를 초기화해주겠네.")
|
||||
self.GetChild("message2").SetText("가격은 500원이야. 어때, 초기화할텐가?")
|
||||
self.GetChild("message1").SetText("스탯/스킬 포인트를 초기화해주겠네.")
|
||||
self.GetChild("message2").SetText("가격은 500원이야. 어때, 초기화할텐가?")
|
||||
self.GetChild("accept").SetEvent(ui.__mem_func__(self.OpenConfirmDialog))
|
||||
self.GetChild("cancel").SetEvent(ui.__mem_func__(self.Close))
|
||||
|
||||
## Confirm Dialog
|
||||
self.ConfirmText.SetText("현재 레벨의 경험치가 모두 없어진다네.")
|
||||
self.ConfirmText.SetText("현재 레벨의 경험치가 모두 없어진다네.")
|
||||
self.ConfirmText.SetFontColor(1.0, 0.3, 0.3)
|
||||
self.ConfirmText2.SetText("정말 초기화하고 싶은가?")
|
||||
self.ConfirmText2.SetText("정말 초기화하고 싶은가?")
|
||||
self.ConfirmAcceptButton.SetEvent(ui.__mem_func__(self.ResetPoint))
|
||||
self.ConfirmCancelButton.SetEvent(ui.__mem_func__(self.Close))
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class QuestCurtain(ui.Window):
|
||||
|
||||
self.CurtainMode = 0
|
||||
|
||||
self.lastclock = time.clock()
|
||||
self.lastclock = time.perf_counter()
|
||||
|
||||
def Close(self):
|
||||
self.CurtainMode = 0
|
||||
@@ -87,7 +87,7 @@ class QuestCurtain(ui.Window):
|
||||
QuestCurtain.OnDoneEventList = []
|
||||
|
||||
def OnUpdate(self):
|
||||
dt = time.clock() - self.lastclock
|
||||
dt = time.perf_counter() - self.lastclock
|
||||
if self.CurtainMode>0:
|
||||
self.TopBar.SetPosition(0, int(self.TopBar.GetGlobalPosition()[1]+dt*self.CURTAIN_SPEED))
|
||||
self.BottomBar.SetPosition(0, int(self.BottomBar.GetGlobalPosition()[1]-dt*self.CURTAIN_SPEED))
|
||||
@@ -104,7 +104,7 @@ class QuestCurtain(ui.Window):
|
||||
self.BottomBar.SetPosition(0,wndMgr.GetScreenHeight()+1)
|
||||
self.Close()
|
||||
|
||||
self.lastclock = time.clock()
|
||||
self.lastclock = time.perf_counter()
|
||||
|
||||
class EventCurtain(ui.Bar):
|
||||
|
||||
@@ -266,7 +266,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
else:
|
||||
event.SetRestrictedCount(idx,60)
|
||||
|
||||
QuestCurtain.BarHeight = (wndMgr.GetScreenHeight()-wndMgr.GetScreenWidth()*9/16)/2
|
||||
QuestCurtain.BarHeight = (wndMgr.GetScreenHeight()-wndMgr.GetScreenWidth() * 9 // 16) // 2
|
||||
|
||||
if QuestCurtain.BarHeight<0:
|
||||
QuestCurtain.BarHeight = 50
|
||||
@@ -414,9 +414,21 @@ class QuestDialog(ui.ScriptWindow):
|
||||
|
||||
## Set Variables
|
||||
|
||||
def AddOnCloseEvent(self,f):
|
||||
def AddOnCloseEvent(self, f):
|
||||
if self.OnCloseEvent:
|
||||
self.OnCloseEvent = lambda z=[self.OnCloseEvent, f]:list(map(apply,z))
|
||||
old = self.OnCloseEvent
|
||||
|
||||
def combined(*args, **kwargs):
|
||||
err = None
|
||||
try:
|
||||
old(*args, **kwargs)
|
||||
except Exception as e:
|
||||
err = e
|
||||
f(*args, **kwargs)
|
||||
if err:
|
||||
raise err
|
||||
|
||||
self.OnCloseEvent = combined
|
||||
else:
|
||||
self.OnCloseEvent = f
|
||||
|
||||
@@ -446,7 +458,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
b.SetParent(self.board)
|
||||
|
||||
b.SetSize(100,26)
|
||||
b.SetPosition(self.sx+self.board.GetWidth()/2-50,self.sy+yPos)
|
||||
b.SetPosition(self.sx+self.board.GetWidth()//2-50,self.sy+yPos)
|
||||
|
||||
self.nextButtonType = button_type;
|
||||
|
||||
@@ -470,7 +482,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
global entire_questbutton_number
|
||||
global entire_questpage_number
|
||||
global cur_questpage_number
|
||||
entire_questpage_number = ((n-2)/7)+1
|
||||
entire_questpage_number = ((n-2)//7)+1
|
||||
entire_questbutton_number = n
|
||||
|
||||
if not self.board:
|
||||
@@ -480,12 +492,12 @@ class QuestDialog(ui.ScriptWindow):
|
||||
|
||||
import localeInfo
|
||||
self.prevbutton = self.MakeNextPrevPageButton()
|
||||
self.prevbutton.SetPosition(self.sx+self.board.GetWidth()/2-164, self.board.GetHeight()/2-16)
|
||||
self.prevbutton.SetPosition(self.sx+self.board.GetWidth()//2-164, self.board.GetHeight()//2-16)
|
||||
self.prevbutton.SetText(localeInfo.UI_PREVPAGE)
|
||||
self.prevbutton.SetEvent(self.PrevQuestPageEvent, 1, n)
|
||||
|
||||
self.nextbutton = self.MakeNextPrevPageButton()
|
||||
self.nextbutton.SetPosition(self.sx+self.board.GetWidth()/2+112, self.board.GetHeight()/2-16)
|
||||
self.nextbutton.SetPosition(self.sx+self.board.GetWidth()//2+112, self.board.GetHeight()//2-16)
|
||||
self.nextbutton.SetText(localeInfo.UI_NEXTPAGE)
|
||||
self.nextbutton.SetEvent(self.NextQuestPageEvent, 1, n)
|
||||
|
||||
@@ -497,7 +509,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
button = BarButton("TOP_MOST",0x50000000, 0x50404040, 0x50606060)
|
||||
button.SetParent(self.board)
|
||||
button.SetSize(106,26)
|
||||
button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
|
||||
button.SetPosition(self.sx + self.board.GetWidth()//2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
|
||||
button.SetText("a")
|
||||
button.SetTextColor(0xff000000)
|
||||
else:
|
||||
@@ -505,7 +517,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
button = BarButton("TOP_MOST")
|
||||
button.SetParent(self.board)
|
||||
button.SetSize(200,26)
|
||||
button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
|
||||
button.SetPosition(self.sx + self.board.GetWidth()//2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
|
||||
button.SetText("a")
|
||||
button.SetTextColor(0xffffffff)
|
||||
return button
|
||||
@@ -766,7 +778,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
img = ToolTipImageBox()
|
||||
img.SetParent(self.board)
|
||||
img.LoadImage(filename)
|
||||
pos_x = (self.board.GetWidth() * (index + 1) / (total + 1)) - (img.GetWidth() / 2)
|
||||
pos_x = (self.board.GetWidth() * (index + 1) // (total + 1)) - (img.GetWidth() // 2)
|
||||
img.SetPosition(pos_x, y)
|
||||
#img.SetWindowHorizontalAlignCenter()
|
||||
img.DestroyToolTip()
|
||||
@@ -781,7 +793,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
|
||||
if underTitle:
|
||||
event.AddEventSetLocalYPosition(self.descIndex, 3)
|
||||
event.InsertTextInline(self.descIndex, underTitle, (self.board.GetWidth() * (index + 1) / (total + 1)))
|
||||
event.InsertTextInline(self.descIndex, underTitle, (self.board.GetWidth() * (index + 1) // (total + 1)))
|
||||
if index != total - 1:
|
||||
event.AddEventSetLocalYPosition(self.descIndex, -( 3 + 16 ))
|
||||
else:
|
||||
@@ -803,7 +815,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
try:
|
||||
img.SetWindowHorizontalAlignCenter()
|
||||
img.LoadImage(filename)
|
||||
img.SetPosition(0, wndMgr.GetScreenHeight() - (75/2) - (32/2))
|
||||
img.SetPosition(0, wndMgr.GetScreenHeight() - (75//2) - (32//2))
|
||||
img.SetAlpha(0.0)
|
||||
img.Show()
|
||||
except RuntimeError:
|
||||
@@ -830,7 +842,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
try:
|
||||
self.imgLeft.LoadImage(imgfile)
|
||||
self.imgLeft.SetSize(400,450)
|
||||
self.imgLeft.SetOrigin(self.imgLeft.GetWidth()/2,self.imgLeft.GetHeight()/2)
|
||||
self.imgLeft.SetOrigin(self.imgLeft.GetWidth()//2,self.imgLeft.GetHeight()//2)
|
||||
self.imgLeft.Show()
|
||||
except RuntimeError:
|
||||
import dbg
|
||||
@@ -860,7 +872,7 @@ class QuestDialog(ui.ScriptWindow):
|
||||
self.imgTop.SetSize(350,170)
|
||||
bd.SetPosition(bx,190)
|
||||
bd.SetSize(350,250)
|
||||
self.imgTop.SetOrigin(self.imgTop.GetWidth()/2,self.imgTop.GetHeight()/2)
|
||||
self.imgTop.SetOrigin(self.imgTop.GetWidth()//2,self.imgTop.GetHeight()//2)
|
||||
self.imgTop.Show()
|
||||
except RuntimeError:
|
||||
dbg.TraceError("QuestDialog.OnTopImage(%s)" % imgfile)
|
||||
@@ -885,11 +897,11 @@ class QuestDialog(ui.ScriptWindow):
|
||||
ih = 333
|
||||
self.imgBackground.SetSize(iw,ih)
|
||||
if w < iw:
|
||||
px -= (iw-w)/2
|
||||
px -= (iw-w)//2
|
||||
c.SetPosition(px,py)
|
||||
w = iw
|
||||
if h < ih:
|
||||
py -= (ih-h)/2
|
||||
py -= (ih-h)//2
|
||||
c.SetPosition(px,py)
|
||||
h = ih
|
||||
if self.skin == 3:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import net
|
||||
import player
|
||||
import item
|
||||
@@ -275,7 +274,7 @@ class ShopDialog(ui.ScriptWindow):
|
||||
self.pop = None
|
||||
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
|
||||
|
||||
## ¿ëÈ¥¼® ÆÈ¸®´Â ±â´É Ãß°¡.
|
||||
## 용혼석 팔리는 기능 추가.
|
||||
def SellAttachedItem(self):
|
||||
|
||||
if shop.IsPrivateShop():
|
||||
|
||||
@@ -736,11 +736,11 @@ class TaskBar(ui.ScriptWindow):
|
||||
curPoint = max(curPoint, 0)
|
||||
maxPoint = max(maxPoint, 0)
|
||||
|
||||
quarterPoint = maxPoint / 4
|
||||
quarterPoint = maxPoint // 4
|
||||
FullCount = 0
|
||||
|
||||
if 0 != quarterPoint:
|
||||
FullCount = min(4, curPoint / quarterPoint)
|
||||
FullCount = min(4, curPoint // quarterPoint)
|
||||
|
||||
for i in range(4):
|
||||
self.expGauge[i].Hide()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: cp949 -*-
|
||||
import ui
|
||||
import grp
|
||||
import app
|
||||
@@ -321,8 +320,8 @@ if __name__ == "__main__":
|
||||
|
||||
wnd = BigBoard()
|
||||
wnd.Show()
|
||||
wnd.SetTip("안녕하세요")
|
||||
wnd.SetTip("저는 빗자루 입니다")
|
||||
wnd.SetTip("안녕하세요")
|
||||
wnd.SetTip("저는 빗자루 입니다")
|
||||
|
||||
app.Loop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user