FreeOrion

Forums for the FreeOrion project
It is currently Mon Oct 23, 2017 11:51 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Sep 08, 2015 7:18 pm 
Offline
Programmer

Joined: Sun Apr 06, 2014 4:15 pm
Posts: 255
Now that the release is done, it is once more time for wild, excessive pull requests!

So, I was playing freeorion after a fairly long break, and I was failing even more than usual at remembering the suitability wheel. I remembered that awesome, clear picture of it in the wiki and though, "Man, I wish I could look at that in-game, in some convenient place, like the suitability report." Then I realized I am a programmer and can have anything I can be bothered to make.

But hard coding a static graphic to a specific encyclopedia page seemed a bit ugly. Too ad-hoc. So I decided to enable adding any image to any encyclopedia page. The natural way to do this was to embed StaticGraphic controls. But it seemed a bit arbitrary to just support one kind of control, so I made the infrastructure support embedding any control that can be flowed nicely into the text.

I may have gone slightly overboard, but hey, it works, and I like having the wheel there, so I'm happy.

Here is the pull request, with a more technical explanation of the thing, and an image: https://github.com/freeorion/freeorion/pull/332

_________________
Any code by me in this post is released under GPL 2.0 or later.


Top
 Profile  
 
PostPosted: Tue Sep 08, 2015 9:13 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3246
The technical stuff in the PR goes way over my head, but the ability to add graphics in, especially that specific graphic in that specific place, is brilliant.

Um, can I request a comment somewhere telling me how to embed an image in a different entry as I'm not figuring it out in the text (it should be doable from the default folder text files, right?)

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Tue Sep 08, 2015 9:37 pm 
Offline
Content Scripter
User avatar

Joined: Sat Mar 17, 2007 12:28 am
Posts: 685
That's a nice option to have! This suggestion in the graphics section will be one step closer to realisation: viewtopic.php?f=10&t=9730

_________________
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.


Top
 Profile  
 
PostPosted: Wed Sep 09, 2015 8:11 pm 
Offline
Programmer

Joined: Sun Apr 06, 2014 4:15 pm
Posts: 255
Quote:
Um, can I request a comment somewhere telling me how to embed an image in a different entry as I'm not figuring it out in the text (it should be doable from the default folder text files, right?)

Oh, right! I mention this in the commit messages, but the format for an image tag is <img src="path relative to default/data/art/"></img>. It should work in any string shown in the encyclopedia window.

_________________
Any code by me in this post is released under GPL 2.0 or later.


Top
 Profile  
 
PostPosted: Mon Sep 28, 2015 9:52 pm 
Offline
Graphics
User avatar

Joined: Tue Jul 01, 2003 8:27 pm
Posts: 698
Mitten.O wrote:
So I decided to enable adding any image to any encyclopedia page.
Just saw this in game, very nice! I updated the EP wheel image (higher resolution, transparent background), if someone would kindly commit it?


Attachments:
EP_wheel.png
EP_wheel.png [ 92.41 KiB | Viewed 1072 times ]

_________________
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Top
 Profile  
 
PostPosted: Mon Sep 28, 2015 9:53 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12004
Location: Munich
A version without english works in the image is needed.


Top
 Profile  
 
PostPosted: Mon Sep 28, 2015 9:57 pm 
Offline
Graphics
User avatar

Joined: Tue Jul 01, 2003 8:27 pm
Posts: 698
There you go.


Attachments:
EP_wheel.png
EP_wheel.png [ 83.38 KiB | Viewed 1069 times ]

_________________
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.
Top
 Profile  
 
PostPosted: Mon Sep 28, 2015 10:07 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3246
Geoff the Medio wrote:
A version without english works in the image is needed.

*cough&without English words*cough* but yes, agreed, it's rather nice but needs further explanation.

Also, and previously unknown to me, we have no explanation easily accessible in the Pedia for environmental types or descriptions thereof, at all. Which would partially explain why people find it confusing.

Um, if anyone wants to write such a guide? I could but I'm half way through so many unfinished projects...

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Mon Sep 28, 2015 10:16 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12004
Location: Munich
The Silent One wrote:
There you go.
Can't / don't want to make a pull request...?


Top
 Profile  
 
PostPosted: Mon Sep 28, 2015 11:24 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4226
Location: Sol III
Geoff the Medio wrote:
The Silent One wrote:
There you go.
Can't / don't want to make a pull request...?
In his case: why not commit it himself? @TheSilentOne: you are aware that you have commit access to the repo...?


Top
 Profile  
 
PostPosted: Tue Sep 29, 2015 7:45 am 
Offline
Graphics
User avatar

Joined: Tue Jul 01, 2003 8:27 pm
Posts: 698
Vezzra wrote:
Geoff the Medio wrote:
The Silent One wrote:
There you go.
Can't / don't want to make a pull request...?
In his case: why not commit it himself? @TheSilentOne: you are aware that you have commit access to the repo...?
Sorry, but I'm not very familiar with Github. For commiting I have so far used a very complicated solution where I had to do a lot of manual work, which I don't want to continue. (I forked the fo master, from which I then created pull requests. However, I didn't find a viable solution how to keep my fork synced with master, I always had to reset it manually).
Reading about the github workflow they tell me I should first create a branch from master, then a pull request which can then be merged, which is what I did for this picture now. Is that how I should do it? And should I delete the branch afterwards?

_________________
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.


Top
 Profile  
 
PostPosted: Tue Sep 29, 2015 8:06 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12004
Location: Munich
If you're just going to commit and push some relatively simple changes to master, and don't want / need feedback before doing so, I don't think there's any need to make a separate branch, make a pull request from it, and then merge it... You could just commit to your local master branch and push it to github. For a more complicated series of separate commits that work together and need feedback and updating, a branch would make sense. (Although I suspect adrian_broher or others might have a different view on this...)


Top
 Profile  
 
PostPosted: Tue Sep 29, 2015 8:35 am 
Offline
Graphics
User avatar

Joined: Tue Jul 01, 2003 8:27 pm
Posts: 698
Thanks, I think I've got it now. One more thing: should I delete my branch after it has been merged?

_________________
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.


Top
 Profile  
 
PostPosted: Tue Sep 29, 2015 8:40 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12004
Location: Munich
If it's under the freeorion project branches, yes. If its on your own account's repositories, up to you.


Top
 Profile  
 
PostPosted: Tue Sep 29, 2015 3:39 pm 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4226
Location: Sol III
The Silent One wrote:
Sorry, but I'm not very familiar with Github. For commiting I have so far used a very complicated solution where I had to do a lot of manual work, which I don't want to continue.
Well, as Geoff already said, you don't need to use the github workflow of pull requests at all. For someone with commit access like you the git client of your choice is completely sufficient (you are familiar with git, right?). Unless you want to put up a patch for review/feedback, then you want to create a PR.

Those who don't have commit access will have to use PRs all the time of course.
Quote:
However, I didn't find a viable solution how to keep my fork synced with master, I always had to reset it manually
Clone the freeorion repo locally, add your fork as another remote (or the other way round, which will change which remote the default "origin" is). After that it's just pulling changes from the FO repo and pushing them regularly to your fork.
Quote:
And should I delete the branch afterwards?
If a branch has been merged and you don't plan to use it for further development, there's no point in keeping it.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group