Hi, I have been working on redesigning individual elements of the BeamNG interface for some time now. Everything is going well, unfortunately I encountered quite a big problem. For certain parts of the new design and completely new menus I need to download data from an external website, such as text and graphics. My problem is that the game does not load any graphics as if it had no Internet connection. The code containing the image looks like this: " <img class="nnm_mod_test_image" src="https://picsum.photos/200/300">" I tried using also: "<img class="nnm_mod_test_image" src="http-external://picsum.photos/200/300">" where "http-external://" is used by default in the menu for the "News" button: " <a href="http-external://go.beamng.com/devblog">{{:: 'ui.mainmenu.news' | translate}}</a>" Unfortunately it doesn't work. I also tried to use JavaScript and jQuery but it didn't help either. Here is small piece of new UI: Thank you in advance for your help! If you have any questions, this is my discord: @paylok
What kind of data do you need to pull from the internet during runtime? And for what reason? Point is, you cant do that, so maybe there is a different solution if you tell us why you are doing it in the first place
For example, the main menu will contain a box with a summary of the latest posts from the BeamNG DevBlog along with any graphics, downloaded from a previously prepared RSS (this stage has already been done) and substituted as ready data for the HTML code. The BeamNG interface can work dynamically and statically, but downloading static data is important to me because of the UI element that I would like to use for this.
This is just a suggestion as I have no idea if this can work but you might be able to use luasocket as a workaround to download whatever data you need. For images your UI would point to files inside the userfolder that are updated from lua, with data downloaded with luasocket saved to files using the io library. Then you can force a refresh with a guihook.trigger call that invokes some AngularJS function containing scope.$apply after files are downloaded. For text you can just send downloaded data as strings using guihooks.
I don't think Lua is able to work with the in-game main interface. As an interface application of course, but I doubt it will work with modules
No, it's not supposed to work. The game has a strict whitelist of allowed resource URLs and ip addresses. Earlier the list looked like this: (I don't know how it looks now) Attempts to access somewhere other than that are denied. Exceptions - LAN
It definitely works with lua, example: the mod manager UI module receives mod lists from lua through the ModManagerModsChanged guihook: This is code from ui\modules\modmanager\modmanager.js This code is from lua\ge\extensions\core\modmanager.lua But as @_N_S_ points out the game has a whitelist of what the socket library can access which means your only option seems to be an external program running in the background to update files in the userfolder. Oh well, kinda figured this would likely be the case for security reasons but I never actually tried.
This list is up-to-date and how the filter looks for both UI and Lua/C++ calls. Only steamstatic links work, not steamcommunity links. The closest thing you will get to your desired result is opening a popup to the devblog. I don't recommend working around these restriction as BeamNG obviously wants to prevent this.