Minor fixes

This commit is contained in:
Mind Rapist
2026-02-19 21:23:26 +02:00
parent 88bc6bfe79
commit 158dff5764
3 changed files with 79 additions and 31 deletions

View File

@@ -80,22 +80,22 @@ class HorseImage(ui.ExpandedImageBox):
FILE_PATH = "d:/ymir work/ui/pattern/HorseState/" FILE_PATH = "d:/ymir work/ui/pattern/HorseState/"
FILE_DICT = { FILE_DICT = {
00 : FILE_PATH+"00.dds", 00 : FILE_PATH + "00.dds",
0o1 : FILE_PATH+"00.dds", 0o1 : FILE_PATH + "00.dds",
0o2 : FILE_PATH+"00.dds", 0o2 : FILE_PATH + "00.dds",
0o3 : FILE_PATH+"00.dds", 0o3 : FILE_PATH + "00.dds",
10 : FILE_PATH+"10.dds", 10 : FILE_PATH + "10.dds",
11 : FILE_PATH+"11.dds", 11 : FILE_PATH + "11.dds",
12 : FILE_PATH+"12.dds", 12 : FILE_PATH + "12.dds",
13 : FILE_PATH+"13.dds", 13 : FILE_PATH + "13.dds",
20 : FILE_PATH+"20.dds", 20 : FILE_PATH + "20.dds",
21 : FILE_PATH+"21.dds", 21 : FILE_PATH + "21.dds",
22 : FILE_PATH+"22.dds", 22 : FILE_PATH + "22.dds",
23 : FILE_PATH+"23.dds", 23 : FILE_PATH + "23.dds",
30 : FILE_PATH+"30.dds", 30 : FILE_PATH + "30.dds",
31 : FILE_PATH+"31.dds", 31 : FILE_PATH + "31.dds",
32 : FILE_PATH+"32.dds", 32 : FILE_PATH + "32.dds",
33 : FILE_PATH+"33.dds", 33 : FILE_PATH + "33.dds",
} }
def __init__(self): def __init__(self):
@@ -115,8 +115,7 @@ class HorseImage(ui.ExpandedImageBox):
#self.textLineList=[] #self.textLineList=[]
self.toolTip.ClearToolTip() self.toolTip.ClearToolTip()
if level>0: if level > 0:
try: try:
grade = self.__GetHorseGrade(level) grade = self.__GetHorseGrade(level)
self.__AppendText(localeInfo.LEVEL_LIST[int(grade)]) self.__AppendText(localeInfo.LEVEL_LIST[int(grade)])
@@ -125,19 +124,19 @@ class HorseImage(ui.ExpandedImageBox):
return return
try: try:
healthName=localeInfo.HEALTH_LIST[health] healthName = localeInfo.HEALTH_LIST[health]
if len(healthName)>0: if len(healthName) > 0:
self.__AppendText(healthName) self.__AppendText(healthName)
except IndexError: except IndexError:
print(("HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery))) print(("HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)))
return return
if health>0: if health > 0:
if battery==0: if battery == 0:
self.__AppendText(localeInfo.NEEFD_REST) self.__AppendText(localeInfo.NEEFD_REST)
try: try:
fileName=self.FILE_DICT[health*10+battery] fileName = self.FILE_DICT[health*10 + battery]
except KeyError: except KeyError:
print(("HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery))) print(("HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery)))
@@ -906,7 +905,7 @@ class AffectShower(ui.Window):
self.lovePointImage.OnUpdateLovePoint(lovePoint) self.lovePointImage.OnUpdateLovePoint(lovePoint)
def SetHorseState(self, level, health, battery): def SetHorseState(self, level, health, battery):
if level==0: if level == 0:
self.horseImage=None self.horseImage=None
else: else:
image = HorseImage() image = HorseImage()
@@ -914,8 +913,11 @@ class AffectShower(ui.Window):
image.SetState(level, health, battery) image.SetState(level, health, battery)
image.Show() image.Show()
self.horseImage=image self.horseImage = image
self.__ArrangeImageList()
# MR-17: Fix icons not re-arranging after horse state changes
self.__ArrangeImageList()
# MR-17: -- END OF -- Fix icons not re-arranging after horse state changes
def SetPlayTime(self, playTime): def SetPlayTime(self, playTime):
self.serverPlayTime = playTime self.serverPlayTime = playTime

View File

@@ -254,13 +254,37 @@ class DragonSoulWindow(ui.ScriptWindow):
self.wndEquip.RefreshSlot() self.wndEquip.RefreshSlot()
# MR-17: Improve slot activation for active Dragon Soul deck
if self.isActivated:
self.ActivateEquipSlotWindow(self.deckPageIndex)
# MR-17: -- END OF -- Improve slot activation for active Dragon Soul deck
# MR-17: Improve slot activation for active Dragon Soul deck
def ActivateEquipSlotWindow(self, deck): def ActivateEquipSlotWindow(self, deck):
for i in range(6): for i in range(6):
if deck == 2: slotNumber = player.DRAGON_SOUL_EQUIPMENT_SLOT_START + deck * player.DRAGON_SOUL_EQUIPMENT_FIRST_SIZE + i
plusCount = 6 itemVnum = player.GetItemIndex(slotNumber)
else:
plusCount = 0 if itemVnum == 0:
self.wndEquip.ActivateSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i + plusCount) continue
item.SelectItem(itemVnum)
remain_time = 999
for j in range(item.LIMIT_MAX_NUM):
(limitType, limitValue) = item.GetLimit(j)
if item.LIMIT_REAL_TIME == limitType:
remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) - app.GetGlobalTimeStamp()
elif item.LIMIT_REAL_TIME_START_FIRST_USE == limitType:
remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0) - app.GetGlobalTimeStamp()
elif item.LIMIT_TIMER_BASED_ON_WEAR == limitType:
remain_time = player.GetItemMetinSocket(player.INVENTORY, slotNumber, 0)
if remain_time <= 0:
break
if remain_time > 0:
self.wndEquip.ActivateSlot(player.DRAGON_SOUL_EQUIPMENT_SLOT_START + i)
# MR-17: -- END OF -- Improve slot activation for active Dragon Soul deck
def DeactivateEquipSlotWindow(self): def DeactivateEquipSlotWindow(self):
for i in range(12): for i in range(12):
@@ -719,6 +743,10 @@ class DragonSoulWindow(ui.ScriptWindow):
if deckIndex is None: if deckIndex is None:
deckIndex = self.deckPageIndex deckIndex = self.deckPageIndex
# MR-17: Improve slot activation for active Dragon Soul deck
was_activated = self.isActivated
# MR-17: -- END OF -- Improve slot activation for active Dragon Soul deck
if not self.isActivated or self.deckPageIndex != deckIndex: if not self.isActivated or self.deckPageIndex != deckIndex:
# MR-12: Improve keyboard shortcut functionality for deck toggling # MR-12: Improve keyboard shortcut functionality for deck toggling
if self.deckPageIndex != deckIndex: if self.deckPageIndex != deckIndex:
@@ -737,7 +765,16 @@ class DragonSoulWindow(ui.ScriptWindow):
self.__WarmDragonSoulTimeCache(deckIndex) self.__WarmDragonSoulTimeCache(deckIndex)
else: else:
self.isActivated = False self.isActivated = False
self.activateButton.SetUp() self.activateButton.SetUp()
# MR-17: Improve slot activation for active Dragon Soul deck
if was_activated:
net.SendChatPacket("/dragon_soul deactivate")
if self.tooltipItem:
self.tooltipItem.ClearDragonSoulTimeCache()
# MR-17: -- END OF -- Improve slot activation for active Dragon Soul deck
# MR-12: -- END OF -- Improve keyboard shortcut functionality for deck toggling # MR-12: -- END OF -- Improve keyboard shortcut functionality for deck toggling
else: else:
net.SendChatPacket("/dragon_soul deactivate") net.SendChatPacket("/dragon_soul deactivate")

View File

@@ -41,6 +41,9 @@ class PasswordDialog(ui.ScriptWindow):
self.passwordValue.OnPressEscapeKey = self.OnCancel self.passwordValue.OnPressEscapeKey = self.OnCancel
self.acceptButton.SetEvent(ui.__mem_func__(self.OnAccept)) self.acceptButton.SetEvent(ui.__mem_func__(self.OnAccept))
self.cancelButton.SetEvent(ui.__mem_func__(self.OnCancel)) self.cancelButton.SetEvent(ui.__mem_func__(self.OnCancel))
# MR-17: Set secret mode for password input
self.passwordValue.SetSecretMode(1)
# MR-17: -- END OF -- Set secret mode for password input
def Destroy(self): def Destroy(self):
self.ClearDictionary() self.ClearDictionary()
@@ -123,6 +126,12 @@ class ChangePasswordDialog(ui.ScriptWindow):
newPassword.OnPressEscapeKey = self.OnCancel newPassword.OnPressEscapeKey = self.OnCancel
newPasswordCheck.OnPressEscapeKey = self.OnCancel newPasswordCheck.OnPressEscapeKey = self.OnCancel
# MR-17: Set secret mode for password input
oldPassword.SetSecretMode(1)
newPassword.SetSecretMode(1)
newPasswordCheck.SetSecretMode(1)
# MR-17: -- END OF -- Set secret mode for password input
self.oldPassword = oldPassword self.oldPassword = oldPassword
self.newPassword = newPassword self.newPassword = newPassword
self.newPasswordCheck = newPasswordCheck self.newPasswordCheck = newPasswordCheck