Jump to content

Recommended Posts

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 by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 3
  • Sad 1
Link to comment
Share on other sites

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 by Akihiro
Link to comment
Share on other sites

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.