I can select and declare the key to use and it shows up in the engine just fine, but I have no clue how to "override" what the default scripts already have - I am being told it is probably protoyping or inheritance, but all explanations are more complex than they need to be, so I just end up so confused xD
An example in this specific context (basically yes, fix my script for me 😛 ) would be great lol.
I know it isn't perfect yet (needs validation etc), but I'll tidy the script up after it actually works.
Thanks!
It is just after the:
/** * @static * @method _onKeyDown * @param {KeyboardEvent} event * @private */That I have issues.So here is my script as it is so far.
An example in this specific context (basically yes, fix my script for me 😛 ) would be great lol.
I know it isn't perfect yet (needs validation etc), but I'll tidy the script up after it actually works.
Thanks!
It is just after the:
/** * @static * @method _onKeyDown * @param {KeyboardEvent} event * @private */That I have issues.So here is my script as it is so far.
Code:
/*============================================================================= * EternalShadow - F-Key Rebinds * FKeyRebinds.js * Version: 1.0 * Free for commercial and non-commercial use. *=============================================================================*/ /*: * @plugindesc Rebind your F-keys! * * @param FPSMeter * @desc Choose a key for the FPS Meter. * Default: 113 * @default 113 * * @param StretchMode * @desc Choose a key for the Stretch Mode. * Default: 114 * @default 114 * * @param Fullscreen * @desc Choose a key for the Fullscreen. * Default: 115 * @default 115 * * @param Reload * @desc Choose a key for the Reload. * Default: 116 * @default 116 * * @param DevTools * @desc Choose a key for the Dev Tools. * Default: 119 * @default 119 * * @param Debug * @desc Choose a key for the Debug Tools. * Default: 120 * @default 120 */ (function(rebinds) { rebinds.Parameters = PluginManager.parameters('FKeyRebinds'); rebinds.Param = rebinds.Param || {}; rebinds.Param.FPSMeter = rebinds.Parameters["FPSMeter"]; rebinds.Param.StretchMode = rebinds.Parameters["StretchMode"]; rebinds.Param.FullScreen = rebinds.Parameters["FullScreen"]; rebinds.Param.Reload = rebinds.Parameters["Reload"]; rebinds.Param.DevTools = rebinds.Parameters["DevTools"]; rebinds.Param.Debug = rebinds.Parameters["Debug"]; var FPSMeterCode = rebinds.Param.FPSMeter; var StretchModeCode = rebinds.Param.StretchMode; var FullScreenCode = rebinds.Param.FullScreen; /** * @static * @method _onKeyDown * @param {KeyboardEvent} event * @private */Graphics._onKeyDown = function(event) { if (!event.ctrlKey && !event.altKey) { switch (event.keyCode) { case FPSMeterCode: // Default 113/F2, may be changed event.preventDefault(); this._switchFPSMeter(); break; case StretchModeCode : // Default 114/F3, may be changed event.preventDefault(); this._switchStretchMode(); break; case FullScreenCode: // Default 115/F4, may be changed event.preventDefault(); this._switchFullScreen(); break; } }};})