Jump to content

Recommended Posts

  • Active+ Member

Hey guys,

I'm trying to center whole quest window with content inside by extending the say_size function, but the text is overflowing quest window (quest window is not resized after changes mentioned below).

Client/PythonEventManager.cpp:

Spoiler
case EVENT_TYPE_WINDOW_SIZE:
		{
			int iWidth = atoi(GetArgument("width", ScriptCommand.argList));
			int iHeight = atoi(GetArgument("height", ScriptCommand.argList));
			int iXpos = atoi(GetArgument("x", ScriptCommand.argList));
			int iYpos = atoi(GetArgument("y", ScriptCommand.argList));
			PyCallClassMemberFunc(pEventSet->poEventHandler, "OnSize", Py_BuildValue("(iiii)", iWidth, iHeight, iXpos, iYpos));
			break;
		}

 

Server/questlib.lua

Spoiler
function say_size(width, height, x, y) raw_script("[WINDOW_SIZE width;"..width.."|height;"..height.."|x;"..x.."|y;"..y.."]") end

 

Quest function use:

Spoiler
say_size(463, 300, -50, 0)

 

I will be really glad if someone can tell me where should be the mistake and why it's happening.

Thanks for possible answers!

Sincerely,

ReFresh

Edited by ReFresh

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/29186-quest-window-center/
Share on other sites

  • Premium
  • Solution
        case EVENT_TYPE_WINDOW_SIZE:
        {
            int iWidth = atoi(GetArgument("width", ScriptCommand.argList));
            int iHeight = atoi(GetArgument("height", ScriptCommand.argList));
            PyCallClassMemberFunc(pEventSet->poEventHandler, "OnSize", Py_BuildValue("(ii)", iWidth, iHeight));
            break;
        }

 

uiquest.py

    def OnSize(self, width, height):
        self.board.SetSize(width, height)
        self.SetCenterPosition()

 

Passing 2 arguments by default. If you extended it, be careful everywhere!

  • Love 1
Link to comment
https://metin2.dev/topic/29186-quest-window-center/#findComment-149756
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.