ddar 7 Posted May 15, 2021 Share Posted May 15, 2021 (edited) Hi, i added a button to the minimap ( https://metin2.download/picture/Wlz65SA4h8MoBr5cM0qyiRaMkE75fPOi/.png ) and i want it to open the dungeon info window, im beginner and still learning, i was looking on the internet but didn t find a solution.. if u can help me or at least explain a little how to make it open it, i want to learn those things, thank you so much. game.py = https://pastebin.com/P8pXA82V uiminimap.py = https://pastebin.com/jV5HbpMH Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal 3 1 Link to comment Share on other sites More sharing options...
Akihiro 2 Posted May 16, 2021 Share Posted May 16, 2021 (edited) Hello ddar! The commands from system to system are different. Check before implement. Also check the tabs to be sure. In uiminimap.py Spoiler Search for: def __Initialize(self): add below: self.btnDungeonInfo = 0 Search for: def __LoadWindow(self): add below: self.btnDungeonInfo = self.GetChild("DungeonInfo") Search for: self.MiniMapShowButton.SetEvent(ui.__mem_func__(self.ShowMiniMap)) add below: self.btnDungeonInfo.SetEvent(ui.__mem_func__(self.DungeonInfoWindow)) Search for: (ButtonPosX, ButtonPosY) = self.AtlasShowButton.GetGlobalPosition() add below: (ButtonPosX, ButtonPosY) = self.btnDungeonInfo.GetGlobalPosition() self.tooltipDungeonInfo.SetTooltipPosition(ButtonPosX, ButtonPosY) Search for: if TRUE == self.AtlasShowButton.IsIn(): add below: if TRUE == self.btnDungeonInfo.IsIn(): self.tooltipDungeonInfo.Show() else: self.tooltipDungeonInfo.Hide() Search for: def ToggleAtlasWindow(self): add below: def DungeonInfoWindow(self): gameInfo.SYSTEMS_PAKET0 = 1 Search for: self.tooltipAtlasOpen.Show() add below: self.tooltipDungeonInfo = MapTextToolTip() self.tooltipDungeonInfo.SetText(localeInfo.DUNGEON_INFO_OPEN) self.tooltipDungeonInfo.Show() In game.py Spoiler Search for: def OnUpdate(self): add below: if gameInfo.SYSTEMS_PAKET0==1: self.interface.ToggleDungeonInfoWindow() gameInfo.SYSTEMS_PAKET0=0 Search for: END of DRAGON SOUL REFINE WINDOW add below: def DungeonInfo(self, questindex): constInfo.dungeonData["quest_index"] = questindex def CleanDungeonInfo(self): constInfo.dungeonInfo = [] def GetDungeonInfo(self, cmd): cmd = cmd.split("#") if cmd[0] == "INPUT": constInfo.INPUT_IGNORE = int(cmd[1]) elif cmd[0] == "CMD": net.SendQuestInputStringPacket(constInfo.dungeonData["quest_cmd"]) constInfo.dungeonData["quest_cmd"] = "" else: pass def UpdateDungeonInfo(self, type, organization, levelLimit, levelLimitMax, partyMembers, mapName, mapIndex, mapCoordX, mapCoordY, cooldown, duration, entranceMapName, strengthBonusName, itemVnum, npcVnum): type = int(type) organization = int(organization) levelLimit = int(levelLimit) levelLimitMax = int(levelLimitMax) partyMembers = int(partyMembers) mapName = str(mapName).replace("_", " ") mapIndex = int(mapIndex) mapCoordX = int(mapCoordX) mapCoordY = int(mapCoordY) cooldown = int(cooldown) duration = int(duration) entranceMapName = str(entranceMapName).replace("_", " ") strengthBonusName = str(strengthBonusName).replace("_", " ") itemVnum = int(itemVnum) npcVnum = int(npcVnum) constInfo.dungeonInfo.append(\ { "type" : type,\ "organization" : organization,\ "level_limit" : levelLimit,\ "max_level" : levelLimitMax,\ "party_members" : partyMembers,\ "map" : mapName,\ "map_index" : mapIndex,\ "map_coord_x" : mapCoordX,\ "map_coord_y" : mapCoordY,\ "cooldown" : cooldown,\ "duration" : duration,\ "entrance_map" : entranceMapName,\ "strength_bonus" : strengthBonusName,\ "item_vnum" : itemVnum,\ "npc_vnum" : npcVnum, }, ) Search for: npcVnum = int(npcVnum) add below: constInfo.dungeonInfo.append(\ { "type" : type,\ "organization" : organization,\ "level_limit" : levelLimit,\ "max_level" : levelLimitMax,\ "party_members" : partyMembers,\ "map" : mapName,\ "map_index" : mapIndex,\ "map_coord_x" : mapCoordX,\ "map_coord_y" : mapCoordY,\ "cooldown" : cooldown,\ "duration" : duration,\ "entrance_map" : entranceMapName,\ "strength_bonus" : strengthBonusName,\ "item_vnum" : itemVnum,\ "npc_vnum" : npcVnum, }, ) Search for: def __ServerCommand_Build(self): add: "DungeonInfo" : self.DungeonInfo, "CleanDungeonInfo" : self.CleanDungeonInfo, "GetDungeonInfo" : self.GetDungeonInfo, Search for: if app.ENABLE_FISH_EVENT add above: if app.ENABLE_DUNGEON_INFO_SYSTEM: def ToggleDungeonInfoWindow(self): if FALSE == player.IsObserverMode(): if FALSE == self.wndDungeonInfo.IsShow(): self.wndDungeonInfo.Open() else: self.wndDungeonInfo.Close() Edited May 16, 2021 by Akihiro Link to comment Share on other sites More sharing options...
ddar 7 Posted May 18, 2021 Author Share Posted May 18, 2021 On 5/16/2021 at 9:11 PM, Akihiro said: Hello ddar! The commands from system to system are different. Check before implement. Also check the tabs to be sure. In uiminimap.py Hide contents Search for: def __Initialize(self): add below: self.btnDungeonInfo = 0 Search for: def __LoadWindow(self): add below: self.btnDungeonInfo = self.GetChild("DungeonInfo") Search for: self.MiniMapShowButton.SetEvent(ui.__mem_func__(self.ShowMiniMap)) add below: self.btnDungeonInfo.SetEvent(ui.__mem_func__(self.DungeonInfoWindow)) Search for: (ButtonPosX, ButtonPosY) = self.AtlasShowButton.GetGlobalPosition() add below: (ButtonPosX, ButtonPosY) = self.btnDungeonInfo.GetGlobalPosition() self.tooltipDungeonInfo.SetTooltipPosition(ButtonPosX, ButtonPosY) Search for: if TRUE == self.AtlasShowButton.IsIn(): add below: if TRUE == self.btnDungeonInfo.IsIn(): self.tooltipDungeonInfo.Show() else: self.tooltipDungeonInfo.Hide() Search for: def ToggleAtlasWindow(self): add below: def DungeonInfoWindow(self): gameInfo.SYSTEMS_PAKET0 = 1 Search for: self.tooltipAtlasOpen.Show() add below: self.tooltipDungeonInfo = MapTextToolTip() self.tooltipDungeonInfo.SetText(localeInfo.DUNGEON_INFO_OPEN) self.tooltipDungeonInfo.Show() In game.py Hide contents Search for: def OnUpdate(self): add below: if gameInfo.SYSTEMS_PAKET0==1: self.interface.ToggleDungeonInfoWindow() gameInfo.SYSTEMS_PAKET0=0 Search for: END of DRAGON SOUL REFINE WINDOW add below: def DungeonInfo(self, questindex): constInfo.dungeonData["quest_index"] = questindex def CleanDungeonInfo(self): constInfo.dungeonInfo = [] def GetDungeonInfo(self, cmd): cmd = cmd.split("#") if cmd[0] == "INPUT": constInfo.INPUT_IGNORE = int(cmd[1]) elif cmd[0] == "CMD": net.SendQuestInputStringPacket(constInfo.dungeonData["quest_cmd"]) constInfo.dungeonData["quest_cmd"] = "" else: pass def UpdateDungeonInfo(self, type, organization, levelLimit, levelLimitMax, partyMembers, mapName, mapIndex, mapCoordX, mapCoordY, cooldown, duration, entranceMapName, strengthBonusName, itemVnum, npcVnum): type = int(type) organization = int(organization) levelLimit = int(levelLimit) levelLimitMax = int(levelLimitMax) partyMembers = int(partyMembers) mapName = str(mapName).replace("_", " ") mapIndex = int(mapIndex) mapCoordX = int(mapCoordX) mapCoordY = int(mapCoordY) cooldown = int(cooldown) duration = int(duration) entranceMapName = str(entranceMapName).replace("_", " ") strengthBonusName = str(strengthBonusName).replace("_", " ") itemVnum = int(itemVnum) npcVnum = int(npcVnum) constInfo.dungeonInfo.append(\ { "type" : type,\ "organization" : organization,\ "level_limit" : levelLimit,\ "max_level" : levelLimitMax,\ "party_members" : partyMembers,\ "map" : mapName,\ "map_index" : mapIndex,\ "map_coord_x" : mapCoordX,\ "map_coord_y" : mapCoordY,\ "cooldown" : cooldown,\ "duration" : duration,\ "entrance_map" : entranceMapName,\ "strength_bonus" : strengthBonusName,\ "item_vnum" : itemVnum,\ "npc_vnum" : npcVnum, }, ) Search for: npcVnum = int(npcVnum) add below: constInfo.dungeonInfo.append(\ { "type" : type,\ "organization" : organization,\ "level_limit" : levelLimit,\ "max_level" : levelLimitMax,\ "party_members" : partyMembers,\ "map" : mapName,\ "map_index" : mapIndex,\ "map_coord_x" : mapCoordX,\ "map_coord_y" : mapCoordY,\ "cooldown" : cooldown,\ "duration" : duration,\ "entrance_map" : entranceMapName,\ "strength_bonus" : strengthBonusName,\ "item_vnum" : itemVnum,\ "npc_vnum" : npcVnum, }, ) Search for: def __ServerCommand_Build(self): add: "DungeonInfo" : self.DungeonInfo, "CleanDungeonInfo" : self.CleanDungeonInfo, "GetDungeonInfo" : self.GetDungeonInfo, Search for: if app.ENABLE_FISH_EVENT add above: if app.ENABLE_DUNGEON_INFO_SYSTEM: def ToggleDungeonInfoWindow(self): if FALSE == player.IsObserverMode(): if FALSE == self.wndDungeonInfo.IsShow(): self.wndDungeonInfo.Open() else: self.wndDungeonInfo.Close() thank u sir! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now