Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- // currencyWindow.js
- //=============================================================================
- /*:
- * @plugindesc Add guild currency.
- * @author Jeremy Cannady
- *
- *
- * @help Adds guild currency to main menu and ability to add guild currency via events.
- *
- *
- *
- Plugin Commands
- addGuildCurrency ###### where ######## is the amount you want to add
- *
- *
- */
- (function(){
- Game_Party.prototype.guildCurrency = 0;
- Window_Gold.prototype.windowHeight = function() {
- return this.fittingHeight(2);
- };
- var copyofWindow_GoldRefresh =Window_Gold.prototype.refresh;
- Window_Gold.prototype.refresh = function() {
- copyofWindow_GoldRefresh.call(this);
- var x = this.textPadding();
- var width = this.contents.width - this.textPadding() * 2;
- this.drawGuildCurrencyValue($gameParty.guildCurrency, ' Guild Coins', x, 32, width);
- };
- Window_Base.prototype.drawGuildCurrencyValue = function(value, unit, x, y, width) {
- var unitWidth = Math.min(80, this.textWidth(unit));
- this.resetTextColor();
- this.drawText(value, x, y, width - unitWidth - 6, 'right');
- this.changeTextColor(this.systemColor());
- this.drawText(unit, x + width - unitWidth, y, unitWidth, 'right');
- };
- Game_Party.prototype.addGuildCurrency = function(value){
- this.guildCurrency += value;
- }
- var guildCurrencyAdd = Game_Interpreter.prototype.pluginCommand;
- Game_Interpreter.prototype.pluginCommand = function(command, args) {
- guildCurrencyAdd.call(this, command, args);
- if (command === "addGuildCurrency") {
- var arg = JSON.parse(args[0]);
- console.log(arg);
- $gameParty.addGuildCurrency(arg);
- };
- };
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement