Oolite Bulletins

For information and discussion about Oolite.
It is currently Wed Mar 20, 2019 9:07 pm

All times are UTC




Post new topic  Reply to topic  [ 20 posts ]  Go to page 1 2 Next
Author Message
 Post subject: [Release] marketAide
PostPosted: Fri Aug 31, 2012 5:50 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Hello.

I just can't remember min, avg and max prices of commodities and a I have to check them all the time so I created a very simple oxp that overlays the market screen with the data from the reference sheet.

Hope you find it useful.

Version 1.2

https://www.box.com/s/ixblm3pudvztqzkq8eqn


Last edited by spara on Sun Sep 02, 2012 8:12 pm, edited 3 times in total.

Top
   
 Post subject: Re: marketAide oxp
PostPosted: Fri Aug 31, 2012 5:59 pm 
Offline
Retired Assassin
Retired Assassin
User avatar

Joined: Tue Feb 09, 2010 11:31 am
Posts: 8408
Location: Disunited Kingdom
Lots of people will find this useful. Nice one! :)
If I have one request, it is could the overlay also be available without an image?

_________________
Commander Smivs, the friendliest Gourd this side of Riedquat.


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Fri Aug 31, 2012 8:17 pm 
Offline
Deadly
Deadly
User avatar

Joined: Sun Feb 27, 2011 10:15 pm
Posts: 143
Location: Eastern Bavaria (Average Agricultural Confederacy)
A good idea resulting in a very useful oxp. Good work, commander spara! :)

_________________
I love deadlines. I like the whooshing sound they make as they fly by.
(Douglas Adams, 1952 - 2001)


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Fri Aug 31, 2012 9:31 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Glad you like it.

I have updated the file to a new version. In the first version I accidentally merged the bgs market background with the commodities prices, so it really wasn't an overlay :?. I was using the backround to line up things. The new version is a true overlay. And a lot smaller in size :D.


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Sat Sep 01, 2012 2:09 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Thu Jun 07, 2012 2:19 pm
Posts: 647
Location: Well, I WAS in G3...
Awesome idea, waited till the fixes to download... Will be back with a review.

EDIT: Back with a review: simple, clean, and brilliant. I'm calling it a must-have.

_________________
Got all turned around, lost my nav connection... Where am I now?


Last edited by Rese249er on Sat Sep 01, 2012 2:57 am, edited 1 time in total.

Top
   
 Post subject: Re: marketAide oxp
PostPosted: Sat Sep 01, 2012 2:57 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Jun 11, 2011 6:07 am
Posts: 2161
Location: Western Australia
It works, but not the way you think it does. :wink:
Quote:
09:56:36.595 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_Aide 1.0): TypeError: this.$marketOverlay is undefined
09:56:36.595 [script.javaScript.exception.unexpectedType]: ../AddOns/marketAide.oxp/Scripts/aide.js, line 11.
Overlays are reset when you change screens, so this should be all you need in the script:-
Code:
this.guiScreenChanged = function(to, from) {
	if (to == "GUI_SCREEN_MARKET" && guiScreen == "GUI_SCREEN_MARKET") {
	setScreenOverlay('aide_market_overlay.png');
	}
}


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Sat Sep 01, 2012 7:06 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Quote:
It works, but not the way you think it does. :wink:
Quote:
09:56:36.595 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (market_Aide 1.0): TypeError: this.$marketOverlay is undefined
09:56:36.595 [script.javaScript.exception.unexpectedType]: ../AddOns/marketAide.oxp/Scripts/aide.js, line 11.
Overlays are reset when you change screens, so this should be all you need in the script:-
Code:
this.guiScreenChanged = function(to, from) {
	if (to == "GUI_SCREEN_MARKET" && guiScreen == "GUI_SCREEN_MARKET") {
	setScreenOverlay('aide_market_overlay.png');
	}
}
Thanks for spotting. I thought that the script was so simple that I didn't even bother to look at the log :lol: . I did it the way you suggest at first, but it made the overlay disappear when pressing pause key (p). Framecallback seems to be a solution, but the example I was using destroyed this.$marketOverlay too early causing the error. No more destroying and now it seems to work.

Had to start versioning. Link to version 1.1 updated in the first post.


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Sat Sep 01, 2012 7:34 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sat Jun 11, 2011 6:07 am
Posts: 2161
Location: Western Australia
Quote:
Had to start versioning. Link to version 1.1 updated in the first post.
Still wrong. Still the same mistake. You're trying to remove the actual function, not the frame callback.
Code:
this.guiScreenChanged = function(to, from) {
	if (to == "GUI_SCREEN_MARKET") {
		this.$myFrameCallback = addFrameCallback(this.$marketOverlay.bind(this));
	}
}

this.$marketOverlay = function(delta) {
	if (guiScreen != "GUI_SCREEN_MARKET") {
		removeFrameCallback(this.$marketOverlay);    <--------------
		return;
	}
	setScreenOverlay('aide_market_overlay.png');
}
See this post for a correct example. :wink:


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Sat Sep 01, 2012 7:43 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Thu Jun 07, 2012 2:19 pm
Posts: 647
Location: Well, I WAS in G3...
Downloaded v1.1, though as a pilot and not a coder, probably won't make a difference to me.

_________________
Got all turned around, lost my nav connection... Where am I now?


Top
   
 Post subject: Re: marketAide oxp
PostPosted: Sat Sep 01, 2012 7:58 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Quote:
Quote:
Had to start versioning. Link to version 1.1 updated in the first post.
Still wrong. Still the same mistake. You're trying to remove the actual function, not the frame callback.
Code:
this.guiScreenChanged = function(to, from) {
	if (to == "GUI_SCREEN_MARKET") {
		this.$myFrameCallback = addFrameCallback(this.$marketOverlay.bind(this));
	}
}

this.$marketOverlay = function(delta) {
	if (guiScreen != "GUI_SCREEN_MARKET") {
		removeFrameCallback(this.$marketOverlay);    <--------------
		return;
	}
	setScreenOverlay('aide_market_overlay.png');
}
See this post for a correct example. :wink:
I have to be blind :x . That was exactly the example I was using. I stand corrected, thank you very much. And the oxp is updated. Again.


Top
   
 Post subject: Re: [Release] marketAide
PostPosted: Sun Sep 02, 2012 8:17 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
I have gone through the "OXP Distribution" page on wiki (which I should have done a lot earlier :)) and have repackaged the oxp accordingly (included the license and such). If I would like my oxp to be added to the oxp list in the wiki, what should I do?


Top
   
 Post subject: Re: [Release] marketAide
PostPosted: Sun Sep 02, 2012 8:37 pm 
Offline
Retired Assassin
Retired Assassin
User avatar

Joined: Tue Feb 09, 2010 11:31 am
Posts: 8408
Location: Disunited Kingdom
Quote:
... my oxp to be added to the oxp list in the wiki, what should I do?
Just ask here! There's usually a wiki-er around who will help.
It's done for you :)
Or if you wish to have a wiki account of your own, again, just ask, although I can't help with that I'm afraid.

_________________
Commander Smivs, the friendliest Gourd this side of Riedquat.


Top
   
 Post subject: Re: [Release] marketAide
PostPosted: Mon Sep 03, 2012 6:19 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Thu May 10, 2012 9:41 pm
Posts: 877
Location: Derby
Spara - If you want a Wiki account Maik set out up for me so he is probably the best person to contact.

Good work with the oxp by the way.

_________________
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"


Top
   
 Post subject: Re: [Release] marketAide
PostPosted: Mon Jan 14, 2013 3:34 pm 
Offline
Average
Average

Joined: Fri Dec 09, 2011 11:50 am
Posts: 10
Out of curiosity is it possible to include the price you have bought the commodity at ? as part of the overlay.


Top
   
 Post subject: Re: [Release] marketAide
PostPosted: Mon Jan 14, 2013 4:09 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2549
Location: Finland
Quote:
Out of curiosity is it possible to include the price you have bought the commodity at ? as part of the overlay.
Not possible as overlay. Overlay is simply a png image. At the moment Wildebloods AI Trading Assistant does that. My Troomp also does that, but there are issues with Oolite 1.77, so it can't be recommended.

Price of the bought goods is actually more complicated than it looks. First of all it has to be an average. Then you'll have to cope with goods that are dumped or destroyed or scooped. New Cargoes and Hypercargo also add their quirks in to the mix. And let's not forget handling of cargo contracts and their premiums.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 20 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited