spara wrote:Basically they both do the same job, but from very different angle. MarketObserver just observes trading and shows the data gathered to the player. It does not give any advices on trading or anything, just data. Trading Assistant on the other hand also collects data, but acts more like an advisor or assistant, giving player hints about trading. And in extreme, does the trading for you.
So in fact, they don't do the same job, but are completely different.
spara wrote:Both use the same kind of techniques in the market screen. Both do hud-switching and use console_messages to achieve overlay. That's why they clash.
That's why they clash, but it doesn't make them irreconcilable. The main source of incompatibility is that you butchered my beautiful, elegant HUD design and stuck advertisements all over it.
Well, the adverts don't cause a problem
per se, but you left no room for comms messages to display.
Untested, but making them work together should be as simple as:-
1. over-writing Trading Assistant's resetHUD() function with a dummy function that doesn't do anything;
2. over-writing Trading Assistant's refreshCostDisplay() function with a dummy function that just calls the similar function in marketObserver;
3. stopping the timer(s) in marketObserver;
4. using a HUD with room for comms messages.
Point 4 is the problem: as I recall, in guiScreenChanged() you have a hard-coded
player.ship.hud = "market_hud.plist"
, rather than a
player.ship.hud = this.$marketHUD
, so another script can't simply change that variable, but would have to over-write the whole guiScreenChanged() function (with a working, not just dummy, alternative).
P.S. I just had a look in marketObserver and I'm sceptical...
Code: Select all
this.$marketMessage = function() { //timer function for market screen
if (guiScreen != "GUI_SCREEN_MISSION") {
this.$gatherMarketInfo(false);
this.$printValues();
player.consoleMessage("\n\n");
}
else {
this.$sweepMarketHud();
return;
}
}
- why exactly is
$gatherMarketInfo(false)
being called every eight seconds? I'm overlooking something there?
P.P.S. Bug report: in playerSoldCargo (and possibly elsewhere, too) you have:
Code: Select all
if (this.$traderRankFeat) { //show profit, if trader rank is enabled
this.$marketTimer.stop();
this.$marketTimer.nextTime = clock.absoluteSeconds + 4;
this.$marketTimer.start();
this.$printValues();
for (i = 0; i < 75; i++)
tab = tab + " ";
player.consoleMessage(tab+"Profit: "+formatCredits((this.$profit - prevProfit)/10, true, true )+"\n\n",3);
this.$setInstruction();
Always check a timer actually exists before stopping it, even if you "know" it exists.
At the moment,
this.$marketTimer.stop();
is flummoxing my compatibility hack. If it weren't for that, it would work (perfectly?).
P.P.P.S. Okay, I've worked around it by pointing the timer at a dummy function. It's still a bug, though.
Always check.
Uploading compatibility hack in a few minutes.