Jump to content

Quest window style


Recommended Posts

1) I didnt understand what you whant to do.. if you want to change the look of the button you need to go to root>uiquest.py and search for the class BarButton(), and you need to change it.

2)https://metin2dev.org/board/index.php?/topic/4295-color-chat-text/

3 and 4)I think the best way to do it is in c++

 

 

Link to comment
Share on other sites

  • Honorable Member

You can align the lines to center with this script from 2008(bin_r23166 I have no prior bin :3):

raw_script("[TEXT_HORIZONTAL_ALIGN_CENTER]")

Just the reset function is unimplemented in the original src.
I'm thinking for this:

raw_script("[/TEXT_HORIZONTAL_ALIGN_CENTER]")

UserInterface/PythonEventManger.cpp > void CPythonEventManager::ProcessEventSet(TEventSet * pEventSet)

		case EVENT_TYPE_TEXT_HORIZONTAL_ALIGN_CENTER:
		{
			if (EVENT_POSITION_START == pEventPosition)
			{
				pEventSet->isTextCenterMode = true;
				if (pEventSet->pCurrentTextLine)
					pEventSet->pCurrentTextLine->SetHorizonalAlign(CGraphicTextInstance::HORIZONTAL_ALIGN_CENTER);
			}
			else
				pEventSet->isTextCenterMode = false;

			break;


 

  • Love 2
Link to comment
Share on other sites

1) I didnt understand what you whant to do.. if you want to change the look of the button you need to go to root>uiquest.py and search for the class BarButton(), and you need to change it.

2)https://metin2dev.org/board/index.php?/topic/4295-color-chat-text/

3 and 4)I think the best way to do it is in c++

 

 

2) Yes i know there is this way to do this, however, with this i would have to change every quest, so i'd like to change te basic say color

EDIT: 1) I had saw this function before i've writen this topic. I think that this class is the right one, however I'm not quite good in python so i dob't know what to change to load it image not the only some colors

 

You can align the lines to center with this script from 2008(bin_r23166 I have no prior bin :3):

raw_script("[TEXT_HORIZONTAL_ALIGN_CENTER]")

Just the reset function is unimplemented in the original src.
I'm thinking for this:

raw_script("[/TEXT_HORIZONTAL_ALIGN_CENTER]")

 

Hidden Content

Thanks I haven't tried it yet, i'll when i find time. Is there also solution to size of font please ? :)

EDIT: So i tried, i did new "say_title" and this one should be automaticaly centered:

function secret_title(name) raw_script("[TEXT_HORIZONTAL_ALIGN_CENTER]") say(color256(255, 188, 134)..name..color256(196, 196, 196)) raw_script("[/TEXT_HORIZONTAL_ALIGN_CENTER]") end

Sadlly, if i use this that centered is the "secret_title" text and also the line below.

Edited by CZEboy
Link to comment
Share on other sites


int _say(lua_State* L)
	{
		ostringstream s;
		combine_lua_string(L, s);
		CQuestManager::Instance().AddScript("[COLOR r;{numberofcolorred}|g;{numberofcolorgreen}|b;{numberofcolorblue}]" + s.str() + "[/COLOR][ENTER]");
		return 0;
	}

and replace the {numeberofcolorred},{numeberofcolorblue} and {numeberofcolorgreen} for the number you want.

I dont know if this is correct i dont know anything about c++.. but try it.. maybe it works

 

  • Love 1
Link to comment
Share on other sites

  • Honorable Member

With this will work properly.

function say_title_center(msg,r,g,b)
	local _color
	if (r and g and b) == nil then
		_color = color256(255, 230, 186)
	else
		_color = color256(r, g, b)
	end
	raw_script(string.format("[TEXT_HORIZONTAL_ALIGN_CENTER]%s%s%s[/TEXT_HORIZONTAL_ALIGN_CENTER][ENTER]", _color, msg, color256(196, 196, 196)))
end

 

  • Love 3
Link to comment
Share on other sites

With this will work properly.

function say_title_center(msg,r,g,b)
	local _color
	if (r and g and b) == nil then
		_color = color256(255, 230, 186)
	else
		_color = color256(r, g, b)
	end
	raw_script(string.format("[TEXT_HORIZONTAL_ALIGN_CENTER]%s%s%s[/TEXT_HORIZONTAL_ALIGN_CENTER][ENTER]", _color, msg, color256(196, 196, 196)))
end

 

Works great :) thank you a lot :)

Could you help also with size and style of the font for say title please ?

 

 
int _say(lua_State* L)
	{
		ostringstream s;
		combine_lua_string(L, s);
		CQuestManager::Instance().AddScript("[COLOR r;{numberofcolorred}|g;{numberofcolorgreen}|b;{numberofcolorblue}]" + s.str() + "[ENTER]");
		return 0;
	}

and replace the {numeberofcolorred},{numeberofcolorblue} and {numeberofcolorgreen} for the number you want.

I dont know if this is correct i dont know anything about c++.. but try it.. maybe it works

Thanks i was looking for this, i couldn't find it. Thanks a lot :)

Can you help me also with the python for that button please ? :)

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

OK thanks until now i tried this(for this example we can work with "close_button image":

class BarButton(ui.Button):
	UP=0
	DOWN=1
	OVER=2

	def __init__(self, layer = "UI"):
		ui.Button.__init__(self,layer)
		self.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
		self.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
		self.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")

	def OnRender(self):
		x,y = self.GetGlobalPosition()

		grp.RenderBar(x,y,self.GetWidth(),self.GetHeight())

	def CallEvent(self):
		self.state = self.UP
		ui.Button.CallEvent(self)

	def DownEvent(self):
		self.state = self.DOWN

	def ShowToolTip(self):
		self.state = self.OVER

	def HideToolTip(self):
		self.state = self.UP

But still there is black blackground

Edited by CZEboy
Link to comment
Share on other sites

Try this: 

class BarButton(ui.Button):
	
	btpath = "d:/ymir work/ui/public/" # HERE THE PATH
	btnormal = btpath + "/btnnormal.tga" # HERE THE BUTTON NAME
	btover = btpath + "/btnnormal.tga" # HERE THE BUTTON NAME
	btdisable = btpath + "/btnnormal.tga" # HERE THE BUTTON NAME


	def __init__(self, layer = "UI", 
			aButtonUp   = btnormal, 
			aButtonDown = btdisable, 
			aButtonOver = btover):
		ui.Button.__init__(self,layer)
		self.SetUpVisual(aButtonUp)
		self.SetOverVisual(aButtonOver)
		self.SetDownVisual(aButtonDown)
		
	def CallEvent(self):
		ui.Button.CallEvent(self)

 

and replace the MakeEachButtonFunction for this:

def MakeEachButton(self, i):
		if self.skin == 3:
			button = BarButton("TOP_MOST")
			button.SetParent(self.board)
			button.SetSize(106,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
			button.SetText("a")
			button.SetTextColor(0xff000000)
		else:
			i = i % 8
			button = BarButton("TOP_MOST")
			button.SetParent(self.board)
			button.SetSize(200,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
			button.SetText("a")
			button.SetTextColor(0xffffffff)
		return button

 

dont forget to put the buttons path

Link to comment
Share on other sites

did you replace this?

def MakeEachButton(self, i):
		if self.skin == 3:
			button = BarButton("TOP_MOST")
			button.SetParent(self.board)
			button.SetSize(106,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
			button.SetText("a")
			button.SetTextColor(0xff000000)
		else:
			i = i % 8
			button = BarButton("TOP_MOST")
			button.SetParent(self.board)
			button.SetSize(200,26)
			button.SetPosition(self.sx + self.board.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
			button.SetText("a")
			button.SetTextColor(0xffffffff)
		return button

if yes, show the syssr of the client pls

Link to comment
Share on other sites

  • 3 weeks later...

With this will work properly.

function say_title_center(msg,r,g,b)
	local _color
	if (r and g and b) == nil then
		_color = color256(255, 230, 186)
	else
		_color = color256(r, g, b)
	end
	raw_script(string.format("[TEXT_HORIZONTAL_ALIGN_CENTER]%s%s%s[/TEXT_HORIZONTAL_ALIGN_CENTER][ENTER]", _color, msg, color256(196, 196, 196)))
end

 

do you have something for notice_all or notice?

Edited by Tasho
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



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