Modcraft - The community dedicated to quality WoW modding!

Wrath of the Lich King Modding => Serverside Modding => Topic started by: Kobiesan on June 13, 2017, 05:42:18 am

Title: Removing gold, silver, and copper to create one consistent currency
Post by: Kobiesan on June 13, 2017, 05:42:18 am
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 (http://"https://pastebin.com/1e15hWCz")

Here's my MoneyFrame.xml:
https://pastebin.com/Uex0kJCu (http://"https://pastebin.com/Uex0kJCu")

Here is what my moneyframe looks like atm:
(http://i.imgur.com/zKDjGwf.png)

Ideally I would get rid of gold, silver, and copper and make it all one currency but I have no clue where to start.
Title: Re: Removing gold, silver, and copper to create one consistent currency
Post by: Kobiesan on June 29, 2017, 04:33:26 am
bump
Title: Re: Removing gold, silver, and copper to create one consistent currency
Post by: Grymskvll 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.