Ковыряясь в скрипте
WSH digital VU meter 2by eXtremeHunter1972 в течении недели заметил несколько интересных вещей: 1) Нагрузка на процессор в стандартном режиме
"Solid Level" напрочь отсутствует (2-5-7%), но при отключении режима
"Solid Level" нагрузка возрастает пропорционально значению
"Thickness -> Level Line" минимальное значение
1 - нагрузка увеличивается на 40 - 55%, при уменьшении этого числа от 2 до 10 нагрузка падает, при значении 10 опять фактически равна нулю.
2) Режим
"Offset" по умолчанию
-10 напрямую контролирует функцию
preamp , что не очень удобно(у меня стоит +9 и все ву метры попадают в ноль), а в режиме настроек
VU Meter - Automatic gain control так вообще скачущие цифры, меня просто добивали.
Но дело в следующем, нужна помощь! Так как моё исправление скриптов похоже на старую добрую игру "сапёр" - поставил запятую или кавычки - ок - работает - Ура!, или Aw, crashed:( - Game Over - начинай сначала. Пока в ступоре, не могу назначить производную на замену цвета для "Color -> Level Preset".
kgena_ua,
macarych, может подсобите? Меню и сами пресеты уже готовы.
- Код: Выделить всё
// ==PREPROCESSOR==
// ======================== //
// @name "digital VU meter 2 (06.June.2012)"
// @author "jscript by Hunter >> http://extremehunter1972.deviantart.com /
// WSH Panel Mod component by Tianpeng Wang
// VU Meter component by DRON
// Modifed AHAPXICT for DarkOne v4.0 by tedGo
// ==/PREPROCESSOR==
// Requirements:
// foobar2000_v1.1 or better >> http://foobar2000.org
// WSH panel Mod v1.5.3.1 or better >> http://code.google.com/p/foo-wsh-panel-mod/downloads/list
// VU Meter 2012-06-05 or better >> http://foobar2000.org.ru/forum/
// Script with some examples here http://browse.deviantart.com/customization/skins/media/foobar2000/#/d51whqw
// ======================= //
function RGBA(r, g, b, a) {
return ((a << 24) | (r << 16) | (g << 8) | (b));
}
function RGB(r, g, b) {
return (0xff000000 | (r << 16) | (g << 8) | (b));
}
function StringFormat() {
var h_align = 0,
v_align = 0,
trimming = 0,
flags = 0;
switch (arguments.length) {
case 4:
flags = arguments[3];
case 3:
trimming = arguments[2];
case 2:
v_align = arguments[1];
case 1:
h_align = arguments[0];
break;
default:
return 0;
}
return ((h_align << 28) | (v_align << 24) | (trimming << 20) | flags);
}
VK_UP = 0x26;
VK_DOWN = 0x28;
VK_CONTROL = 0x11;
DLGC_WANTARROWS = 0x0001;
MF_SEPARATOR = 0x00000800;
MF_STRING = 0x00000000;
window.DlgCode = DLGC_WANTARROWS;
VUMeter = new ActiveXObject("VUMeter");
VUMeter.RegisterWindow(window.ID);
// ======================= //
(function init() {
VUMeter.Offset = window.GetProperty("Offset", -10);
})();
// ======================= //
function createImage() {
if (ww <= 0 || wh <= 0) return;
var minWidth = minHeight = 20;
window.MinWidth = minWidth;
orientation = "V";
if (window.GetProperty("Orientation", "Vertical") == "Horizontal") orientation = "H";
leftMargin = (orientation == "V" ? window.GetProperty("Margin -> Vertical Left", 0) : window.GetProperty("Margin -> Horizontal Left", 11));
topMargin = window.GetProperty("Margin -> Top ", 0);
bottomMargin = (orientation == "V" ? window.GetProperty("Margin -> Vertical Bottom", 10) : window.GetProperty("Margin -> Horizontal Bottom", 0));
rightMargin = window.GetProperty("Margin -> Right", 0);
centerPadding = window.GetProperty("Padding -> Center", 4);
peakLevelPadding = window.GetProperty("Padding -> Peak <-> Level ", 6);
levelLineThickness = window.GetProperty("Thickness -> Level Line", 1);
if (levelLineThickness < 1) {
window.SetProperty("Thickness -> Level Line", 1);
levelLineThickness = 1;
}
peakLineThickness = window.GetProperty("Thickness -> Peak Line", 3);
peakHeight = peakLineThickness;
if (orientation == "V") {
leftPeakX = Math.floor(ww / 2) - peakLineThickness - centerPadding;
rightPeakX = Math.floor(ww / 2) + centerPadding;
leftPeakY = topMargin;
rightPeakY = topMargin;
leftLevelX = leftMargin;
rightLevelX = rightPeakX + peakLineThickness + peakLevelPadding;
leftLevelWidth = leftPeakX - peakLevelPadding - leftMargin;
rightLevelWidth = ww - rightLevelX - leftLevelX;
leftLevelY = topMargin;
rightLevelY = topMargin;
leftLevelWidth = leftPeakX - peakLevelPadding - leftLevelX;
rightLevelWidth = ww - rightMargin - rightLevelX;
} else if (orientation == "H") {
leftPeakX = leftMargin;
leftPeakY = Math.floor(wh / 2) - peakHeight - centerPadding;
leftPeakHeight = window.GetProperty("Thickness -> Peak Line", 20);
rightPeakHeight = leftPeakHeight;
rightPeakX = leftMargin;
rightPeakY = Math.floor(wh / 2) + centerPadding;
leftLevelX = leftMargin;
rightLevelX = leftMargin;
leftLevelWidth = leftPeakX - peakLevelPadding - leftLevelX;
rightLevelWidth = ww - rightLevelX - leftLevelX;
leftLevelX = leftMargin;
rightLevelX = leftMargin;
leftLevelY = topMargin;
rightLevelY = rightPeakY + peakHeight + peakLevelPadding;
leftLevelWidth = leftPeakX - peakLevelPadding - leftLevelX;
rightLevelWidth = wh - rightLevelX - leftLevelX;
leftLevelHeight = leftPeakY - peakLevelPadding - topMargin;
rightLevelHeight = wh - bottomMargin - rightLevelY;
}
switch (window.GetProperty("Color -> Peak Preset", "Peak Default")) {
case "Peak Default":
peakGradient1 = eval(window.GetProperty("Color -> Peak Default Gradient 1", "RGBA(95,114,127,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak Default Gradient 2", "RGBA(191,228,255,255)"));
id_p = 1;
break;
case "Peak Blue":
peakGradient1 = eval(window.GetProperty("Color -> Peak Blue Gradient 1", "RGBA(65,97,127,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak Blue Gradient 2", "RGBA(128,192,255,255)"));
id_p = 2;
break;
case "Peak Green":
peakGradient1 = eval(window.GetProperty("Color -> Peak Green Gradient 1", "RGBA(0,76,0,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak Green Gradient 2", "RGB(0,255,0,255)"));
id_p = 3;
break;
case "Peak Red":
peakGradient1 = eval(window.GetProperty("Color -> Peak Red Gradient 1", "RGBA(76,0,0,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak Red Gradient 2", "RGBA(255,0,0,255)"));
id_p = 4;
break;
case "Peak White":
peakGradient1 = eval(window.GetProperty("Color -> Peak White Gradient 1", "RGBA(76,76,76,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak White Gradient 2", "RGBA(255,255,255,255)"));
id_p = 5;
break;
case "Peak Yellow":
peakGradient1 = eval(window.GetProperty("Color -> Peak Yellow Gradient 1", "RGBA(76,76,0,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak Yellow Gradient 2", "RGBA(255,255,0,255)"));
id_p = 6;
break;
case "Custom Peak Color":
peakGradient1 = eval(window.GetProperty("Color -> Peak Custom Gradient 1", "RGBA(20,32,40,255)"));
peakGradient2 = eval(window.GetProperty("Color -> Peak Custom Gradient 2", "RGBA(63,100,127,255)"));
id_p = 7;
break;
default:
id_p = 1;
}
switch (window.GetProperty("Color -> Level Preset", "Level Default")){
case "Level Default":
LevelGradient1 = eval(window.GetProperty("Color -> Level Default Gradient 1", "RGBA(95,114,127,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level Default Gradient 2", "RGBA(191,228,255,255)"));
id_l = 8;
break;
case "Level Blue":
LevelGradient1 = eval(window.GetProperty("Color -> Level Blue Gradient 1", "RGBA(65,97,127,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level Blue Gradient 2", "RGBA(128,192,255,255)"));
id_l = 9;
break;
case "Level Green":
LevelGradient1 = eval(window.GetProperty("Color -> Level Green Gradient 1", "RGBA(0,76,0,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level Green Gradient 2", "RGB(0,255,0,255)"));
id_l = 10;
break;
case "Level Red":
LevelGradient1 = eval(window.GetProperty("Color -> Level Red Gradient 1", "RGBA(76,0,0,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level Red Gradient 2", "RGB(255,0,0,255)"));
id_l = 11;
break;
case "Level White":
LevelGradient1 = eval(window.GetProperty("Color -> Level White Gradient 1", "RGBA(76,76,76,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level White Gradient 2", "RGB(255,255,255,255)"));
id_l = 12;
break;
case "Level Yellow":
LevelGradient1 = eval(window.GetProperty("Color -> Level Yellow Gradient 1", "RGBA(76,76,0,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level Yellow Gradient 2", "RGB(255,255,0,255)"));
id_l = 13;
break;
case "Custom Level Color":
LevelGradient1 = eval(window.GetProperty("Color -> Level Custom Gradient 1", "RGBA(20,32,40,255)"));
LevelGradient2 = eval(window.GetProperty("Color -> Level Custom Gradient 2", "RGBA(63,100,127,255)"));
id_l = 14;
break;
default:
id_l = 8;
}
//var levelGradient1 = eval(window.GetProperty("Color -> Level Gradient 1", "Level Default"));
//var levelGradient2 = eval(window.GetProperty("Color -> Level Gradient 2", "Level Default"));
levelGradient1 = eval(window.GetProperty("Color -> Level Gradient 1", "RGBA(65,97,127,255)"));
levelGradient2 = eval(window.GetProperty("Color -> Level Gradient 2", "RGBA(128,192,255,255)"));
backgroundColor = eval(window.GetProperty("Color -> Background", "RGB(19,30,38)"));
//---> create image mask
var mask = gdi.CreateImage(ww, wh);
var _grMask = mask.GetGraphics();
_grMask.FillSolidRect(0, 0, ww, wh, 0xFF000000);
if (orientation == "V") {
count = Math.floor((wh - topMargin - bottomMargin) / levelLineThickness);
} else if (orientation == "H") {
count = Math.floor((ww - leftMargin - rightMargin) / levelLineThickness);
} else count = 0;
peakWidth = peakLineThickness;
peakHeight = peakLineThickness;
var levelBackgroundGrad1 = eval(window.GetProperty("Color -> Level Background Gradient 1", "RGBA(22,34,42,255)"));
var levelBackgroundGrad2 = eval(window.GetProperty("Color -> Level Background Gradient 2", "RGBA(40,52,63,255)"));
var leftLevelBackgroundFocus = eval(window.GetProperty("Focus -> Level Background Left Gradient", "0.5"));
var rightLevelBackgroundFocus = eval(window.GetProperty("Focus -> Level Background Right Gradient", "0.5"));
var angle = orientation == "V" ? 0 : 90;
levelLineBackgroundImg = gdi.CreateImage(ww, wh);
_grLBI = levelLineBackgroundImg.GetGraphics();
for (var i = 0; i < count; i++) {
if (window.GetProperty("Solid Level", true) ? true : !(i % 2)) {
if (orientation == "V") {
_grMask.FillSolidRect(leftLevelX, levelLineThickness * i + leftLevelY, leftLevelWidth, levelLineThickness, 0xFFFFFFFF);
_grMask.FillSolidRect(rightLevelX, levelLineThickness * i + leftLevelY, rightLevelWidth, levelLineThickness, 0xFFFFFFFF);
_grLBI.FillGradRect(leftLevelX - 2, levelLineThickness * i + leftLevelY, leftLevelWidth + 4, levelLineThickness, angle, levelBackgroundGrad1, levelBackgroundGrad2, leftLevelBackgroundFocus);
_grLBI.FillGradRect(rightLevelX - 2, levelLineThickness * i + leftLevelY, rightLevelWidth + 4, levelLineThickness, angle, levelBackgroundGrad1, levelBackgroundGrad2, rightLevelBackgroundFocus);
peakHeight = (i + 1) * levelLineThickness;
}
if (orientation == "H") {
_grMask.FillSolidRect(levelLineThickness * i + leftLevelX, leftLevelY, levelLineThickness, leftLevelHeight, 0xFFFFFFFF);
_grMask.FillSolidRect(levelLineThickness * i + rightLevelX, rightLevelY, levelLineThickness, leftLevelHeight, 0xFFFFFFFF);
_grLBI.FillGradRect(levelLineThickness * i + leftLevelX, leftLevelY - 2, levelLineThickness, leftLevelHeight + 4, angle, levelBackgroundGrad1, levelBackgroundGrad2, rightLevelBackgroundFocus);
_grLBI.FillGradRect(levelLineThickness * i + rightLevelX, rightLevelY - 2, levelLineThickness, leftLevelHeight + 4, angle, levelBackgroundGrad1, levelBackgroundGrad2, rightLevelBackgroundFocus);
peakWidth = (i + 1) * levelLineThickness;
}
}
}
_grMask.FillSolidRect(leftPeakX, leftPeakY, peakWidth, peakHeight, 0xFFFFFFFF);
_grMask.FillSolidRect(rightPeakX, rightPeakY, peakWidth, peakHeight, 0xFFFFFFFF);
levelLineBackgroundImg.ReleaseGraphics(_grLBI);
mask.ReleaseGraphics(_grMask)
//---> create image
img = gdi.CreateImage(ww, wh);
_gr = img.GetGraphics();
_gr.FillSolidRect(0, 0, ww, wh, backgroundColor);
img.ReleaseGraphics(_gr);
//---> apply mask to image
var mask = mask.Resize(ww, wh);
img.ApplyMask(mask);
mask.Dispose();
peakLineBackgroundImg = gdi.CreateImage(ww, wh);
_gr = peakLineBackgroundImg.GetGraphics();
var angle = 0;
if (orientation == "H") {
angle = window.GetProperty("Angle -> Peak Background Horizontal", 90);
}
if (orientation == "V") {
angle = window.GetProperty("Angle -> Peak Background Vertical", angle);
}
var leftPeakBackgroundFocus = eval(window.GetProperty("Focus -> Peak Background Left", "0.5"));
var rightPeakBackgroundFocus = eval(window.GetProperty("Focus -> Peak Background Right", "0.5"));
var grad1 = eval(window.GetProperty("Color -> Peak Background Gradient 1", "RGBA(20,32,40,255)"));
var grad2 = eval(window.GetProperty("Color -> Peak Background Gradient 2", "RGBA(35,47,58,255)"));
_gr.FillGradRect(leftPeakX - 2, leftPeakY - 2, peakWidth + 4, peakHeight + 4, angle, grad1, grad2, leftPeakBackgroundFocus);
_gr.FillGradRect(rightPeakX - 2, rightPeakY - 2, peakWidth + 4, peakHeight + 4, angle, grad1, grad2, rightPeakBackgroundFocus);
peakLineBackgroundImg.ReleaseGraphics(_gr);
}
// ================= //
function on_paint(gr) {
if (wh > minHeight) {
gr.DrawImage(peakLineBackgroundImg, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gr.DrawImage(levelLineBackgroundImg, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
var swapLevelPeak = window.GetProperty("Swap -> Peak with Level");
if (swapLevelPeak) {
$leftPeak = VUMeter.LeftLevel;
$rightPeak = VUMeter.RightLevel;
$leftLevel = VUMeter.LeftPeak;
$rightLevel = VUMeter.RightPeak;
} else {
$leftLevel = VUMeter.LeftLevel;
$rightLevel = VUMeter.RightLevel;
$leftPeak = VUMeter.LeftPeak;
$rightPeak = VUMeter.RightPeak;
}
var flipLevel = window.GetProperty("Flip -> Level", false);
var flipPeak = window.GetProperty("Flip -> Peak", false);
if (orientation == "V") {
var bottomM = (wh - bottomMargin);
if (!flipPeak) {
leftPeakY = bottomM - bottomM * $leftPeak + topMargin;
rightPeakY = bottomM - bottomM * $rightPeak + topMargin;
}
leftPeakHeight = bottomM * $leftPeak - topMargin;
rightPeakHeight = bottomM * $rightPeak - topMargin;
leftPeakWidth = peakLineThickness;
rightPeakWidth = peakLineThickness;
if (!flipLevel) {
leftLevelY = bottomM - bottomM * $leftLevel + topMargin;
rightLevelY = bottomM - bottomM * $rightLevel + topMargin;
}
leftLevelHeight = bottomM * $leftLevel - topMargin;
rightLevelHeight = bottomM * $rightLevel - topMargin;
}
if (orientation == "H") {
var rightM = ww - rightMargin;
leftPeakWidth = rightM * $leftPeak - leftMargin;
rightPeakWidth = rightM * $rightPeak - leftMargin;
leftPeakHeight = peakLineThickness;
rightPeakHeight = peakLineThickness;
leftLevelWidth = rightM * $leftLevel - leftMargin;
rightLevelWidth = rightM * $rightLevel - leftMargin;
if (flipPeak) {
leftPeakX = rightM - rightM * $leftPeak + leftMargin;
rightPeakX = rightM - rightM * $rightPeak + leftMargin;
}
if (flipLevel) {
leftLevelX = rightM - rightM * $leftLevel + leftMargin;
rightLevelX = rightM - rightM * $rightLevel + leftMargin;
}
}
var angle = orientation == "V" ? 0 : 90;
var leftPeakGradientFocus = eval(window.GetProperty("Focus -> Peak Left Gradient", "0.5"));
var rightPeakGradientFocus = eval(window.GetProperty("Focus -> Peak Right Gradient", "0.5"));
var leftLevelGradientFocus = eval(window.GetProperty("Focus -> Level Left Gradient", "0.5"));
var rightLevelGradientFocus = eval(window.GetProperty("Focus -> Level Right Gradient", "0.5"));
gr.FillGradRect(leftPeakX - 2, leftPeakY - 2, leftPeakWidth + 4, leftPeakHeight + 4, angle, peakGradient1, peakGradient2, leftPeakGradientFocus);
gr.FillGradRect(rightPeakX - 2, rightPeakY - 2, rightPeakWidth + 4, rightPeakHeight + 4, angle, peakGradient1, peakGradient2, rightPeakGradientFocus);
gr.FillGradRect(leftLevelX - 2, leftLevelY - 2, leftLevelWidth + 4, leftLevelHeight + 4, angle, levelGradient1, levelGradient2, leftPeakGradientFocus);
gr.FillGradRect(rightLevelX - 2, rightLevelY - 2, rightLevelWidth + 4, rightLevelHeight + 4, angle, levelGradient1, levelGradient2, rightPeakGradientFocus);
gr.DrawImage(img, 0, 0, ww, wh, 0, 0, ww, wh, 0, 255);
gr.SetTextRenderingHint(5);
var levelFont = gdi.font("Small Fonts", 7, 0);
var channelFont = gdi.font("Tahoma", 10, 1);
var channelColor = eval(window.GetProperty("Color -> Text Channels", "RGBA(191,228,255,255)"));
var SF = StringFormat(1, 1);
if (orientation == "V") {
channelLWidth = gr.CalcTextWidth("O", channelFont);
channelLX = (ww / 2) / 2 - channelLWidth;
channelRX = ww - (ww / 4);
channelLY = bottomM - 1;
channelRY = bottomM - 1;
channelRWidth = channelLWidth;
channelLHeight = wh - bottomM;
channelRHeight = wh - bottomM;
offsetX = 0;
offsetY = bottomM;
offsetWidth = ww;
offsetHeight = wh - bottomM - 1;
}
if (orientation == "H") {
channelLHeight = gr.CalcTextHeight("O", channelFont);
channelLX = 0;
channelRX = 0;
channelLY = (wh / 2) / 2 - channelLHeight / 2;
channelRY = wh - (wh / 4) - channelLHeight / 2;
channelLWidth = leftMargin;
channelRWidth = leftMargin;
channelRHeight = channelLHeight;
offsetX = 0;
offsetY = 1;
offsetWidth = leftMargin - 0;
offsetHeight = wh;
}
gr.DrawString(VUMeter.Offset,levelFont, eval(window.GetProperty("Color -> Text Offset", "RGBA(206,206,206,0)")), offsetX, offsetY, offsetWidth, offsetHeight, SF);
if (ww > channelLWidth * 5 && wh > channelLHeight * 3) {
gr.DrawString("L", channelFont, channelColor, channelLX, channelLY, channelLWidth, channelLHeight, SF);
gr.DrawString("R", channelFont, channelColor, channelRX, channelRY, channelRWidth, channelRHeight, SF);
}
}
}
// ======================= //
function on_size() {
ww = window.Width;
wh = window.Height;
createImage();
}
// ======================= //
function on_mouse_wheel(step) {
if (utils.IsKeyPressed(VK_CONTROL)) window.SetProperty("Offset", VUMeter.Offset + step);
init();
}
// ======================= //
function on_key_down(vkey) {
if (vkey == VK_UP) on_mouse_wheel(1);
if (vkey == VK_DOWN) on_mouse_wheel(-1);
}
// ======================= //
function on_mouse_rbtn_up(x, y) {
var _menu = window.CreatePopupMenu();
_menu.AppendMenuItem(MF_STRING, 1, "Peak Default");
_menu.AppendMenuItem(MF_STRING, 2, "Peak Blue");
_menu.AppendMenuItem(MF_STRING, 3, "Peak Green");
_menu.AppendMenuItem(MF_STRING, 4, "Peak Red");
_menu.AppendMenuItem(MF_STRING, 5, "Peak White");
_menu.AppendMenuItem(MF_STRING, 6, "Peak Yellow")
_menu.AppendMenuItem(MF_STRING, 7, "Peak Custom")
_menu.CheckMenuRadioItem(1, 7, id_p);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 8, "Level Default");
_menu.AppendMenuItem(MF_STRING, 9, "Level Blue");
_menu.AppendMenuItem(MF_STRING, 10, "Level Green");
_menu.AppendMenuItem(MF_STRING, 11, "Level Red");
_menu.AppendMenuItem(MF_STRING, 12, "Level White");
_menu.AppendMenuItem(MF_STRING, 13, "Level Yellow")
_menu.AppendMenuItem(MF_STRING, 14, "Level Custom")
_menu.CheckMenuRadioItem(8, 14, id_l);
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 15, window.GetProperty("Orientation") == "Horizontal" ? "Vertical" : "Horizontal");
_menu.AppendMenuItem(MF_STRING, 16, "Flip Peak");
_menu.CheckMenuItem(16, window.GetProperty("Flip -> Peak", false));
_menu.AppendMenuItem(MF_STRING, 17, "Flip Level");
_menu.CheckMenuItem(17, window.GetProperty("Flip -> Level", false));
_menu.AppendMenuItem(MF_STRING, 18, "Swap -> Peak with Level");
_menu.CheckMenuItem(18, window.GetProperty("Swap -> Peak with Level", false));
_menu.AppendMenuItem(MF_STRING, 19, "Solid Level");
_menu.CheckMenuItem(19, window.GetProperty("Solid Level", false));
_menu.AppendMenuItem(MF_SEPARATOR, 0, 0);
_menu.AppendMenuItem(MF_STRING, 20, "Properties...");
_menu.AppendMenuItem(MF_STRING, 21, "Configure...");
idx = _menu.TrackPopupMenu(x, y);
switch (idx) {
case 1:
window.SetProperty("Color -> Peak Preset", "Peak Default");
createImage();
break;
case 2:
window.SetProperty("Color -> Peak Preset", "Peak Blue");
createImage();
break;
case 3:
window.SetProperty("Color -> Peak Preset", "Peak Green");
createImage();
break;
case 4:
window.SetProperty("Color -> Peak Preset", "Peak Red");
createImage();
break;
case 5:
window.SetProperty("Color -> Peak Preset", "Peak White");
createImage();
break;
case 6:
window.SetProperty("Color -> Peak Preset", "Peak Yellow");
createImage();
break;
case 7:
window.SetProperty("Color -> Peak Preset", "Custom Peak Color");
createImage();
break;
case 8:
window.SetProperty("Color -> Level Preset", "Level Default");
createImage();
break;
case 9:
window.SetProperty("Color -> Level Preset", "Level Blue");
createImage();
break;
case 10:
window.SetProperty("Color -> Level Preset", "Level Green");
createImage();
break;
case 11:
window.SetProperty("Color -> Level Preset", "Level Red");
createImage();
break;
case 12:
window.SetProperty("Color -> Level Preset", "Level White");
createImage();
break;
case 13:
window.SetProperty("Color -> Level Preset", "Level Yellow");
createImage();
break;
case 14:
window.SetProperty("Color -> Level Preset", "Custom Level Color");
createImage();
break;
case 15:
window.SetProperty("Orientation", window.GetProperty("Orientation") == "Vertical" ? "Horizontal" : "Vertical");
createImage();
break;
case 16:
window.SetProperty("Flip -> Peak", window.GetProperty("Flip -> Peak") ? false : true);
createImage();
break;
case 17:
window.SetProperty("Flip -> Level", window.GetProperty("Flip -> Level") ? false : true);
createImage();
break;
case 18:
window.SetProperty("Swap -> Peak with Level", window.GetProperty("Swap -> Peak with Level") ? false : true);
createImage();
break;
case 19:
window.SetProperty("Solid Level", window.GetProperty("Solid Level") ? false : true);
createImage();
break;
case 20:
window.ShowProperties();
break;
case 21:
window.ShowConfigure();
break;
}
_menu.Dispose();
return true
}
// ======================= //
P.S.
kgena_ua, благодаря этому скрипту таки разобрался с меню лайаут, туда нужно было добавить строку
a.CheckMenuRadioItem(1, 3, fb.RunMainMenuCommand("View/Layout") + 1); и появилась точка, так как это меню на каждой активной теме своё, то значение +1 для первой, менял на + 3 для третьей.