if not dsc then return end

local mnu
--[[
заначение поля хранится в:
	.value
получить данные - при начальном создании меню или когда делается показ меню - Update():
	.valGet = function(item) or table[item.name]
	- результат будет записан в .value
при изменении данных пользователем:
	.valOnSet = function(item)
	функция вызываемая после изменения данных в меню ( после нажатия на пункт меню)

для показа значения в поле меню:
1. изменение значениея до форматировани - наклейки для значений
	.valLabels = function(item) or table[item.value]
	- результат запишется в локальную
	VAL = 
2. выбираем формат для показа данных по VAL для SetFormat():
	.valFormats = table[VAL]
3. изменяем занчениие еще раз (Обычно это для локализации нужно):
	.valShapes = function(VAL) or table[VAL]
	- результат выводится в поле по :SetVal()

для ярлыкоа пунктов меню:
	.label - тектовое значение
	.labelShapes = function(label) or table[label]
	- меняет ярлык - обычно для локализации

если у поля нет своей функции то она берется общая из самого меню:
	if item.valGet then
	elseif item.parent.valGet then
	end
	if item.labelShapes then
	elseif item.parent.labelShapes then
	end

если это пункт без значений - как оманда то функция по клику хранится в:
	.onClick = function( item )

	--- порядок вызова внешних функций при нажатии на пункт меню / изменении данных 
	local onClick = item.onClick or item.valOnSet or obj.valOnSet or obj.onClick
	if onClick then onClick( item, pars ) end

]]
local function valGet(item)
	local val = get_PS( item.name )
	--exObj(" valGet", val )
	item.parent:ItemFade( item, val == OFF and 0.7 or 1)

	--item.value = val
	return val
end

local function valOnSet( item )

	local n, v = item.name, item.value
	set_PS(n, v)

	--exObj(" valOnSet", item )


	if type(v) ~= "table" then
		--LogToChat(n.." = "..v)
		item.parent:ItemFade( item, v == OFF and 0.7 or 1)
	else
		--LogToChat("see mods.txt")
		--exObj( n, v )
	end
end
-------------------------------------------------------------------------------
function mainMenuToggle( pars )
	if mnu then
		mnu:Show( true )
	end
end
----------------------------------------------------------------
------ INIT
----------------------------------------------------------------
function menuUpdate()
	if mnu then mnu:Update() end
end

local c_F = {r=-0.15, b=-0.15, g=0.3}
local c_G = {r=-0.15, b=0.3, g=0.0}
local c_N = {r=0.15, b=-0.3, g=0.15}
local c_E = {r=0.3, b=-0.15, g=-0.15}
local c_C = {r=-0.2, b=-0.2, g=-0.2, a=0.5}
local ccC = {r=0.5, b=0.5, g=0.5, a=1.0}

local fontFrmtItems = {
	{ t = "_", l = ""},
	{ t = "_", l = "MYSELF"},
	{ n = "me_name", l = "Name", },
	{ n = "me_guild", l = "Guild", },
	{ n = "me_targName", l = "Target Name", o = 15},
	{ n = "me_title", l = "Title", o = 15},
	{ t = "_", l = ""},
	{ n = "sp_name", l = "Spouse Name", },

	{ t = "_", l = ""},
	{ t = "_", l = "FRIENDLY"},

	{ t = "_", l = "PLAYERS"},
	{ n = "fp_name", l = "Name", ch = c_F, },
	{ n = "fp_guild", l = "Guild", ch = c_F, },
	{ n = "fp_targName", l = "Target Name", ch = c_F, o = 15},
	{ n = "fp_title", l = "Title", ch = c_F, o = 15},

	{ t = "_", l = "GROUP"},
	{ n = "gp_name", l = "Name", ch = c_F, },
	{ n = "gp_guild", l = "Guild", ch = c_F, },
	{ n = "gp_targName", l = "Target Name", ch = c_F, o = 15},
	{ n = "gp_title", l = "Title", ch = c_F, o = 15},

	{ t = "_", l = "RAID"},
	{ n = "rd_name", l = "Name", ch = c_F, },
	{ n = "rd_guild", l = "Guild", ch = c_F, },
	{ n = "rd_targName", l = "Target Name", ch = c_F, o = 15},
	{ n = "rd_title", l = "Title", ch = c_F, o = 15},

	{ t = "_", l = "NPC|mobs"},
	{ n = "fn_name", l = "Name", ch = c_F, },
	{ n = "fn_targName", l = "Target Name", ch = c_F, o = 15},
	{ n = "fn_title", l = "Title", ch = c_F, o = 15},

	{ t = "_", l = ""},
	{ t = "_", l = "AGGRESSIVE"},

	{ t = "_", l = "PLAYERS"},
	{ n = "ep_name", l = "Name", ch = c_E, },
	{ n = "ep_guild", l = "Guild", ch = c_E, },
	{ n = "ep_targName", l = "Target Name", ch = c_E, o = 15},
	{ n = "ep_title", l = "Title", ch = c_E, o = 15},

	{ t = "_", l = "My Faction Players"},
	{ n = "epf_name", l = "Name", ch = c_E, },
	{ n = "epf_guild", l = "Guild", ch = c_E, },
	{ n = "epf_targName", l = "Target Name", ch = c_E, o = 15},
	{ n = "epf_title", l = "Title", ch = c_E, o = 15},

	{ t = "_", l = "NPC|mobs"},
	{ n = "en_name", l = "Name", ch = c_E, },
	{ n = "en_targName", l = "Target Name", ch = c_E, o = 15},
	{ n = "en_title", l = "Title", ch = c_E, o = 15},

	{ t = "_", l = ""},
	{ t = "_", l = "NEUTRAL"},

	{ t = "_", l = "PLAYERS"},
	{ n = "np_name", l = "Name", ch = c_N, },
	{ n = "np_guild", l = "Guild", ch = c_N, },
	{ n = "np_targName", l = "Target Name", ch = c_N, o = 15},
	{ n = "np_title", l = "Title", ch = c_N, o = 15},

	{ t = "_", l = "NPC|mobs"},
	{ n = "nn_name", l = "Name", ch = c_N, },
	{ n = "nn_targName", l = "Target Name", ch = c_N, o = 15},
	{ n = "nn_title", l = "Title", ch = c_N, o = 15},

	{ t = "_", l = ""},
	{ t = "_", l = "Common"},
	{ n = "level", l = "Level", ch = c_C},
	{ n = "qu_title", l = "QUEST Units Title", ch = c_C },

}

local HBarsFrmtItems = {
	{ t = "_", l = "HealtBar Settings"},
	{ t = "_", l = ""},
	{ t = "_", l = "FRIENDLY"},
	{ n = "me_c", l = "MYSELF color", tp = "_clr", },
	{ n = "me_c_", l = "MYSELF color Lining", tp = "_clr", },
	{ n = "me_w", l = "MYSELF width", tp = "_edl", o=15 },
	{ n = "me_t", l = "texture No", tp = "_edl", },

	{ n = "sp_c", l = "Spouse color", tp = "_clr", },
	{ n = "sp_c_", l = "Spouse color Lining", tp = "_clr", },
	{ n = "sp_w", l = "Spouse width", tp = "_edl", o=15 },
	{ n = "sp_t", l = "texture No", tp = "_edl", },

	{ n = "fp_c", l = "PLAYERS color", tp = "_clr", },
	{ n = "fp_c_", l = "PLAYERS color Lining", tp = "_clr", },
	{ n = "fp_w", l = "PLAYERS width", tp = "_edl", o=15 },
	{ n = "fp_t", l = "texture No", tp = "_edl", },

	{ n = "gp_c", l = "GROUP color", tp = "_clr", },
	{ n = "gp_c_", l = "GROUP color Lining", tp = "_clr", },
	{ n = "gp_w", l = "GROUP width", tp = "_edl", o=15 },
	{ n = "gp_t", l = "texture No", tp = "_edl", },

	{ n = "rd_c", l = "RAID color", tp = "_clr", },
	{ n = "rd_c_", l = "RAID color Lining", tp = "_clr", },
	{ n = "rd_w", l = "RAID width", tp = "_edl", o=15 },
	{ n = "rd_t", l = "texture No", tp = "_edl", },

	{ n = "fn_c", l = "NPC|mobs color", tp = "_clr", },
	{ n = "fn_c_", l = "NPC|mobs color Lining", tp = "_clr", },
	{ n = "fn_w", l = "NPC|mobs width", tp = "_edl", o=15 },
	{ n = "fn_t", l = "texture No", tp = "_edl", },

	{ t = "_", l = ""},
	{ t = "_", l = "AGGRESSIVE"},

	{ n = "ep_c", l = "PLAYERS color", tp = "_clr", },
	{ n = "ep_c_", l = "PLAYERS color Lining", tp = "_clr", },
	{ n = "ep_w", l = "PLAYERS width", tp = "_edl", o=15 },
	{ n = "ep_t", l = "texture No", tp = "_edl", },

	{ n = "epf_c", l = "Fr_PLAYERS color", tp = "_clr", },
	{ n = "epf_c_", l = "Fr_PLAYERS color Lining", tp = "_clr", },
	{ n = "epf_w", l = "Fr_PLAYERS width", tp = "_edl", o=15 },
	{ n = "epf_t", l = "texture No", tp = "_edl", },

	{ n = "en_c", l = "NPC|mobs color", tp = "_clr", },
	{ n = "en_c_", l = "NPC|mobs color Lining", tp = "_clr", },
	{ n = "en_w", l = "NPC|mobs width", tp = "_edl", o=15 },
	{ n = "en_t", l = "texture No", tp = "_edl", },

	{ t = "_", l = ""},
	{ t = "_", l = "NEUTRAL"},

	{ n = "np_c", l = "PLAYERS color", tp = "_clr", },
	{ n = "np_c_", l = "PLAYERS color Lining", tp = "_clr", },
	{ n = "np_w", l = "PLAYERS width", tp = "_edl", o=15 },
	{ n = "np_t", l = "texture No", tp = "_edl", },

	{ n = "nn_c", l = "NPC|mobs color", tp = "_clr", },
	{ n = "nn_c_", l = "NPC|mobs color Lining", tp = "_clr", },
	{ n = "nn_w", l = "NPC|mobs width", tp = "_edl", o=15 },
	{ n = "nn_t", l = "texture No", tp = "_edl", },

}

--- списки значений, которые будут прокручиваться как значения некоторых полей
local onoff = { ON, OFF }
local valLabels = {
	[ON] = "ON",
	[OFF] = "OFF",
    }
local valFormats = { 
	--[names[NEED]] =	"<html alignx='right' fontsize='14'><tip_red><r name='value'/></tip_red></html>",
	--[names[GREED]] =	"<html alignx='right' fontsize='14'><tip_green><r name='value'/></tip_green></html>",
	--[names[SAME]] =	"<html alignx='right' fontsize='14'><tip_golden><r name='value'/></tip_golden></html>",
	--[Labels[PASS]] =	"<html alignx='right' fontsize='14'><tip_blue><r name='value'/></tip_blue></html>",
	[valLabels[ON]] =		"<html alignx='right' fontsize='14'><tip_green><r name='value'/></tip_green></html>",
	[valLabels[OFF]] =	"<html><log_dark_white><body alignx='right' fontsize='14'><r name='value'/></body></log_dark_white></html>",
	}
local alignVals = { 0, 1, 2 }
local alignLabels = { [0] = "Left", [1] = "Right", [2] = "Center" }

local PSnames = { 
		{ t = "_", l = "MYSELF"},
		{ n = "me_use", l = "Show"},
			{ n = "me_name", l = "Show Name", o = 15},
			{ n = "me_health", l = "Show Health Bar", o = 15},
			{ n = "me_level", l = "Show Level", o = 15},
			{ n = "me_guild", l = "Show Guild", o = 15},
			{ n = "me_class", l = "Show Class", o = 15},
			{ n = "me_title", l = "Show Title", o = 15},
			{ n = "me_targName", l = "Show Target Name", o = 15},

		{ t = "_", l = "FRIENDLY"},
		{ n = "gp_use", l = "GROUP Show", ch = c_G,},
			{ n = "gp_name", l = "Show Name", ch = c_G, o = 15},
			{ n = "gp_health", l = "Show Health Bar", ch = c_G, o = 15},
			{ n = "gp_level", l = "Show Level", ch = c_G, o = 15},
			{ n = "gp_guild", l = "Show Guild", ch = c_G, o = 15},
			{ n = "gp_class", l = "Show Class", ch = c_G, o = 15},
			{ n = "gp_title", l = "Show Title", ch = c_G, o = 15},
			{ n = "gp_targName", l = "Show Target Name", ch = c_G, o = 15},
		{ n = "rd_use", l = "RAID Show", ch = c_G,},
			{ n = "rd_name", l = "Show Name", ch = c_G, o = 15},
			{ n = "rd_health", l = "Show Health Bar", ch = c_G, o = 15},
			{ n = "rd_level", l = "Show Level", ch = c_G, o = 15},
			{ n = "rd_guild", l = "Show Guild", ch = c_G, o = 15},
			{ n = "rd_class", l = "Show Class", ch = c_G, o = 15},
			{ n = "rd_title", l = "Show Title", ch = c_G, o = 15},
			{ n = "rd_targName", l = "Show Target Name", ch = c_G, o = 15},

		{ t = "_", l = "PLAYERS"},
		{ n = "fp_use", l = "Players Show", ch = c_F,},
			{ n = "fp_name", l = "Show Name", ch = c_F, o = 15},
			{ n = "fp_health", l = "Show Health Bar", ch = c_F, o = 15},
			{ n = "fp_level", l = "Show Level", ch = c_F, o = 15},
			{ n = "fp_guild", l = "Show Guild", ch = c_F, o = 15},
			{ n = "fp_class", l = "Show Class", ch = c_F, o = 15},
			{ n = "fp_title", l = "Show Title", ch = c_F, o = 15},
			{ n = "fp_targName", l = "Show Target Name", ch = c_F, o = 15},

		{ t = "_", l = "NPC|mobs"},
		{ n = "fn_use", l = "Show", ch = c_F,},
			{ n = "fn_name", l = "Show Name", ch = c_F, o = 15},
			{ n = "fn_health", l = "Show Health Bar", ch = c_F, o = 15},
			{ n = "fn_level", l = "Show Level", ch = c_F, o = 15},
			{ n = "fn_title", l = "Show Title", ch = c_F, o = 15},
			{ n = "fn_quality", l = "Show Quality", ch = c_F, o = 15},
			{ n = "fn_targName", l = "Show Target Name", ch = c_F, o = 15},

		{ t = "_", l = ""},
		{ t = "_", l = "AGGRESSIVE"},
		{ t = "_", l = "PLAYERS"},
		{ n = "ep_use", l = "Show", ch = c_E,},
			{ n = "ep_name", l = "Show Name", ch = c_E, o = 15},
			{ n = "ep_health", l = "Show Health Bar", ch = c_E, o = 15},
			{ n = "ep_level", l = "Show Level", ch = c_E, o = 15},
			{ n = "ep_guild", l = "Show Guild", ch = c_E, o = 15},
			{ n = "ep_class", l = "Show Class", ch = c_E, o = 15},
			{ n = "ep_title", l = "Show Title", ch = c_E, o = 15},
			{ n = "ep_targName", l = "Show Target Name", ch = c_E, o = 15},
		{ t = "_", l = "PLAYERS from My Fraction"},
		{ n = "epf_use", l = "Show", ch = c_E,},
			{ n = "epf_name", l = "Show Name", ch = c_E, o = 15},
			{ n = "epf_health", l = "Show Health Bar", ch = c_E, o = 15},
			{ n = "epf_level", l = "Show Level", ch = c_E, o = 15},
			{ n = "epf_guild", l = "Show Guild", ch = c_E, o = 15},
			{ n = "epf_class", l = "Show Class", ch = c_E, o = 15},
			{ n = "epf_title", l = "Show Title", ch = c_E, o = 15},
			{ n = "epf_targName", l = "Show Target Name", ch = c_E, o = 15},
		{ t = "_", l = "NPC|mobs"},
		{ n = "en_use", l = "Show", ch = c_E,},
			{ n = "en_name", l = "Show Name", ch = c_E, o = 15},
			{ n = "en_health", l = "Show Health Bar", ch = c_E, o = 15},
			{ n = "en_level", l = "Show Level", ch = c_E, o = 15},
			{ n = "en_title", l = "Show Title", ch = c_E, o = 15},
			{ n = "en_quality", l = "Show Quality", ch = c_E, o = 15},
			{ n = "en_targName", l = "Show Target Name", ch = c_E, o = 15},

		{ t = "_", l = "NEUTRAL"},
		{ t = "_", l = "PLAYERS"},
		{ n = "np_use", l = "Show", ch = c_N,},
			{ n = "np_name", l = "Show Name", ch = c_N, o = 15},
			{ n = "np_health", l = "Show Health Bar", ch = c_N, o = 15},
			{ n = "np_level", l = "Show Level", ch = c_N, o = 15},
			{ n = "np_guild", l = "Show Guild", ch = c_N, o = 15},
			{ n = "np_class", l = "Show Class", ch = c_N, o = 15},
			{ n = "np_title", l = "Show Title", ch = c_N, o = 15},
			{ n = "np_targName", l = "Show Target Name", ch = c_N, o = 15},
		{ t = "_", l = "NPC|mobs"},
		{ n = "nn_use", l = "Show", ch = c_N,},
			{ n = "nn_name", l = "Show Name", ch = c_N, o = 15},
			{ n = "nn_health", l = "Show Health Bar", ch = c_N, o = 15},
			{ n = "nn_level", l = "Show Level", ch = c_N, o = 15},
			{ n = "nn_title", l = "Show Title", ch = c_N, o = 15},
			{ n = "nn_quality", l = "Show Quality", ch = c_N, o = 15},
			{ n = "nn_targName", l = "Show Target Name", ch = c_N, o = 15},

		{ t = "_", l = ""},
		{ t = "_", l = "COMMON"},
		{ n = "qu_title", l = "QUEST Units Show Title", ch = c_C},
		{ n = "sizeX", l = "Size X", ch = c_C, type = "_edl" },
		{ n = "sizeY", l = "Size Y", ch = c_C, type = "_edl" },
		{ n = "sizeXHPcoeff", l = "Size X coeff", type = "_edl", ch = c_C, t=L("Coefficent for sizeX HP Bar") },
		{ n = "DamFlowCoeff", l = "Damage Flow coeff", type = "_edl", ch = c_C, t=L("Coefficent for flow of damage") },
		{ n = "fadeNPB", l = "Fade Panels", ch = c_C, type = "_edl"},
		{ n = "selMouse", l = "Select Unit under Mouse", ch = c_C, type = "_txt"},
		{ n = "iconPlace", l = "NPC Icon Place", ch = c_C, type = "_plc", o = 15},
		{ n = "classPlace", l = "Class|Quality Icon Place", ch = c_C, type = "_plc", o = 15},
		{ n = "deadDelay", l = "Off delay for dead", ch = c_C, type = "_edn", t=L("Switch off delay for dead") },
		{ n = "hpOff", l = "Off HP if >%", ch = c_C, type = "_edn", t=L("Switch off HP bar if HP>XX%") },
		
		--{ n = "clr_name", l = "Color Players Names as Class", ch = c_C,},
	}

local barsTab = {}
for i=1,19 do
	barsTab[i]=i
end

local function repaint()
	common.StateUnloadManagedAddon( "UserAddon/"..ADDONname )
	common.StateLoadManagedAddon( "UserAddon/"..ADDONname )
end
local function toConfig_RE()
	toConfig()
	repaint()
end
local function fromConfig_RE()
	fromConfig() --- тут это нужно чтобы затереть изменения, иначе он их созранит при выгрузке?
	repaint()
end
local function reset_PS_RE()
	reset_PS()
	toConfig_RE()
end

function GUIinit()
	local strucMenu = 
	{
		{ token = "_", label = "COMMANDS", },
		{ name = "load", label = "Load Settings", cmd=1, item_color = ccC, onClick = fromConfig_RE },
		{ name = "save", label = "Save Settings", cmd=1, item_color = ccC, onClick = toConfig_RE },
		{ token = "_", label = "SETTINGS", },
		--[[{ name = "locz", label = "Localize", valOnSet = setLocalize,
			type = "_txt", menuItems = loczList, offset = 15,
			tip = "" },


		{ name = "sjunk", label = "Auto Sell Junk",
			type = "_txt", valLabels = names, listVals = onoff },
		{ name = "wjunk", label = "Wipe Junk Cheaper",
			type = "_edl", chars=3, tip=L("Wipe junk items if its selling cost less then value") },
		{ name ="AUTOTARGETlist", label = "AUTOTARGET List", type ="_lst", 
			list = {
				itemSizeX = 300,
				type = "_txt", labels = allTypes, vals = sortVals, valLabels = names, defaultVal = SORT_ASC,
				edited = true, --- можно редактировать список
				numberKeys = true, --- список состоит из нумерованных списков - очередность элементов влияет на результаты и их можно менять местами
				},
			offset = 15, tip = L("Список панелей с типом сортировки для автоматического выбора цели") },
		]]
	}
	---table.sort( PSnames, function( A, B ) return A.l < B.l end )
	for _, v in pairs(PSnames) do
		if v.n then
			if v.type == "_edl" or v.type == "_edn" then
				table.insert(strucMenu, { name = v.n, label = v.l, offset=v.o, type = v.type, chars = 4, item_color_add = v.ch, tip = v.t } )
			elseif v.type == "_lst" then
				table.insert(strucMenu, { name = v.n, label = v.l, offset=v.o, type = v.type, item_color_add = v.ch, tip = v.t,
					list = {
					--itemSizeX = 300,
					type = "_edl",
					edited = true, --- можно редактировать список
					numberKeys = false, --- список состоит из нумерованных списков - очередность элементов влияет на результаты и их можно менять местами
					},
				} )
			elseif v.type == "_clr" or v.type == "_plc" then
				table.insert(strucMenu, { name = v.n, label = v.l, offset=v.o, type = v.type, item_color_add = v.ch, tip = v.t } )
			else
				table.insert(strucMenu, { name = v.n, label = v.l, offset=v.o, type = "_txt", item_color_add = v.ch, tip = v.t,
					defaultVal = v.def or ON, valLabels = v.valLabels or valLabels, listVals = v.listVals or onoff } )
			end
		else
			table.insert(strucMenu, { token = v.t, label = v.l } )
		end
	end

	local FrmtStruc = {}
	for k, v in pairs(fontFrmtItems) do
		table.insert(FrmtStruc, { token = v.t, name = v.n, label = v.l, type=v.n and "_fnt",
			item_color_add = v.ch, valueScale = 0.6, } )
	end
		table.insert( FrmtStruc, { token = "_3", label = "", })
		table.insert( FrmtStruc, { name = "n_as_l", label = "Name Style as Level", type = "_txt", listVals = onoff, item_color = ccC, })

	--exObj2("getWorldTextutes", getWorldTextutes() )
	addTable(strucMenu, {
		{ token = "_3", label = "", },
		{ name ="FONTS", label = "Font FORMATS", type ="_lst",
			---button_texture = common.GetAddonRelatedTexture("ButtonRegular1-Normal"),
			--button_texture = getWorldTextutes()["ButtonRegular1-Normal"],
			item_desc = dsc.Button,
			list = { name = "Font Settings", fadeVal = 0.0, 
				fadeOn = 300, fadeOff = 600,
				mouse_overRun = false,
				DnD = { fUseCfg=false, fLockedToScreenArea=false, Padding=nil },
				},
			strucMenu = FrmtStruc, --- создаст меню прямо из структуры
		},
		{ token = "_3", label = "", },
	})


	local FrmtStruc = {}
	for k, v in pairs(HBarsFrmtItems) do
		table.insert(FrmtStruc, { token = v.t, name = v.n, label = v.l, type=v.tp, offset=v.o } )
	end
	--exObj2("getWorldTextutes", getWorldTextutes() )
	addTable(strucMenu, {
		{ name ="HBARS", label = "HealthBars Styles", type ="_lst",
			---button_texture = common.GetAddonRelatedTexture("ButtonRegular1-Normal"),
			--button_texture = getWorldTextutes()["ButtonRegular1-Normal"],
			item_desc = dsc.Button,
			list = { name = "HealthBars Settings", fadeVal = 0.0,
				fadeOn = 300, fadeOff = 300,
				mouse_overRun = false,
				DnD = { fUseCfg=false, fLockedToScreenArea=false, Padding=nil },
				},
			strucMenu = FrmtStruc, --- создаст меню прямо из структуры
			--onSet = function( item ) LogToChat("HB") end,
		},
		{ token = "_3", label = "", },
	})

	--table.insert(strucMenu, { name = "myGNLClr", label = "Lining Color for My Guild Bars", offset=0, type = "_clr", tip = "" } )
	--table.insert(strucMenu, { name = "myGBLClr", label = "Lining Color for My Guild Names", offset=0, type = "_clr", tip = "" } )

	addTable(strucMenu, {
		-- загрузит старые настройки{ name = "repaint", label = "REPAINT", cmd=1, onClick = repaint },
		{ token = "_3", label = "------***------", },
		{ name = "prior", label = "Inteface Priority", item_color = ccC, type = "_edl", chars=5 },
		{ name = "reset", label = "Reset Settings", cmd=1, item_color = ccC, onClick = reset_PS_RE },
		{ name = "listPS", label = "List Settings to mods.txt", cmd=1, item_color = ccC, onClick = function() exObj2("PS",get_PS()) end },
		{ name ="listTexts", label =L("list Texts to mod.txt"), onClick = listTexts, item_color = ccC, tip="for translation - use after showing the entire interface" },
	} )

	mnu = menu{ strucMenu = strucMenu, priority = 5500, mouse_overRun = true,
		name = L("Settings"),
		fadeVal = 0.0, --- полностью гасить при открывании ребенка
		fadeOn = 300, fadeOff = 300,
		valGet = valGet, --- функция для получения значений для полей меню
		labelShapes = L, --- просто локализация
		valOnSet = valOnSet, --- функция, которая запомнит изменения сделанные пользователем и выполняет соотвествующие реакции
		valFormats = valFormats, --- форматы представления (цвет шрифт...) для разных значений
		valShapes = L, --- просто локализация
		itemSizeX = 300,
		RowsColsRate = 12,
	}
	mnu:init({ place = { posX = 0, posY = 0,  alignX=0, alignY=0 }})
	DnD:Init( mnu.wtMenu, mnu.wtMenu, true, { -600, -600, -600, -600 })

end

