Войти на сайт

Авторизация, ждите ...
×
Правила раздела:
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.

ТЕМА: Проблема с плагином

Проблема с плагином 12 ч. 53 мин. назад #130871

  • spbker
  • spbker аватар
  • Вне сайта
  • Мастер
  • Сообщений: 172
  • Спасибо получено: 34
  • Проект месяца 3 местоПроект месяца 2 место
Плагин N_StartFullscreen. Так-же добавляет в меню "выход". При переименовании на русский язык в мейкере ничего не меняется. Переименование в скрипте, то появляются "вопросики". Как исправить?


ВНИМАНИЕ: Спойлер! [ Нажмите, чтобы развернуть ]


ВНИМАНИЕ: Спойлер! [ Нажмите, чтобы развернуть ]
(() => {
    const PLUGIN_NAME = "N_StartFullscreen";
 
    const parameters = PluginManager.parameters(PLUGIN_NAME);
    parameters.textExit = parameters.textExit || "Exit";
    parameters.textToDesktop = parameters.textToDesktop || "Exit to desktop";
 
    // Backport Array.remove() from MZ to MV
    if (!Array.prototype.remove) {
        Array.prototype.remove = function (element) {
            for (; ;) {
                const index = this.indexOf(element);
                if (index >= 0) {
                    this.splice(index, 1);
                } else {
                    return this;
                }
            }
        };
    };
 
    const Scene_Boot_start = Scene_Boot.prototype.start;
    Scene_Boot.prototype.start = function () {
        Scene_Boot_start.call(this);
        Graphics._requestFullScreen();
    };
 
    // Add "Exit" command to Window_TitleCommand and Window_GameEnd.
    const symbol = "exit";
    const makeCommandList_old = {};
    for (const window of [Window_TitleCommand, Window_GameEnd]) {
        makeCommandList_old[window.name] = window.prototype.makeCommandList;
        window.prototype.makeCommandList = function () {
            makeCommandList_old[this.constructor.name].call(this);
 
            const exitText = {
                [Window_TitleCommand.name]: parameters.textExit,
                [Window_GameEnd.name]: parameters.textToDesktop
            }[this.constructor.name];
            this.addCommand(exitText, symbol);
            if (this instanceof Window_GameEnd) {
                // Move "Cancel" option to bottom.
                const command = this._list.find(cmd => cmd.symbol === "cancel");
                this._list.remove(command);
                this._list.push(command);
            }
        };
    }
    // Must set command handlers separately for Scene_Title and Scene_GameEnd.
    const createCommandWindow_old = {};
    const commandWindowRect_old = {};
    for (const scene of [Scene_Title, Scene_GameEnd]) {
        const key = scene.name;
        createCommandWindow_old[key] = scene.prototype.createCommandWindow;
        scene.prototype.createCommandWindow = function () {
            createCommandWindow_old[this.constructor.name].call(this);
 
            this._commandWindow.setHandler(symbol, exitGame);
            // Reset command window.
            this._windowLayer.removeChild(this._commandWindow);
            this.addWindow(this._commandWindow);
        };
        commandWindowRect_old[key] = scene.prototype.commandWindowRect;
        scene.prototype.commandWindowRect = function () {
            const rect = commandWindowRect_old[this.constructor.name].call(this);
            // Adding the equivalent of 1 additional line of height.
            // We compute (3 lines - 2 lines) just in case the first
            // and last line have a different height.
            rect.height += this.calcWindowHeight(3, true) - this.calcWindowHeight(2, true);
            return rect;
        };
    }
 
    function exitGame() {
        nw.App.quit();
    }
})();
Администратор запретил публиковать записи гостям.
Время создания страницы: 0.234 секунд