OpenTTD 1.2.1 - open source Transport Tycoon Deluxe

Play with your Puppy.
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#21 Post by goingnuts »

Added the possibility to download as a pet.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#22 Post by technosaurus »

OSOpenBrowser is called in openttd.cpp
it exists in os/unix/unix.cpp and calls the url with:
"/usr/bin/xdg-open"
try putting a symlink there (puppy uses either my Rox wrapper possibly with jemimah's URI fixes in /usr/local/bin for xdg-open, or a hacky nest of if-thens in a script)

for reference:

Code: Select all

#!/bin/bash
case "$1" in 
  '') exit
;;
  *://*) exec rox -U "$1"
;;
  *@*.*) exec rox -U "mailto:${1}"
;;
  *) exec rox "$1"
;;
esac
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#23 Post by goingnuts »

technosaurus; Thx for looking into this. The call to xdg-open seems to affect the "Visit website"-button when in the "Content Downloading"-window after choosing a package to download. If not present/functioning nothing happens using that button but if xdg-open present and working it opens the webpage in the browser.

Attached an image of the default behavior of openttd if no graphics found. This window is dependent on some Freetype fonts from the main system which does not work in the static build. Seems that the Freetype - although present - does not work correctly. If build without Freetype the game does not crash but gives a message - but you wont see it unless game is started from prompt (image below).
Game seems to work fine without Freetype and it reduce size from 4744K to 4364K unpacked.

Maybe one could change the failure-code in bottom of bootstrap_gui.cpp to use Xdialog (if present) to inform the user about what is wrong...Maybe reconstruct the dialog with offer of download is also possible...
Attachments
snap0006.png
default behavior if graphics not found and compiled WITHOUT Freetype
(6.81 KiB) Downloaded 541 times
snap0005.png
default behavior if graphics not found and compiled with Freetype
(4.06 KiB) Downloaded 514 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#24 Post by technosaurus »

I'll be honest, I only downloaded the sources because it sounded like a problem I could find in 5 minutes ... I was wrong, it took less than 1 (grep "tp://" * */* */*/* and follow it back), but I never compiledit From your image it appears to have builtin dialog capabilities - seems a better choice than an external dialog. (btw if you recompile, just remove the path to xdg-open and it will use the existing xdg-open wrapper without symlinks as long as it is somewhere in the path)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply