Jump to content

Recommended Posts

  • Honorable Member

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

 

20184568747470733a2f2f7075752e73682f464a

 

It's giving random informations about game at loading window.

Group "Normal" has global informations. If you don't add any special map index, you will see global informations.

Edited by Mali
  • Metin2 Dev 127
  • kekw 1
  • Eyes 3
  • Dislove 4
  • Angry 1
  • Sad 2
  • Smile Tear 1
  • Think 1
  • Scream 2
  • Good 42
  • Love 8
  • Love 94

 

Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/
Share on other sites

import uiScriptLocale
import app

window = {

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

	"width" : SCREEN_WIDTH,
	"height" : SCREEN_HEIGHT,

	"children" :
	[
		## Board
		{
			"name" : "BackGround",
			"type" : "expanded_image",

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

			"image" : "d:/ymir work/ui/intro/pattern/Line_Pattern.tga",

			"x_scale" : float(SCREEN_WIDTH) / 800.0,
			"y_scale" : float(SCREEN_HEIGHT) / 600.0,
		},
		{ 
			"name":"ErrorMessage", 
			"type":"text", "x":10, "y":10, 
			"text": uiScriptLocale.LOAD_ERROR, 
		},
		
		{
			"name" : "GageBoard",
			"type" : "window",
			"style" : ("ltr",),
			"x" : float(SCREEN_WIDTH) * 400 / 800.0 - 200,
			"y" : float(SCREEN_HEIGHT) * 500 / 600.0 ,
			"width" : 400, 
			"height": 80,

			"children" :
			(
			
				{
					"name" : "BackGage",
					"type" : "expanded_image",

					"x" : 40,
					"y" : 25,

					"image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/gauge_empty.dds",
				},
				{
					"name" : "FullGage",
					"type" : "expanded_image",

					"x" : 40,
					"y" : 25,

					"image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "loading/gauge_full.dds",
				},
			),
		},
	],
}

window["children"] = window["children"] + [
{
	"name" : "TipBackground",
	"type" : "middleboard",
	
	"x"	: 0,
	"y" : float(SCREEN_HEIGHT) * 500 / 600.0 - 100,
	
	"width" : SCREEN_WIDTH,
	"height" : 100,
	
	"children" :
	(
		{
			"name" : "LoadingTip",
			"type" : "text",
			
			"x"	: float(SCREEN_WIDTH) / 2,
			"y" : 40,				
			
			"text" : " ",
			"text_horizontal_align" : "center",
			"fontsize" : "LARGE",
		},
	),		
},]

Official one, still same error

Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-127864
Share on other sites

  • 2 weeks later...

NOTE: THIS ISN'T NEEDED BY THE TUTORIAL!
For everyone to use, class MiddleBoard. With this you can use the offical loadingwindow.py

Open UI.py and search for "class ThinBoard(Window):" and add below the WHOLE class:

class MiddleBoard(Window):
	CORNER_WIDTH = 16
	CORNER_HEIGHT = 16
	LINE_WIDTH = 16
	LINE_HEIGHT = 16

	LT = 0
	LB = 1
	RT = 2
	RB = 3
	L = 0
	R = 1
	T = 2
	B = 3

	def __init__(self, layer = "UI"):
		Window.__init__(self, layer)

		CornerFileNames = [ "d:/ymir work/ui/pattern/thinboardb_corner_"+dir+".tga" for dir in ["LeftTop","LeftBottom","RightTop","RightBottom"] ]
		LineFileNames = [ "d:/ymir work/ui/pattern/thinboardb_line_"+dir+".tga" for dir in ["Left","Right","Top","Bottom"] ]

		Base = ExpandedImageBox()
		Base.AddFlag("not_pick")
		Base.LoadImage("d:/ymir work/ui/pattern/thinboardb_center.tga")
		Base.SetParent(self)
		Base.SetPosition(self.CORNER_WIDTH, self.CORNER_HEIGHT)
		Base.Show()
		self.Base = Base

		self.Corners = []
		for fileName in CornerFileNames:
			Corner = ExpandedImageBox()
			Corner.AddFlag("attach")
			Corner.AddFlag("not_pick")
			Corner.LoadImage(fileName)
			Corner.SetParent(self)
			Corner.SetPosition(0, 0)
			Corner.Show()
			self.Corners.append(Corner)

		self.Lines = []
		for fileName in LineFileNames:
			Line = ExpandedImageBox()
			Line.AddFlag("attach")
			Line.AddFlag("not_pick")
			Line.LoadImage(fileName)
			Line.SetParent(self)
			Line.SetPosition(0, 0)
			Line.Show()
			self.Lines.append(Line)

		self.Lines[self.L].SetPosition(0, self.CORNER_HEIGHT)
		self.Lines[self.T].SetPosition(self.CORNER_WIDTH, 0)

	def __del__(self):
		Window.__del__(self)

	def SetSize(self, width, height):

		width = max(self.CORNER_WIDTH*2, width)
		height = max(self.CORNER_HEIGHT*2, height)
		Window.SetSize(self, width, height)

		self.Corners[self.LB].SetPosition(0, height - self.CORNER_HEIGHT)
		self.Corners[self.RT].SetPosition(width - self.CORNER_WIDTH, 0)
		self.Corners[self.RB].SetPosition(width - self.CORNER_WIDTH, height - self.CORNER_HEIGHT)
		self.Lines[self.R].SetPosition(width - self.CORNER_WIDTH, self.CORNER_HEIGHT)
		self.Lines[self.B].SetPosition(self.CORNER_HEIGHT, height - self.CORNER_HEIGHT)

		verticalShowingPercentage = float((height - self.CORNER_HEIGHT*2) - self.LINE_HEIGHT) / self.LINE_HEIGHT
		horizontalShowingPercentage = float((width - self.CORNER_WIDTH*2) - self.LINE_WIDTH) / self.LINE_WIDTH

		self.Lines[self.L].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.R].SetRenderingRect(0, 0, 0, verticalShowingPercentage)
		self.Lines[self.T].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)
		self.Lines[self.B].SetRenderingRect(0, 0, horizontalShowingPercentage, 0)

		if self.Base:
			self.Base.SetRenderingRect(0, 0, (float(width)-32)/float(self.Base.GetWidth()) - 1.0, (float(height)-32)/float(self.Base.GetHeight()) - 1.0)

	def ShowInternal(self):
		self.Base.Show()
		for wnd in self.Lines:
			wnd.Show()
		for wnd in self.Corners:
			wnd.Show()

	def HideInternal(self):
		self.Base.Hide()
		for wnd in self.Lines:
			wnd.Hide()
		for wnd in self.Corners:
			wnd.Hide()


Now search for "elif Type == "thinboard":" and add below the elif:

elif Type == "middleboard":
	parent.Children[Index] = MiddleBoard()
	parent.Children[Index].SetParent(parent)
	self.LoadElementThinBoard(parent.Children[Index], ElementValue, parent)

Should look like: ec70fb83a0.png

Now just add the visuals (if you didn't already got them out of Patch 19.0)

This is the hidden content, please

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 11
  • Dislove 1
  • Love 6
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-128770
Share on other sites

  • 2 weeks later...
On 5/13/2020 at 4:57 PM, Mali61 said:

This is the hidden content, please

68747470733a2f2f7075752e73682f464a555962

 

It's giving random informations about game at loading window. Edit LTipList for special map's informations.

Group "Normal" has global informations. If you don't add any special map index at LTipList, you will see global informations.

One thing you need to know, special informations not working at "First Login", because warpmapindex is zero at login. So you will see global informations.

For me dont work …. i cant compile the src later i add the codes….i use vc141 can u help me please?

 

 

15>\source\userinterface\LTiplist.h(149): error C2440: 'initialize': impossible convert from  'initializer-list' a 'std::vector<std::tuple<std::string,std::vector<int,std::allocator<_Ty>>,std::vector<_Ty,std::allocator<_Ty>>>,std::allocator<std::tuple<std::string,std::vector<_Ty,std::allocator<_Ty>>,std::vector<_Ty,std::allocator<_Ty>>>>>'15>        with15>        [15>            _Ty=int15>        ]15>        No constructor could accept the source type, or the constructor overload resolution was ambiguous

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129246
Share on other sites

2 hours ago, Razor88 said:

For me dont work …. i cant compile the src later i add the codes….i use vc141 can u help me please?

 

 


15>\source\userinterface\LTiplist.h(149): error C2440: 'initialize': impossible convert from  'initializer-list' a 'std::vector<std::tuple<std::string,std::vector<int,std::allocator<_Ty>>,std::vector<_Ty,std::allocator<_Ty>>>,std::allocator<std::tuple<std::string,std::vector<_Ty,std::allocator<_Ty>>,std::vector<_Ty,std::allocator<_Ty>>>>>'15>        with15>        [15>            _Ty=int15>        ]15>        No constructor could accept the source type, or the constructor overload resolution was ambiguous

 

seems like a C++ version issue, are you sure you're compiling the client using v141 toolset(instead of just having it available)?

  • Love 1
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129260
Share on other sites

3 minutes ago, boaspessoal said:

seems like a C++ version issue, are you sure you're compiling the client using v141 toolset(instead of just having it available)?

hi thank u , yes i compile vith v141 toolset but when i enable the define for compile this code when link give me this error if i disable this code all is ok and link the .exe

 

5 minutes ago, boaspessoal said:

seems like a C++ version issue, are you sure you're compiling the client using v141 toolset(instead of just having it available)?

can u help me to solve?

Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129261
Share on other sites

5 minutes ago, Razor88 said:

hi thank u , yes i compile vith v141 toolset but when i enable the define for compile this code when link give me this error if i disable this code all is ok and link the .exe

 

if you're using a recent vs version, you should have this option when checking the properties of each project:

a66faa1bc8b317323bf2eaff0eb19499.png

 

use c++17 or above on UserInterface and try again

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129262
Share on other sites

2 minutes ago, boaspessoal said:

if you're using a recent vs version, you should have this option when checking the properties of each project:

a66faa1bc8b317323bf2eaff0eb19499.png

 

use c++17 or above and try again

where is exactly? can u tell me the path please ?

i think yes i use vs 2017

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129263
Share on other sites

2 minutes ago, Razor88 said:

where is exactly? can u tell me the path please ?

i think yes i use vs 2017

 

right click on project(UserInterface), this pops up -> 9945420f8447ae04e9cc7a1f59597173.png -> Properties -> General

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129264
Share on other sites

15 minutes ago, boaspessoal said:

Try checking in C/C++ if there's a tab called language

Thank u so much mate! ive find but changed nothing still dont work ç_ç

 

2a060dd4bf.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-129267
Share on other sites

  • 6 months later...
  • 10 months later...
  • 9 months later...
  • 1 year later...

found a small error in tutorial:
locale_xx/ui > loadingwindow.py 

lists can only concatenate another list, not tuples. 

#Add Last
import app
if app.__BL_LOADING_TIP__:
	window["children"] = window["children"] + (
	{
		"name" : "TipBackground",
		"type" : "thinboard",
		
		"x"	: 0,
		"y" : float(SCREEN_HEIGHT) * 500 / 600.0 - 100,
		
		"width" : SCREEN_WIDTH,
		"height" : 100,
		
		"children" :
		(
			{
				"name" : "LoadingTip",
				"type" : "text",
				
				"x"	: float(SCREEN_WIDTH) / 2,
				"y" : 40,				
				
				"text" : " ",
				"text_horizontal_align" : "center",
				"fontsize" : "LARGE",
			},
		),		
	},)

 

fix >

if app.__BL_LOADING_TIP__:
	window["children"] = window["children"] + [
	{
		"name" : "TipBackground",
		"type" : "thinboard",
		
		"x"	: 0,
		"y" : float(SCREEN_HEIGHT) * 500 / 600.0 - 100,
		
		"width" : SCREEN_WIDTH,
		"height" : 100,
		
		"children" :
		(
			{
				"name" : "LoadingTip",
				"type" : "text",
				
				"x"	: float(SCREEN_WIDTH) / 2,
				"y" : 40,				
				
				"text" : " ",
				"text_horizontal_align" : "center",
				"fontsize" : "LARGE",
			},
		),		
	},
	]

 

 

This system is good idea, but, in my case, the maps load so fast that is impossible to get any tip 

Thanks for share with the community

 

Edited by Ballads
Link to comment
https://metin2.dev/topic/23824-loading-tip-info-system/#findComment-159399
Share on other sites

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.