[pull request] Images in the encyclopedia
Moderator: Committer
[pull request] Images in the encyclopedia
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
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.
Re: [pull request] Images in the encyclopedia
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?)
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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Re: [pull request] Images in the encyclopedia
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.
Re: [pull request] Images in the encyclopedia
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.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?)
Any code by me in this post is released under GPL 2.0 or later.
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: [pull request] Images in the encyclopedia
Just saw this in game, very nice! I updated the EP wheel image (higher resolution, transparent background), if someone would kindly commit it?Mitten.O wrote:So I decided to enable adding any image to any encyclopedia page.
- Attachments
-
- EP_wheel.png (92.41 KiB) Viewed 2646 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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [pull request] Images in the encyclopedia
A version without english works in the image is needed.
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: [pull request] Images in the encyclopedia
There you go.
- Attachments
-
- EP_wheel.png (83.38 KiB) Viewed 2643 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.
Re: [pull request] Images in the encyclopedia
*cough&without English words*cough* but yes, agreed, it's rather nice but needs further explanation.Geoff the Medio wrote:A version without english works in the image is needed.
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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [pull request] Images in the encyclopedia
Can't / don't want to make a pull request...?The Silent One wrote:There you go.
Re: [pull request] Images in the encyclopedia
In his case: why not commit it himself? @TheSilentOne: you are aware that you have commit access to the repo...?Geoff the Medio wrote:Can't / don't want to make a pull request...?The Silent One wrote:There you go.
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: [pull request] Images in the encyclopedia
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).Vezzra wrote:In his case: why not commit it himself? @TheSilentOne: you are aware that you have commit access to the repo...?Geoff the Medio wrote:Can't / don't want to make a pull request...?The Silent One wrote:There you go.
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [pull request] Images in the encyclopedia
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...)
- The Silent One
- Graphics
- Posts: 1129
- Joined: Tue Jul 01, 2003 8:27 pm
Re: [pull request] Images in the encyclopedia
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.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [pull request] Images in the encyclopedia
If it's under the freeorion project branches, yes. If its on your own account's repositories, up to you.
Re: [pull request] Images in the encyclopedia
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.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.
Those who don't have commit access will have to use PRs all the time of course.
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.However, I didn't find a viable solution how to keep my fork synced with master, I always had to reset it manually
If a branch has been merged and you don't plan to use it for further development, there's no point in keeping it.And should I delete the branch afterwards?