Jump to content

Quest window center


Go to solution Solved by WeedHex,

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
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
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 113

      Ulthar SF V2 (TMP4 Base)

    2. 2

      Feeding game source to LLM

    3. 0

      Target Information System

    4. 2

      Feeding game source to LLM

    5. 2

      anti exp explanation pls

    6. 2

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.