Jump to content

Official Quest Width Expansion


Recommended Posts

  • Honorable Member

Because why not...
Only a few changes are necessary, and the input width has remained unchanged.

 

Preview of the Quest Width Expansion
 

Guide

Client

Spoiler

Client
root/uiQuest.py

Spoiler
''' 1. '''
# Search @ def MakeNextButton
		b.SetSize(100, 26)
		b.SetPosition(self.sx + self.board.GetWidth() / 2 - 50, self.sy + yPos)

# Replace with
		if app.ENABLE_QUEST_WIDTH_EXPANSION:
			b.SetSize(280, 26)
			b.SetPosition(self.sx + self.board.GetWidth() / 2 - 140, self.sy + yPos)
		else:
			b.SetSize(100, 26)
			b.SetPosition(self.sx + self.board.GetWidth() / 2 - 50, self.sy + yPos)

''' 2. '''
# Search @ def MakeQuestion
		self.prevbutton.SetPosition(self.sx + self.board.GetWidth() / 2 - 164, self.sy + (event.GetLineCount(self.descIndex) + questbutton_max - 1) * 16 + 20 + 5)

# Replace with
		if app.ENABLE_QUEST_WIDTH_EXPANSION:
			self.prevbutton.SetPosition(self.sx + self.board.GetWidth() / 2 - 340, self.sy + (event.GetLineCount(self.descIndex) + questbutton_max - 1) * 16 + 20 + 5)
		else:
			self.prevbutton.SetPosition(self.sx + self.board.GetWidth() / 2 - 164, self.sy + (event.GetLineCount(self.descIndex) + questbutton_max - 1) * 16 + 20 + 5)

''' 3. '''
# Search @ def MakeQuestion
		self.nextbutton.SetPosition(self.sx + self.board.GetWidth() / 2 + 112, self.sy + (event.GetLineCount(self.descIndex) + questbutton_max - 1) * 16 + 20 + 5)

# Replace with
		if app.ENABLE_QUEST_WIDTH_EXPANSION:
			self.nextbutton.SetPosition(self.sx + self.board.GetWidth() / 2 + 288, self.sy + (event.GetLineCount(self.descIndex) + questbutton_max - 1) * 16 + 20 + 5)
		else:
			self.nextbutton.SetPosition(self.sx + self.board.GetWidth() / 2 + 112, self.sy + (event.GetLineCount(self.descIndex) + questbutton_max - 1) * 16 + 20 + 5)

''' 4. '''
# Search @ def MakeEachButton
			button.SetSize(200, 26)
			button.SetPosition(self.sx + self.board.GetWidth() / 2 - 100, self.sy + (event.GetLineCount(self.descIndex) + i * 2) * 16 + 20 + 5)

# Replace with
			if app.ENABLE_QUEST_WIDTH_EXPANSION:
				button.SetSize(560, 26)
				button.SetPosition(self.sx + self.board.GetWidth() / 2 - 280, self.sy + (event.GetLineCount(self.descIndex) + i * 2) * 16 + 20 + 5)
			else:
				button.SetSize(200, 26)
				button.SetPosition(self.sx + self.board.GetWidth() / 2 - 100, self.sy + (event.GetLineCount(self.descIndex) + i * 2) * 16 + 20 + 5)

 

Client
UIScript/QuestDialog.py

Spoiler
import app

ROOT = "d:/ymir work/ui/public/"

if app.ENABLE_QUEST_WIDTH_EXPANSION:
	QUEST_BOARD_WIDTH_ADJUSTMENT_VALUE = 2 ## 퀘스트 보드 폭 조정 값

window = {
	"name" : "QuestDialog",
	"style" : ("float",),

	"x" : 0,
	"y" : 0,

	"width" : 800,
	"height" : 450,

	"children" :
	(
		{
			"name" : "board",
			"type" : "thinboard",
			"style" : ("attach", "ignore_size",),

			"x" : 0,
			"y" : 0,

			"horizontal_align" : "center",
			"vertical_align" : "center",

			"width" : 350,
			"height" : 300,
		},
	),
}

if app.ENABLE_QUEST_WIDTH_EXPANSION:
	window["children"][0]["width"] = window["children"][0]["width"] * QUEST_BOARD_WIDTH_ADJUSTMENT_VALUE

 

 

Srcs

Spoiler

Client
UserInterface/Locale_inc.h

/// 1.
// Add anywhere
#define ENABLE_QUEST_WIDTH_EXPANSION

Client
UserInterface/PythonApplicationModule.cpp

/// Search
	PyModule_AddIntConstant(poModule, "CAMERA_STOP", CPythonApplication::CAMERA_STOP);

// Add below
#if defined(ENABLE_QUEST_WIDTH_EXPANSION)
	PyModule_AddIntConstant(poModule, "ENABLE_QUEST_WIDTH_EXPANSION", 1);
#else
	PyModule_AddIntConstant(poModule, "ENABLE_QUEST_WIDTH_EXPANSION", 0);
#endif

 

Edited by Owsap
Added Preview of the Quest Width Expansion
  • Metin2 Dev 43
  • kekw 1
  • Good 9
  • muscle 1
  • Love 1
  • Love 15
Link to comment
Share on other sites

  • Honorable Member
1 hour ago, xGalardo said:

0614 21:23:26078 :: NameError
0614 21:23:26078 :: : 
0614 21:23:26078 :: global name 'questbutton_max' is not defined
0614 21:23:26078 :: 

If dont have questbutton_max, just change to self.QUEST_BUTTON_MAX_NUM

Both 2015 & 2018 root files have the mentioned lines from the guide but if that works for you, sure...

On 6/13/2023 at 2:43 PM, Gurgarath said:

Thank you for your release! It is really cool! Also, this is one of the new addition that I feel the most weird about, it looks like a bug more than a feature somehow

I agree, when I first saw it on the live server it looked weird because the text didn't match the window length but at least for the buttons it's not that bad since it has space for bigger texts. I wonder how long it will take them until they adjust all the "[ENTER]" tokens in the locale_quest.txt or completely remove them to make the text match the width of the window and break line correctly.

Edited by Owsap
  • Love 1
Link to comment
Share on other sites

  • Active+ Member
10 hours ago, Owsap said:

Both 2015 & 2018 root files have the mentioned lines from the guide but if that works for you, sure...

I agree, when I first saw it on the live server it looked weird because the text didn't match the window length but at least for the buttons it's not that bad since it has space for bigger texts. I wonder how long it will take them until they adjust all the "[ENTER]" tokens in the locale_quest.txt or completely remove them to make the text match the width of the window and break line correctly.

found this tutorial on another forum:

 

How to remove [ENTER] from quests

The function automatically searches for the last word, so as not to cut it, as the normal say function does. And he writes all the text filling the line as much as possible.

function say2(msg)

 msg_size = string.len(msg)

 if msg_size > 59 then

  local i = 59

  last_word = nil

  while last_word == nil and i > 0 do

   if string.sub(msg,i,i) == " " or string.sub(msg,i,i) == "." or string.sub(msg,i,i) == "," then

    last_word = i

   end

   i = i-1

  end

  if i == 0 then

   last_word = 59

  end

  say(string.sub(msg,0,last_word))

  say2(string.sub(msg,last_word+1))

 else

  say(msg)

 end

end

 

 

There you have the function that you must add in your questlib.lua, and add in quest_functions this line:

 

say2

 

 

And it's as easy to use as this:

 

#Ejemplo con texto del translate.lua 

say2(gameforge.rage_quest.text1)

 

#Ejemplo texto normal

say2("Lorem Ipsum es simplemente el texto de relleno de las imprentas y archivos de texto. Lorem Ipsum ha  sido el texto de relleno estándar")

 

spacer.png

Link to comment
Share on other sites

  • 3 weeks later...
  • Premium
On 6/14/2023 at 9:24 PM, xGalardo said:

0614 21:23:26078 :: NameError
0614 21:23:26078 :: : 
0614 21:23:26078 :: global name 'questbutton_max' is not defined
0614 21:23:26078 :: 

If dont have questbutton_max, just change to self.QUEST_BUTTON_MAX_NUM

Same on Marty Sama > global name 'questbutton_max' is not defined > change questbutton_max to self.QUEST_BUTTON_MAX_NUM

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 months later...
  • Active+ Member

For those who wish to change the limit of words in the box:

Spoiler

ROOT uiQuest.py

Spoiler

Search for:

event.SetRestrictedCount(idx,60)

Change the number 60 to the number you want.

 

 

Edited by Th1Doose
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.