じ☆ve冰风 发表于 2026-7-29 10:44:42

Skip Skill Type

When you don't want the player to select a type first, but instead go directly to the full list of skills, feel free to use and edit this here:

                JavaScript:       
//=============================================================================
// SkipSkillType.js
//=============================================================================

/*:
* @plugindesc Skips the "Type" part of the skill selection.
* @author Titan_Ungovernable
*
* @help
*
* When you select a skill from the field or in battle, by default you have to
* select the skill type first. This plugin skips this step.
*
* The space that is usually occupied by the "Type" is used for info on MP / TP.
* This leaves room for improvement in edits of this plugin.
*
* No restrictions on the use of this plugin other than mentioning:
* SkipSkillType plugin by forums.rpgmakerweb.com user Titan_Ungovernable.
*/

"use strict";

if (!("globalThis" in this))
    // make globalThis work in e.g. the RMMV engine
    this.globalThis = this;

globalThis.Scene_Skill = class extends Scene_Skill {
    start () {
      super.start();
      this._itemWindow.activate();
      this._itemWindow.selectLast();
    }
    create () {
      super.create();
      this.createSkillExtWindow();
      this._statusWindow.width -= this._skillExtWindow.width;
      this.refreshActor();
    }
    createSkillExtWindow () {
      const w = Window_SkillType.prototype.windowWidth();
      const x = Graphics.boxWidth - w;
      const y = this._statusWindow.y, h = this._statusWindow.height;
      this._skillExtWindow = new Window_SkillExt(x, y, w, h);
      this.addWindow(this._skillExtWindow);
    }
    createSkillTypeWindow () {
      this._skillTypeWindow = {
            // dummy object that keeps the rest of the scene functioning
            width: 0,
            height: Window_SkillType.prototype.windowHeight(),
            setSkillWindow: w => {},
            setActor: a => {},
      };
    }
    onItemCancel () {
      this.popScene();
    }
};

globalThis.Window_SkillList = class extends Window_SkillList {
    includes (item) {
      // normally, this would filter by skill type
      return !!item;
    }
    updateHelp () {
      super.updateHelp();
      // when the usual info box is updated, we can refresh the Ext window, too
      // TODO: cleaner way for this
      SceneManager._scene._skillExtWindow.refresh();
    }
};

globalThis.Window_SkillExt = class Window_SkillExt extends Window_Base {
    refresh () {
      this.contents.clear();
      const item = SceneManager._scene.item();
      if (!item)return;
      let line = 0;
      const lineH = this.lineHeight();
      if (item.mpCost !== 0) {
            this.drawText(`- ${item.mpCost}${TextManager.mpA}`, 0, 0, 9999);
            line++;
      }
      if (item.tpCost !== 0) {
            this.drawText(`- ${item.tpCost}${TextManager.tpA}`, 0, line * lineH, 9999);
            line++;
      }
      if (item.tpGain !== 0) {
            this.drawText(`+ ${item.tpGain}${TextManager.tpA}`, 0, line * lineH, 9999);
            line++;
      }
    }
};


Tested in the field and in battle with no problems found.


本贴来自国际rpgmaker官方论坛作者:Taiten89处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/skip-skill-type.160965/
页: [1]
查看完整版本: Skip Skill Type