Jump to content

Recommended Posts

Hey buddys !

i have a little problem with my sash absorb window and combination window
it always open like this

85fce407b652075bf20866715ce5e2ff.jpg

but i want that it open in the middle like on the official but every changes i made the window dont change the position and thats weird.


my sash_absorbwindow.py
 

import app
import item
import uiScriptLocale

window = {
	"name" : "Sash_AbsorbtionWindow",
	"x" : 0,
	"y" : 0,
	"style" : ("movable", "float",),
	"width" : 205,
	"height" : 270,
	"children" :
	(
		{
			"name" : "board",
			"type" : "board",
			"style" : ("attach",),
			"x" : 0,
			"y" : 0,
			"width" : 205,
			"height" : 270,
			"children" :
			(
				{
					"name" : "TitleBar",
					"type" : "titlebar",
					"style" : ("attach",),
					"x" : 6,
					"y" : 6,
					"width" : 190,
					"color" : "yellow",
					"children" :
					(
						{
							"name":"TitleName",
							"type":"text",
							"x":95,
							"y":3,
							"text":uiScriptLocale.SASH_ABSORB,
							"text_horizontal_align":"center"
						},
					),
				},
				{
					"name" : "Sash_Combine",
					"type" : "image",
					"x" : 9,
					"y" : 35,
					"image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "Acce/Acce_absorb.tga",
					"children" :
					(
						{
							"name" : "SashSlot",
							"type" : "slot",
							"x" : 3,
							"y" : 3,
							"width" : 190,
							"height" : 200,
							"slot" : (
										{
											"index" : 0,
											"x" : 26,
											"y" : 41,
											"width" : 31,
											"height" : 31
										},
										{
											"index" : 1,
											"x" : 125,
											"y" : 8,
											"width" : 31,
											"height" : 96
										},
										{
											"index" : 2,
											"x" : 75,
											"y" : 126,
											"width" : 31,
											"height" : 31
										},
							),
						},
					),
				},
				{
					"name" : "AcceptButton",
					"type" : "button",
					"x" : 40,
					"y" : 235,
					"text" : uiScriptLocale.OK,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},
				{
					"name" : "CancelButton",
					"type" : "button",
					"x" : 114,
					"y" : 235,
					"text" : uiScriptLocale.CANCEL,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},				
			),
		},
	),
}


my sash_combinewindow.py

 

import app
import item
import uiScriptLocale

COSTUME_START_INDEX = item.COSTUME_SLOT_START

window = {
	"name" : "Sash_CombineWindow",
	"x" : 0,
	"y" : 0,
	"style" : ("movable", "float",),
	"width" : 215,
	"height" : 270,
	"children" :
	(
		{
			"name" : "board",
			"type" : "board",
			"style" : ("attach",),
			"x" : 0,
			"y" : 0,
			"width" : 215,
			"height" : 270,
			"children" :
			(
				{
					"name" : "TitleBar",
					"type" : "titlebar",
					"style" : ("attach",),
					"x" : 6,
					"y" : 6,
					"width" : 200,
					"color" : "yellow",
					"children" :
					(
						{
							"name" : "TitleName",
							"type" : "text",
							"x" : 95,
							"y" : 3,
							"text" : uiScriptLocale.SASH_COMBINE,
							"text_horizontal_align" : "center"
						},
					),
				},
				{
					"name" : "Sash_Combine",
					"type" : "image",
					"x" : 9,
					"y" : 35,
					"image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "acce/acce_combine.tga",
					"children" :
					(
						{
							"name" : "SashSlot",
							"type" : "slot",
							"x" : 3,
							"y" : 3,
							"width" : 200,
							"height" : 150,
							"slot" : (
										{
											"index":0,
											"x":78,
											"y":7,
											"width":32,
											"height":32
										},
										{
											"index":1,
											"x":78,
											"y":60,
											"width":32,
											"height":32
										},
										{
											"index":2,
											"x":78,
											"y":115,
											"width":32,
											"height":32
										},
							),
						},
						{
							"name" : "Main",
							"type" : "text",
							"text" : uiScriptLocale.SASH_MAIN,
							"text_horizontal_align":"center",
							"x" : 85 + 12,
							"y" : 7 + 36,
						},
						{
							"name" : "serve",
							"type" : "text",
							"text" : uiScriptLocale.SASH_SERVE,
							"text_horizontal_align" : "center",
							"x" : 85 + 12,
							"y" : 60 + 38,
						},
						{
							"name" : "Result",
							"type" : "text", 
							"text" : uiScriptLocale.SASH_RESULT,
							"text_horizontal_align":"center",
							"x" : 85 + 12,
							"y" : 115 + 40
						},
					),
				},
				{
					"name" : "NeedMoney",
					"type" : "text",
					"text" : "",
					"text_horizontal_align" : "center",
					"x" : 105,
					"y" : 215,
				},
				{
					"name" : "AcceptButton",
					"type" : "button",
					"x" : 40,
					"y" : 235,
					"text" : uiScriptLocale.OK,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},
				{
					"name" : "CancelButton",
					"type" : "button",
					"x" : 114,
					"y" : 235,
					"text" : uiScriptLocale.CANCEL,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},			
			),
		},
	),
}

 

Edited by Metin2 Dev
Core X - External 2 Internal
vor 14 Minuten schrieb T4UMP:


window = {
	"name" : "Sash_CombineWindow",
	"x" : 0,
	"y" : 0,
	"style" : ("movable", "float",),
	"width" : 215,
	"height" : 270,
	"children" :

if i make changes there nothing happens , thats why im asking.

  • Active Member

Hi!
Try this way 

window = {
	"name" : "Sash_AbsorbtionWindow",
	"x" : SCREEN_WIDTH - 176 - 200 - 80,
	"y" : SCREEN_HEIGHT - 37 - 563,
	"style" : ("movable", "float",),
	"width" : 205,
	"height" : 270,
	"children" :

Regards

  • Love 1
vor 21 Stunden schrieb Heathcliff™:

Hi!
Try this way 


window = {
	"name" : "Sash_AbsorbtionWindow",
	"x" : SCREEN_WIDTH - 176 - 200 - 80,
	"y" : SCREEN_HEIGHT - 37 - 563,
	"style" : ("movable", "float",),
	"width" : 205,
	"height" : 270,
	"children" :

Regards

 

Thats working thank you ?

  • Love 1
  • 7 years later...
On 2/26/2019 at 1:25 PM, .SchneeFlocke' said:

Hey buddys !

i have a little problem with my sash absorb window and combination window
it always open like this

85fce407b652075bf20866715ce5e2ff.jpg

but i want that it open in the middle like on the official but every changes i made the window dont change the position and thats weird.


my sash_absorbwindow.py
 

import app
import item
import uiScriptLocale

window = {
	"name" : "Sash_AbsorbtionWindow",
	"x" : 0,
	"y" : 0,
	"style" : ("movable", "float",),
	"width" : 205,
	"height" : 270,
	"children" :
	(
		{
			"name" : "board",
			"type" : "board",
			"style" : ("attach",),
			"x" : 0,
			"y" : 0,
			"width" : 205,
			"height" : 270,
			"children" :
			(
				{
					"name" : "TitleBar",
					"type" : "titlebar",
					"style" : ("attach",),
					"x" : 6,
					"y" : 6,
					"width" : 190,
					"color" : "yellow",
					"children" :
					(
						{
							"name":"TitleName",
							"type":"text",
							"x":95,
							"y":3,
							"text":uiScriptLocale.SASH_ABSORB,
							"text_horizontal_align":"center"
						},
					),
				},
				{
					"name" : "Sash_Combine",
					"type" : "image",
					"x" : 9,
					"y" : 35,
					"image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "Acce/Acce_absorb.tga",
					"children" :
					(
						{
							"name" : "SashSlot",
							"type" : "slot",
							"x" : 3,
							"y" : 3,
							"width" : 190,
							"height" : 200,
							"slot" : (
										{
											"index" : 0,
											"x" : 26,
											"y" : 41,
											"width" : 31,
											"height" : 31
										},
										{
											"index" : 1,
											"x" : 125,
											"y" : 8,
											"width" : 31,
											"height" : 96
										},
										{
											"index" : 2,
											"x" : 75,
											"y" : 126,
											"width" : 31,
											"height" : 31
										},
							),
						},
					),
				},
				{
					"name" : "AcceptButton",
					"type" : "button",
					"x" : 40,
					"y" : 235,
					"text" : uiScriptLocale.OK,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},
				{
					"name" : "CancelButton",
					"type" : "button",
					"x" : 114,
					"y" : 235,
					"text" : uiScriptLocale.CANCEL,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},				
			),
		},
	),
}


my sash_combinewindow.py

 

import app
import item
import uiScriptLocale

COSTUME_START_INDEX = item.COSTUME_SLOT_START

window = {
	"name" : "Sash_CombineWindow",
	"x" : 0,
	"y" : 0,
	"style" : ("movable", "float",),
	"width" : 215,
	"height" : 270,
	"children" :
	(
		{
			"name" : "board",
			"type" : "board",
			"style" : ("attach",),
			"x" : 0,
			"y" : 0,
			"width" : 215,
			"height" : 270,
			"children" :
			(
				{
					"name" : "TitleBar",
					"type" : "titlebar",
					"style" : ("attach",),
					"x" : 6,
					"y" : 6,
					"width" : 200,
					"color" : "yellow",
					"children" :
					(
						{
							"name" : "TitleName",
							"type" : "text",
							"x" : 95,
							"y" : 3,
							"text" : uiScriptLocale.SASH_COMBINE,
							"text_horizontal_align" : "center"
						},
					),
				},
				{
					"name" : "Sash_Combine",
					"type" : "image",
					"x" : 9,
					"y" : 35,
					"image" : uiScriptLocale.LOCALE_UISCRIPT_PATH + "acce/acce_combine.tga",
					"children" :
					(
						{
							"name" : "SashSlot",
							"type" : "slot",
							"x" : 3,
							"y" : 3,
							"width" : 200,
							"height" : 150,
							"slot" : (
										{
											"index":0,
											"x":78,
											"y":7,
											"width":32,
											"height":32
										},
										{
											"index":1,
											"x":78,
											"y":60,
											"width":32,
											"height":32
										},
										{
											"index":2,
											"x":78,
											"y":115,
											"width":32,
											"height":32
										},
							),
						},
						{
							"name" : "Main",
							"type" : "text",
							"text" : uiScriptLocale.SASH_MAIN,
							"text_horizontal_align":"center",
							"x" : 85 + 12,
							"y" : 7 + 36,
						},
						{
							"name" : "serve",
							"type" : "text",
							"text" : uiScriptLocale.SASH_SERVE,
							"text_horizontal_align" : "center",
							"x" : 85 + 12,
							"y" : 60 + 38,
						},
						{
							"name" : "Result",
							"type" : "text", 
							"text" : uiScriptLocale.SASH_RESULT,
							"text_horizontal_align":"center",
							"x" : 85 + 12,
							"y" : 115 + 40
						},
					),
				},
				{
					"name" : "NeedMoney",
					"type" : "text",
					"text" : "",
					"text_horizontal_align" : "center",
					"x" : 105,
					"y" : 215,
				},
				{
					"name" : "AcceptButton",
					"type" : "button",
					"x" : 40,
					"y" : 235,
					"text" : uiScriptLocale.OK,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},
				{
					"name" : "CancelButton",
					"type" : "button",
					"x" : 114,
					"y" : 235,
					"text" : uiScriptLocale.CANCEL,
					"default_image" : "d:/ymir work/ui/public/middle_button_01.sub",
					"over_image" : "d:/ymir work/ui/public/middle_button_02.sub",
					"down_image" : "d:/ymir work/ui/public/middle_button_03.sub",
				},			
			),
		},
	),
}

 

[Tutorial] Acce/Sash System: Window Centering & ESC/Z-Order Fix

Description: Many Acce (Sash) systems have two common UI issues:

Initial Position: The window opens at the top-left corner (0,0) the first time it's opened.

Focus/Z-Order: When the window is open along with the inventory, pressing the ESC key closes the inventory first instead of the Acce window, even if the Acce window is visually on top.

This guide will show you how to fix both in your uiacce.py.

1. Fixing the Initial Window Position (Auto-Centering)

We want the window to start at the center of the screen upon the first execution, but still allow the game to remember if the player drags it to a new position.

File: root/uiacce.py Search for: def LoadWindow(self): inside both class CombineWindow and class AbsorbWindow.

Action: Go to the end of the LoadWindow function and add self.SetCenterPosition() before the end of the block.

Example for CombineWindow:

Python

def LoadWindow(self): # ... (existing code) self.btnAccept.SetEvent(ui.__mem_func__(self.OnAccept)) self.tooltipItem = None self.SetCenterPosition() # Add this line here

Example for AbsorbWindow:

Python

def LoadWindow(self): # ... (existing code) self.btnAccept.SetEvent(ui.__mem_func__(self.OnAccept)) self.tooltipItem = None self.SetCenterPosition() # Add this line here

2. Fixing the Z-Order and ESC Key Hierarchy

This ensures that the Acce window becomes the "Active" window when opened, so the first ESC press closes it instead of background windows (like the inventory).

File: root/uiacce.py Search for: def Open(self): inside both class CombineWindow and class AbsorbWindow.

Action: Add self.SetTop() at the very end of the Open function.

Example:

Python

def Open(self): # ... (existing code) self.Show() self.SetTop() # Add this to bring the window to the front

(Repeat this for both classes: CombineWindow and AbsorbWindow).

Why this works:

SetCenterPosition in LoadWindow: By placing it in LoadWindow, it only triggers once when the UI is first created. If the player moves the window, the game's internal movable style will preserve the new coordinates for the rest of the session.

SetTop in Open: This tells the game engine that this window now has the focus. The UI stack will recognize it as the top-most layer, redirecting the ESC key input to it immediately.

Note: Always make sure your indentation (tabs) is correct, as Python is sensitive to it!

  • 4 weeks later...
  • Active Member

Wtf guys? Just do it like this, it will place the window in the center of the screen:

WINDOW_WIDTH = 205
WINDOW_HEIGHT = 270

"x" : SCREEN_WIDTH / 2 - WINDOW_WIDTH / 2,
"y" : SCREEN_HEIGHT / 2 - WINDOW_HEIGHT / 2,
  • kekw 1
  • Good 1
On 6/2/2026 at 2:39 PM, jking said:

Wtf guys? Just do it like this, it will place the window in the center of the screen:

WINDOW_WIDTH = 205
WINDOW_HEIGHT = 270

"x" : SCREEN_WIDTH / 2 - WINDOW_WIDTH / 2,
"y" : SCREEN_HEIGHT / 2 - WINDOW_HEIGHT / 2,

Solved tanks

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.