This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: Removing gold, silver, and copper to create one consistent currency  (Read 1183 times)

Kobiesan

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 161
    • View Profile
I'm trying to make it so there is just one currency (no copper, silver, or gold). So, to accomplish this I need to combine the text from gold, silver, and copper to create one fluid text (with commas every 3 values if that's possible?). But I am unsure how to go about this. I checked out moneyframe.lua and xml but I didn't know what to fiddle with. What I was able to accomplish was hide the silver and copper icons by creating a custom UI-MoneyIcons.blp and removing the <NormalTexture> for the silver/gold buttons in MoneyFrame.xml. But that isn't really a solution. How would I actually remove the silver/gold buttons and combine the texts?

Here's my moneyframe.lua:
https://pastebin.com/1e15hWCz

Here's my MoneyFrame.xml:
https://pastebin.com/Uex0kJCu

Here is what my moneyframe looks like atm:


Ideally I would get rid of gold, silver, and copper and make it all one currency but I have no clue where to start.

Kobiesan

  • Registred Member
  • Wiki Incarnate
  • *****
  • Posts: 161
    • View Profile
Re: Removing gold, silver, and copper to create one consistent currency
« Reply #1 on: June 29, 2017, 04:33:26 am »
bump

Grymskvll

  • Registred Member
  • Polygonshifter
  • *****
  • Posts: 65
    • View Profile
Re: Removing gold, silver, and copper to create one consistent currency
« Reply #2 on: June 29, 2017, 05:19:12 am »
Probably look for bits like this (from wotlk moneyframe.lua):
Code: [Select]
-- Breakdown the money into denominations
local gold = floor(money / (COPPER_PER_SILVER * SILVER_PER_GOLD));
local silver = floor((money - (gold * COPPER_PER_SILVER * SILVER_PER_GOLD)) / COPPER_PER_SILVER);
local copper = mod(money, COPPER_PER_SILVER);

I guess copper should just be set to money.
Gold and silver and their related frames should be removed ideally, rather than just hidden or set to 0.