Показано с 1 по 10 из 19

Тема: Уроки от DK

Комбинированный просмотр

Предыдущее сообщение Предыдущее сообщение   Следующее сообщение Следующее сообщение
  1. #1
    Хранитель Аватар для Темный
    Информация о пользователе
    Регистрация
    13.05.2011
    Сообщений
    2,449
    Записей в дневнике
    20
    Репутация: 50 Добавить или отнять репутацию

    По умолчанию

    Я ковыряю вот это окно пытаюсь вставить название локации в file_list.
    Ошибка выдаться при попытке загрузки.
    Спойлер тык:
    Код:
    //-----------------------------------------------------------------------------
    // Window_SavefileList
    //
    // The window for selecting a save file on the save and load screens.
    
    function Window_SavefileList() {
        this.initialize.apply(this, arguments);
    }
    
    Window_SavefileList.prototype = Object.create(Window_Selectable.prototype);
    Window_SavefileList.prototype.constructor = Window_SavefileList;
    
    Window_SavefileList.prototype.initialize = function(x, y, width, height) {
        Window_Selectable.prototype.initialize.call(this, x, y, width, height);
        this.activate();
        this._mode = null;
    };
    
    Window_SavefileList.prototype.setMode = function(mode) {
        this._mode = mode;
    };
    
    Window_SavefileList.prototype.maxItems = function() {
        return 6;//DataManager.maxSavefiles();
    };
    
    Window_SavefileList.prototype.maxVisibleItems = function() {
        return 6;
    };
    
    Window_SavefileList.prototype.itemHeight = function() {
        var innerHeight = this.height - this.padding * 2 ;
        return Math.floor(innerHeight / this.maxVisibleItems());
    };
    
    Window_SavefileList.prototype.drawItem = function(index) {
        var id = index + 1;
        var valid = DataManager.isThisGameFile(id);
        var info = DataManager.loadSavefileInfo(id);
        var rect = this.itemRectForText(index);
        var icon=235;
    
        this.resetTextColor();
        if (this._mode === 'load') {
            this.changePaintOpacity(valid);
        }
        this.drawIcon(icon,  rect.x+10, rect.y+28);
        this.drawFileId(id, rect.x, rect.y+25);
        
        if (info) {
            this.changePaintOpacity(valid);
            this.drawContents(info, rect, valid);
            this.changePaintOpacity(true);
        }
    };
    
    Window_SavefileList.prototype.drawFileId = function(id, x, y) {
        
        
        this.drawText(TextManager.file + ' ' + id, x+45, y, 180);
        
    };
    
    Window_SavefileList.prototype.drawContents = function(info, rect, valid) {
        var bottom = rect.y + rect.height;
        if (rect.width >= 420) {
            this.drawGameTitle(info, rect.x + 192, rect.y, rect.width - 192);
            this.drawText($gameMap.displayName(),x+500,y);
       
       if (valid) {
                this.drawPartyCharacters(info, rect.x + 220, bottom - 4);
            }
        }
        var lineHeight = this.lineHeight();
        var y2 = bottom - lineHeight;
        if (y2 >= lineHeight) {
            this.drawPlaytime(info, rect.x, y2, rect.width);
        }
    };
    
    Window_SavefileList.prototype.drawGameTitle = function(info, x, y, width) {
        if (info.title) {
            this.drawText(info.title, x, y, width);
        }
    };
    
    Window_SavefileList.prototype.drawPartyCharacters = function(info, x, y) {
        if (info.characters) {
            for (var i = 0; i < info.characters.length; i++) {
                var data = info.characters[i];
                this.drawCharacter(data[0], data[1], x + i * 48, y);
            }
        }
    };
    
    Window_SavefileList.prototype.drawPlaytime = function(info, x, y, width) {
        if (info.playtime) {
            this.drawText(info.playtime, x, y, width, 'right');
        }
    };
    
    Window_SavefileList.prototype.playOkSound = function() {
    };

    строчку которую я добавил ты сразу найдешь ( this.drawText($gameMap.displayName(),x+500,y);
    Спойлер Тык:


    Должно получиться типо этого если бы не ошибка.
    Последний раз редактировалось Темный; 17.05.2016 в 19:10.



  2. #2

    По умолчанию

    Цитата Сообщение от Темный Посмотреть сообщение
    Я ковыряю вот это окно пытаюсь вставить название локации в file_list.
    Ошибка выдаться при попытке загрузки.
    Спойлер тык:
    Код:
    //-----------------------------------------------------------------------------
    // Window_SavefileList
    //
    // The window for selecting a save file on the save and load screens.
    
    function Window_SavefileList() {
        this.initialize.apply(this, arguments);
    }
    
    Window_SavefileList.prototype = Object.create(Window_Selectable.prototype);
    Window_SavefileList.prototype.constructor = Window_SavefileList;
    
    Window_SavefileList.prototype.initialize = function(x, y, width, height) {
        Window_Selectable.prototype.initialize.call(this, x, y, width, height);
        this.activate();
        this._mode = null;
    };
    
    Window_SavefileList.prototype.setMode = function(mode) {
        this._mode = mode;
    };
    
    Window_SavefileList.prototype.maxItems = function() {
        return 6;//DataManager.maxSavefiles();
    };
    
    Window_SavefileList.prototype.maxVisibleItems = function() {
        return 6;
    };
    
    Window_SavefileList.prototype.itemHeight = function() {
        var innerHeight = this.height - this.padding * 2 ;
        return Math.floor(innerHeight / this.maxVisibleItems());
    };
    
    Window_SavefileList.prototype.drawItem = function(index) {
        var id = index + 1;
        var valid = DataManager.isThisGameFile(id);
        var info = DataManager.loadSavefileInfo(id);
        var rect = this.itemRectForText(index);
        var icon=235;
    
        this.resetTextColor();
        if (this._mode === 'load') {
            this.changePaintOpacity(valid);
        }
        this.drawIcon(icon,  rect.x+10, rect.y+28);
        this.drawFileId(id, rect.x, rect.y+25);
        
        if (info) {
            this.changePaintOpacity(valid);
            this.drawContents(info, rect, valid);
            this.changePaintOpacity(true);
        }
    };
    
    Window_SavefileList.prototype.drawFileId = function(id, x, y) {
        
        
        this.drawText(TextManager.file + ' ' + id, x+45, y, 180);
        
    };
    
    Window_SavefileList.prototype.drawContents = function(info, rect, valid) {
        var bottom = rect.y + rect.height;
        if (rect.width >= 420) {
            this.drawGameTitle(info, rect.x + 192, rect.y, rect.width - 192);
            this.drawText($gameMap.displayName(),x+500,y);
       
       if (valid) {
                this.drawPartyCharacters(info, rect.x + 220, bottom - 4);
            }
        }
        var lineHeight = this.lineHeight();
        var y2 = bottom - lineHeight;
        if (y2 >= lineHeight) {
            this.drawPlaytime(info, rect.x, y2, rect.width);
        }
    };
    
    Window_SavefileList.prototype.drawGameTitle = function(info, x, y, width) {
        if (info.title) {
            this.drawText(info.title, x, y, width);
        }
    };
    
    Window_SavefileList.prototype.drawPartyCharacters = function(info, x, y) {
        if (info.characters) {
            for (var i = 0; i < info.characters.length; i++) {
                var data = info.characters[i];
                this.drawCharacter(data[0], data[1], x + i * 48, y);
            }
        }
    };
    
    Window_SavefileList.prototype.drawPlaytime = function(info, x, y, width) {
        if (info.playtime) {
            this.drawText(info.playtime, x, y, width, 'right');
        }
    };
    
    Window_SavefileList.prototype.playOkSound = function() {
    };

    строчку которую я добавил ты сразу найдешь ( this.drawText($gameMap.displayName(),x+500,y);
    Спойлер Тык:


    Должно получиться типо этого если бы не ошибка.
    Когда ты запускаешь игру и пытаешься загрузиться, в этот момент еще не созданы игровые данные (в частности $gameMap), поэтому ты получаешь ошибку. Насколько я помню, то по стандарту отображается название игры в файле сохранения/загрузки и это название сохраняется в отдельный файл global, который можно найти в папке save. Покопай в эту сторону.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Уроки от DK