Добрый день. Начал переводить программу, но наткнулся на проблему. Имеется файл JS. Нужно отредактировать небольшой кусок кода, а именно:
Код
AddComboParamOption("Левая"); AddComboParamOption("Средняя"); AddComboParamOption("Правая"); AddComboParam("Кнопка мыши", "Выберите кнопку мыши для проверки"); AddComboParamOption("Клик"); AddComboParamOption("Двойной-клик"); //AddComboParamOption("Однинарные или двойные клики"); AddComboParam("Тип клика", "Выберите тип мыши для проверки"); AddCondition(0, cf_trigger, "При клике", "Мышь", "При <b>{1}</b> <b>{0}</b> кнопки", "Срабатывает при клике или двойном-клике на кнопку мыши", "OnClick");
Есть небольшая проблема с этим. В <b>{0}</b> вводятся имена "Левая", "Средняя", "Правая". Мне же нужно чтоб вводилось "Левой", "Средней", "Правой". Как это можно исправить?
////////////////////////////////////////////////////////////// // Conditions AddComboParamOption("Левая"); AddComboParamOption("Средняя"); AddComboParamOption("Правая"); AddComboParam("Кнопка мыши", "Выберите кнопку мыши для проверки"); AddComboParamOption("Клик"); AddComboParamOption("Двойной-клик"); //AddComboParamOption("Однинарные или двойные клики"); AddComboParam("Тип клика", "Выберите тип мыши для проверки"); AddCondition(0, cf_trigger, "При клике", "Мышь", "При <b>{1}</b> <b>{0}</b> кнопки", "Срабатывает при клике или двойном-клике на кнопку мыши", "OnClick");
AddCondition(1, cf_trigger, "On any click", "Mouse", "On any click", "Triggered when any mouse button clicked or double-clicked.", "OnAnyClick");
AddComboParamOption("Левой"); AddComboParamOption("Средней"); AddComboParamOption("Правой"); AddComboParam("Кнопка мыши", "Выберите кнопку мыши для проверки"); AddCondition(2, 0, "Mouse button is down", "Mouse", "<b>{0}</b> button is down", "Test if a mouse button is currently held down.", "IsButtonDown");
AddComboParamOption("Левой"); AddComboParamOption("Средней"); AddComboParamOption("Правой"); AddComboParam("Кнопка мыши", "Выберите кнопку мыши для проверки"); AddCondition(3, cf_trigger, "On button released", "Mouse", "On <b>{0}</b> button released", "Triggered when a mouse button released.", "OnRelease");
//AddCondition(4, cf_trigger, "On wheel up", "Mouse", "On wheel up", "Triggered when the mouse wheel rolled up.", "OnWheelUp"); //AddCondition(5, cf_trigger, "On wheel down", "Mouse", "On wheel down", "Triggered when the mouse wheel rolled down.", "OnWheelDown");
AddComboParamOption("Левой"); AddComboParamOption("Средней"); AddComboParamOption("Правой"); AddComboParam("Кнопка мыши", "Выберите кнопку мыши для проверки"); AddComboParamOption("Клик"); AddComboParamOption("Двойной-клик"); //AddComboParamOption("Either single or double clicked"); AddComboParam("Click type", "Select which kind of click to check for."); AddObjectParam("Object clicked", "Choose the object to check for a click on."); AddCondition(6, cf_trigger, "При клике на объекте", "Mouse", "При <b>{1}</b> <b>{0}</b> кнопки мыши на {2}", "Triggered when a mouse button clicked or double-clicked on an object.", "OnObjectClicked");
AddObjectParam("Object", "Choose the object to check for mouse over."); AddCondition(7, 0, "Cursor is over object", "Mouse", "Cursor is over {0}", "Check if the mouse cursor is over an object.", "IsOverObject");
AddComboParamOption("down"); AddComboParamOption("up"); AddComboParam("Direction", "Select which direction to detect the mouse wheel scrolling."); AddCondition(8, cf_trigger, "On mouse wheel", "Mouse", "On mouse wheel {0}", "Triggered when the mouse wheel is scrolled.", "OnWheel");
////////////////////////////////////////////////////////////// // Actions AddComboParamOption("Normal"); AddComboParamOption("Hand"); AddComboParamOption("Text select"); AddComboParamOption("Crosshair"); AddComboParamOption("Move"); AddComboParamOption("Help"); AddComboParamOption("Wait"); AddComboParamOption("None"); AddComboParam("Cursor style", "Choose the cursor style to set."); AddAction(0, 0, "Set cursor style", "Mouse", "Set cursor to <b>{0}</b>", "Change the style of the mouse cursor.", "SetCursor");
AddObjectParam("Sprite", "Choose a Sprite object to use as the cursor image."); AddAction(1, 0, "Set cursor from sprite", "Mouse", "Set cursor from sprite {0}", "Set the mouse cursor to the same image used by a Sprite.", "SetCursorSprite");
////////////////////////////////////////////////////////////// // Expressions AddExpression(0, ef_return_number | ef_variadic_parameters, "Mouse X position", "Cursor", "X", "Get the mouse cursor X co-ordinate in the layout."); AddExpression(1, ef_return_number | ef_variadic_parameters, "Mouse Y position", "Cursor", "Y", "Get the mouse cursor Y co-ordinate in the layout.");
AddExpression(2, ef_return_number, "Absolute mouse X", "Cursor", "AbsoluteX", "Get the mouse cursor X co-ordinate on the canvas."); AddExpression(3, ef_return_number, "Absolute mouse Y", "Cursor", "AbsoluteY", "Get the mouse cursor Y co-ordinate on the canvas.");
ACESDone();
// Property grid properties for this plugin var property_list = [ ];
// Called by IDE when a new object type is to be created function CreateIDEObjectType() { return new IDEObjectType(); }
// Class representing an object type in the IDE function IDEObjectType() { assert2(this instanceof arguments.callee, "Constructor called as a function"); }
// Called by IDE when a new object instance of this type is to be created IDEObjectType.prototype.CreateInstance = function(instance) { return new IDEInstance(instance, this); }
// Class representing an individual instance of an object in the IDE function IDEInstance(instance, type) { assert2(this instanceof arguments.callee, "Constructor called as a function");
// Save the constructor parameters this.instance = instance; this.type = type;
// Set the default property values from the property table this.properties = {};
for (var i = 0; i < property_list.length; i++) this.properties[property_list[i].name] = property_list[i].initial_value; }
// Called by the IDE after all initialization on this instance has been completed IDEInstance.prototype.OnCreate = function() { }
// Called by the IDE after a property has been changed IDEInstance.prototype.OnPropertyChanged = function(property_name) { }
// Called by the IDE to draw this instance in the editor IDEInstance.prototype.Draw = function(renderer) { }
// Called by the IDE when the renderer has been released (ie. editor closed) // All handles to renderer-created resources (fonts, textures etc) must be dropped. // Don't worry about releasing them - the renderer will free them - just null out references. IDEInstance.prototype.OnRendererReleased = function([/spoiler]) { }
Сообщение отредактировал Dark_Nir - Пятница, 08.02.2013, 19:25
Есть небольшая проблема с этим. В <b>{0}</b> вводятся имена "Левая", "Средняя", "Правая". Мне же нужно чтоб вводилось "Левой", "Средней", "Правой". Как это можно исправить?
likbezz, нет, я это понимаю. Мне же нужно чтоб сначала было "Левая", а потом "Левой". То есть вот пример. У меня появляется окно в котором написано "Выбор клавиши мыши - Левая" А после выбора в другом окне появляется надпись "При щелчке по Левая кнопки мыши", что звучит как-то не очень. Так вот мне и надо чтоб после выбора клавиши, надпись "Левая" менялась на "Левой"
Добавлено (08.02.2013, 20:31) --------------------------------------------- likbezz, так вот как это сделать? А то я JS не знаю Приведи единичный пример, с "Левая", а дальше сам разберусь, и подставлю.