Jump to content
For maintenance and updates, the community will be offline on 31 December 2022 ×
  • 0

Quest window center


ReFresh

Question

  • Premium
Posted (edited)

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

1 answer to this question

Recommended Posts

  • 1
  • Premium
        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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Activity

    1. 0

      Need Help With Char_Item.cpp

    2. 0

      ULTERIUS2.COM

    3. 7

      Killua - Unholy God Set

    4. 2

      Visual studio 2022 compiling issue

    5. 991

      [40250] Reference Serverfile + Client + Src [15 Available Languages]

  • 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.