FreeOrion

Forums for the FreeOrion project
It is currently Mon Dec 11, 2017 7:07 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Oct 01, 2016 9:22 pm 
Offline
Content Scripter
User avatar

Joined: Sat Mar 17, 2007 12:28 am
Posts: 685
I recently remembered that it should be possible to embed pictures in pedia articles, but my attempts so far failed.

I tried to copy the hard coded embedded picture in the suitability report (EncyclopediaDetailPanel.cpp):

Code:
detailed_description += UserString("ENC_SUITABILITY_REPORT_WHEEL_INTRO") + "<img src=\"encyclopedia/EP_wheel.png\"></img>";


but when i add the same picture to the end of a pedia article the picture is not found and the red X is displayed.

Code:
ENVIRONMENT_TEXT
'''Different environments can be encountered when exploring the planetary systems on the galactic map: [[PT_INFERNO]], [[PT_RADIATED]], [[PT_TOXIC]], [[PT_BARREN]], [[PT_DESERT]], [[PT_TUNDRA]], [[PT_SWAMP]], [[PT_TERRAN]], [[PT_OCEAN]], [[PT_ASTEROIDS]], and [[PT_GASGIANT]].

Each [[encyclopedia ENC_SPECIES]] has its own environmental preferences, which determine on each planet type the suitability for the species, according to the following list (from worst to best):

[[PE_UNINHABITABLE]] < [[PE_HOSTILE]] < [[PE_POOR]] < [[PE_ADEQUATE]] < [[PE_GOOD]]

The planet suitability report can be displayed by right-cliking on a planet in the system sidepanel. A green number following the suitability data indicates the max population value if the species colonizes the planet, whereas a red number indicates that the population will stay idle or will decrease, to finally perish if the species attempts to colonize the planet.

When terraforming a planet (by [[encyclopedia RESEARCH_TITLE]] or if the planet has the [[special GAIA_SPECIAL]] special) in order to better suit the species environmental preferences, the planet's original environment is modified by stages, until it finally reaches the [[PE_GOOD]] suitability for the species who wants to live on the planet. The terraforming stages can be checked on the suitability wheel displayed in the Planet Suitability report.
<img src=\"encyclopedia/EP_wheel.png\"></img>'''


The error message is also attached. Can somebody help me?


Attachments:
error.png
error.png [ 4.55 KiB | Viewed 266 times ]
environment.png
environment.png [ 69.33 KiB | Viewed 266 times ]

_________________
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.
Top
 Profile  
 
PostPosted: Sat Oct 01, 2016 9:42 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3286
Ah, it's hardcoded into the backend C++ code, that why I could never figure out images.

OK, pure guess, the backend has escaped the file source, try
Code:
<img src="encyclopedia/EP_wheel.png"></img>
, but it's a pure guess, I would love to know how to embed images directly throught the Pedia but I never got around to chasing up how to do it.

_________________
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: Sun Oct 02, 2016 12:11 am 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
Though im new here and dunno exactly if you figured this out or not.

I wanted to point out that your actual error states, that you have passed a folder directory and didn't actually pass in the file name of the image to load within the path given.

Image

non-file path typically means a directory or folder path without the filename at the end.

E.G. somepicture.png is missing

the error says you passed

"../../art/"

instead of the below which its implying it requires.

"../../art/somepicture.png"

The error msg probably should assert "a filename is required within the given path specified".


Top
 Profile  
 
PostPosted: Sun Oct 02, 2016 10:50 am 
Offline
Content Scripter
User avatar

Joined: Sat Mar 17, 2007 12:28 am
Posts: 685
MatGB wrote:
OK, pure guess, the backend has escaped the file source, try
Code:
<img src="encyclopedia/EP_wheel.png"></img>
, but it's a pure guess, I would love to know how to embed images directly throught the Pedia but I never got around to chasing up how to do it.

That worked! Thanks Matt.

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

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:  
Powered by phpBB® Forum Software © phpBB Group