Jump to content

[Fix] Questbuttons out of questwindow when multiple images are present


Recommended Posts

  • Honorable Member

Hi, I guess I am spending too much time with @ Mitachi.

If you would like a full explanation:

Spoiler

Well, it's simple, really. Every time you call "[INSERT_IMAGE (..)", due to this part of code

		case EVENT_TYPE_INSERT_IMAGE:
		{
			const std::string & imageFile = GetArgumentString("image_name", ScriptCommand.argList);
			const char * title = GetArgument("title", ScriptCommand.argList);
			const char * desc = GetArgument("desc", ScriptCommand.argList);
			int index = atoi(GetArgument("index", ScriptCommand.argList));
			int total = atoi(GetArgument("total", ScriptCommand.argList));

			if (imageFile.empty())
			{
				const char * imageType = GetArgument("image_type", ScriptCommand.argList);
				int iItemIndex = atoi(GetArgument("idx", ScriptCommand.argList));
				PyCallClassMemberFunc(pEventSet->poEventHandler, "OnInsertItemIcon", Py_BuildValue("(sissii)", imageType, iItemIndex, title, desc, index, total));
			}
			else
			{
				PyCallClassMemberFunc(pEventSet->poEventHandler, "OnInsertImage", Py_BuildValue("(ssssii)", imageFile.c_str(), title, title, desc, index, total));
			}
			pEventSet->iAdjustLine += 2;
			break;
		}

specifically, due to the iAdjustLine call, every time an image is inserted within a questwindow via say_item_vnum or say_item_vnum_inline, the script performs what's equivalent to an "[ENTER]" call.

The problem arises when you use say_item_vnum_inline, which is nothing more than multiple say_item_vnums call.

Fix:

This is the hidden content, please

 

Before and after:

.png.png

 

Edited by Syreldar
Added before & after.
  • Metin2 Dev 45
  • Flame 1
  • Good 3
  • Love 19

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

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.