Took a quick look at how it works, and each AIBrain just creates a sync table every beat containing its own gold, which gets pushed to all user sync tables. InternalGiveResources and TakeResource would have to be destructively overridden to do an 'if IsAlly(GetFocusArmy(), self:GetArmyIndex()) then' check when populating this table, so each player's sync table only has allied gold in it.
Seems really simple and straightforward, but I've never messed with GetFocusArmy(), because it's easy to use it to create desyncs. However, anything with effects/graphics and sync tables should be safe, so I'll give it a shot - I just won't be able to desync-test it.
Oh, and this change will break Chirmaya's version of the UI mod, which does a math.floor on ArmyGold[unit:GetArmy()], which will return nil and cause the entire rollover to stop functioning. It's trivial to fix the UI mod so that it checks for the availability of the gold display before trying to read it, though.
Edit: Very trivial - the gold display block just needs an if condition after 'gold = ', like so:
- if gold then
- rollover.goldText:SetText(string.format("%d", math.floor(gold)))