Jump to content

Bonus highlight


Recommended Posts

Before:174509SUyIAL3.png  After: 174509AN65R5Q.png174509yYFPPGv.png174509Ig126PW.png

 

Version with Tabs: PasteBin or M2Bin

 

uitooltip.py

Find def AppendTextLine(self, text, color = FONT_COLOR, centerAlign = True):

Delete or comment this

        if not self.CanEquip() and self.bCannotUseItemForceSetDisableColor:
            color = self.DISABLE_COLOR

Find def __SetNormalItemTitle(self):

Before add

    def __CheckAntiFlag(self):
        race = player.GetRace()
        job = chr.RaceToJob(race)
        
        if item.IsAntiFlag(self.ANTI_FLAG_DICT[job]):
            return True
        else:
            return False

    def __CheckSex(self):
        sex = chr.RaceToSex(player.GetRace())
        MALE = 1
        FEMALE = 0
        if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE) and sex == MALE:
            return True
        if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE) and sex == MALE:
            return False

Find and replace def __SetNormalItemTitle(self): and def __SetSpecialItemTitle(self): with

    def __SetNormalItemTitle(self):
        if self.__CheckAntiFlag() == True:
            self.AppendTextLine(item.GetItemName(), self.DISABLE_COLOR)
        else:
            if self.__CheckSex() == True:
                self.AppendTextLine(item.GetItemName(), self.DISABLE_COLOR)
            else:
                self.AppendTextLine(item.GetItemName(), self.TITLE_COLOR)
    def __SetSpecialItemTitle(self):
        if self.__CheckAntiFlag() == True:
            self.AppendTextLine(item.GetItemName(), self.DISABLE_COLOR)
        else:
            if self.__CheckSex() == True:
                self.AppendTextLine(item.GetItemName(), self.DISABLE_COLOR)
            else:
                self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)

Find and replace def AppendWearableInformation(self): with

    def AppendWearableInformation(self):
        self.AppendSpace(5)
        if self.__CheckAntiFlag() == True:
            self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.DISABLE_COLOR)
        else:
            self.AppendTextLine(localeInfo.TOOLTIP_ITEM_WEARABLE_JOB, self.NORMAL_COLOR)
        flagList = (
            not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
            not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
            not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
            not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN))
        characterNames = ""
        for i in xrange(self.CHARACTER_COUNT):
            name = self.CHARACTER_NAMES[i]
            flag = flagList[i]
            if flag:
                characterNames += " "
                characterNames += name
        if self.__CheckAntiFlag() == True:
            textLine = self.AppendTextLine(characterNames, self.DISABLE_COLOR, True)
        else:
            textLine = self.AppendTextLine(characterNames, self.NORMAL_COLOR, True)
        textLine.SetFeather()
        race = player.GetRace()
        sex = chr.RaceToSex(race)
        MALE = 1
        FEMALE = 0
        if item.IsAntiFlag(item.ITEM_ANTIFLAG_MALE):
            if sex == MALE:
                textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.DISABLE_COLOR, True)
                textLine.SetFeather()
            else:
                textLine = self.AppendTextLine(localeInfo.FOR_FEMALE, self.NORMAL_COLOR, True)
                textLine.SetFeather()
        if item.IsAntiFlag(item.ITEM_ANTIFLAG_FEMALE):
            if sex == FEMALE:
                textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.DISABLE_COLOR, True)
                textLine.SetFeather()
            else:
                textLine = self.AppendTextLine(localeInfo.FOR_MALE, self.NORMAL_COLOR, True)
                textLine.SetFeather()

 

With help of chatgpt i made better version:
https://metin2.dev/bin/?88b05b46cefa3671#48H1Rhi4NonZkNgLXPUFcBGEDqnnXryNPcGrXBto21ap

 

  • Good 3
  • Love 2
Link to comment
Share on other sites

  • Contributor
43 minutes ago, LikeWeed said:

But.. why? original code is made by me

Speaking to Jxxkub excuse that I've seen this modification too somewhere, but ofc this does not mean you just reposted it. 
This forum have a strict rule about leaks/reposts, and while the rule needed, it evokes this attitude in some people.

Anyway good code, keep it up👍

Edited by TMP4
Link to comment
Share on other sites

  • 1 year later...

Thanks for sharing @marvin

Here the flagList for who want to add also the Lycan and is too lazy 😂

 

flagList = ( not item.IsAntiFlag(item.ITEM_ANTIFLAG_WARRIOR),
				not item.IsAntiFlag(item.ITEM_ANTIFLAG_ASSASSIN),
				not item.IsAntiFlag(item.ITEM_ANTIFLAG_SURA),
				not item.IsAntiFlag(item.ITEM_ANTIFLAG_SHAMAN),
				(not item.IsAntiFlag(item.ITEM_ANTIFLAG_WOLFMAN)
				if app.ENABLE_WOLFMAN_CHARACTER else None)
			)

 

  • Love 1
Link to comment
Share on other sites

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.