[AG] Simple Gold

Simple Gold
by Akumu Games (me)​

Description:
This plugin lets you display currency as single tokens instead of numbers.
Useful for simplifying your currency system (visuals only).
It also allows the use of special Text Codes in the Gold Window!
goldToToken.jpg
Plugin:
Spoiler
Code:
// ============================================================================
// Simple Gold by Akumu Games
// ============================================================================
// For: RPGMAKER MZ
// AG_SimpleGold.js
// Version: 1.0.0
// Terms: Free to use for commercial and non-commercial projects with due credit.
//
// ============================================================================
/*:
 * @plugindesc This plugin lets you display currency as single tokens instead of numbers.
 * Useful for simplifying your currency system (visuals only).
 * It also allows the use of special Text Codes in the Gold Window!
 *
 * Dependencies: None
 *
 * @author Akumu Games
 * ============================================================================
 * @help
 * ============================================================================
 * Intructions
 * ============================================================================
 * Plug & Play!
 *
 * Compatibility: Place the plugin somewhere below VisuMZ_CoreEngine in the list
 *
 * ============================================================================
 *
 * @param goldToken
 * @text Token symbol for Gold
 * @desc A single letter or icon works best!
 * @type text
 * @default $
 *
 * @param tokenValue
 * @text Token value in Gold units
 * @desc The amount of Gold a single Token represents (rounded up)
 * @type number
 * @min 1
 * @default 1
 *
 * @param prefix
 * @text Fixed text that shows before the tokens
 * @desc Apply your text formatting here!
 * @type text
 * @default \C[3]
 *
 */
 
var AG = AG || {};
AG.SimpleGold = AG.SimpleGold || {};

AG.SimpleGold.goldToken = String(PluginManager.parameters("AG_SimpleGold")["goldToken"]).trim();
AG.SimpleGold.tokenValue = Math.max(Number(PluginManager.parameters("AG_SimpleGold")["tokenValue"]),1);
AG.SimpleGold.prefix = String(PluginManager.parameters("AG_SimpleGold")["prefix"]);

(function() {

//=============================================================================
// Window_Base
//=============================================================================
    //Overwrite
    Window_Base.prototype.drawCurrencyValue = function(value, unit, x, y, width) {
        const unitWidth = Math.min(80, this.textWidth(unit));
        this.resetTextColor();
        this.drawTextEx(this.goldToTokens(value), x, y, width - unitWidth - 6, "right");
        this.changeTextColor(ColorManager.systemColor());
        this.drawText(unit, x + width - unitWidth, y, unitWidth, "right");
    }
    
    //New
    Window_Base.prototype.goldToTokens = function(value) {
        var string = "";
        var tokens = Math.ceil(value / AG.SimpleGold.tokenValue);
        while(tokens > 0){
            string += AG.SimpleGold.goldToken; 
            tokens--;
        }
        return AG.SimpleGold.prefix + string;
    };

})();
(save as "AG_SimpleGold.js" in your plugins folder)
Credits: Akumu Games

I personally needed this in my game to make my life somewhat easier. I hope it can be useful to someone else as well 😀!

Original thread: https://forums.rpgmakerweb.com/threads/ag-simple-gold.141102/