I've recently started messing around trying to learn javascript, by trying to modify YanFly's SkillLearnSystem to make it fit my current project, I've been relatively successful, but I have ran into a road block when trying to make the menu display a required skill's name, I just can't seem to figure out how to return it. I was wondering if someone would be willing to help me?
What it does currently is just return the id of the required skill,
Any and all help is much appreciated.
Window_SkillLearnData.prototype.drawSkillCosts = function(wy) {
if (this._skill.learnRequireLevel <= 0) return wy;
for (var i = 0; i < this._skill.learnRequireSkill.length; ++i) {
skillId = this._skill.learnRequireSkill;
if (!$dataSkills[skillId]) continue;
var text = '';
var skillId = 0;
text += "\\ Skill: " ;
var wx = this.drawTextEx(text, 0, wy);
var ww = this.contents.width - wx - 4;
var costText = Yanfly.Util.toGroup(this._skill.learnRequireSkill.name);
this.contents.fontSize = Yanfly.Param.SLSCostSize;
if (!this._actor.isLearnedSkillRaw(skillId)) {
this.changeTextColor(this.powerDownColor());
} else {
this.changeTextColor(this.powerUpColor());
}
this.drawText(costText, wx, wy, ww, 'right');
this.resetFontSettings();
this.resetTextColor();
wy += this.lineHeight();
}
return wy;
};
if (this._skill.learnRequireLevel <= 0) return wy;
for (var i = 0; i < this._skill.learnRequireSkill.length; ++i) {
skillId = this._skill.learnRequireSkill;
if (!$dataSkills[skillId]) continue;
var text = '';
var skillId = 0;
text += "\\ Skill: " ;
var wx = this.drawTextEx(text, 0, wy);
var ww = this.contents.width - wx - 4;
var costText = Yanfly.Util.toGroup(this._skill.learnRequireSkill.name);
this.contents.fontSize = Yanfly.Param.SLSCostSize;
if (!this._actor.isLearnedSkillRaw(skillId)) {
this.changeTextColor(this.powerDownColor());
} else {
this.changeTextColor(this.powerUpColor());
}
this.drawText(costText, wx, wy, ww, 'right');
this.resetFontSettings();
this.resetTextColor();
wy += this.lineHeight();
}
return wy;
};
What it does currently is just return the id of the required skill,
Any and all help is much appreciated.
. I've tried messing around with the syntax of everything, as well as the order of the lines, but to no avail sadly. But, if the .name is within the parenthesis of the Yanfly.Util.toGroup, the code returns undefined, which is the closest I've gotten so far.