Honorable Member Owsap 8243 Posted June 13, 2023 Honorable Member Share Posted June 13, 2023 (edited) 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 June 13, 2023 by Owsap Added Preview of the Quest Width Expansion 43 1 9 1 1 17 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
Forum Moderator Gurgarath 2523 Posted June 13, 2023 Forum Moderator Share Posted June 13, 2023 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 5 Gurgarath coming soon Link to comment Share on other sites More sharing options...
eddR 9 Posted June 13, 2023 Share Posted June 13, 2023 haha, I feel like its 2012 all over again. guess old is new again huh 1 1 Link to comment Share on other sites More sharing options...
Debloat 88 Posted June 14, 2023 Share Posted June 14, 2023 Thank you it's working. I also increased input width so that at least wider window make sense. Link to comment Share on other sites More sharing options...
Honorable Member Mali 42294 Posted June 14, 2023 Honorable Member Share Posted June 14, 2023 20 hours ago, Gurgarath said: it looks like a bug more than a feature somehow Spoiler 4 1 Link to comment Share on other sites More sharing options...
xGalardo 13 Posted June 14, 2023 Share Posted June 14, 2023 (edited) 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 Edited June 14, 2023 by xGalardo 1 Link to comment Share on other sites More sharing options...
Honorable Member Owsap 8243 Posted June 14, 2023 Author Honorable Member Share Posted June 14, 2023 (edited) 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 June 14, 2023 by Owsap 1 https://owsap.dev/ / https://osf.owsap.dev/ Link to comment Share on other sites More sharing options...
xGalardo 13 Posted June 14, 2023 Share Posted June 14, 2023 22 minutes ago, Owsap said: Both 2015 & 2018 root files have the mentioned lines from the guide but if that works for you, sure... I'm using Martysama base, I didn't know it wasn't included, sorry about that. 1 Link to comment Share on other sites More sharing options...
Active+ Member HFWhite 528 Posted June 15, 2023 Active+ Member Share Posted June 15, 2023 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") Link to comment Share on other sites More sharing options...
Active+ Member MT2Dev 525 Posted June 18, 2023 Active+ Member Share Posted June 18, 2023 Thanks for the release but someone need to say it, it's look ugly af. 1 1 © Link to comment Share on other sites More sharing options...
Premium DemOnJR 572 Posted July 5, 2023 Premium Share Posted July 5, 2023 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 Link to comment Share on other sites More sharing options...
klars99 4 Posted July 17, 2023 Share Posted July 17, 2023 (edited) How to adjust the width of the input. It is the most important in order to adjust the lines Edited July 17, 2023 by klars99 Link to comment Share on other sites More sharing options...
Active+ Member Doose 1626 Posted December 10, 2023 Active+ Member Share Posted December 10, 2023 (edited) 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 December 10, 2023 by Th1Doose Link to comment Share on other sites More sharing options...
Recommended Posts