Closed MaxDesiatov closed 5 years ago
Thanks for the contribution.
It looks like contents.xcworkspacedata
should be added to .gitignore
and uncommitted, seems like a user specific thing.
The copyrights on the source files and Info.plist
(currently All rights reserved.
) should be changed to reflect the repository's license (Apache 2).
Ideally you wouldn't hardcode http://localhost:8000/play.html?artemple
but offer some command line arguments to know what to load, either a map, --host=map
, or --join=ip:port
(or you can simply copy the command line argument to the query string, that's fine.)
darkfoTests
looks empty, so if you don't plan on implementing wrapper-side tests, maybe just remove it from the project.
Finally, why don't we move this to a wrappers/macos
subdirectory, that way if we have more wrappers (e.g. Electron or QtWeb) we can simply drop them there.
Other than that I have no real objections, although I cannot test these changes as I don't have a Mac install.
I actually thought I could embed a simple HTTP server within the wrapper in a future PR that always listens on localhost:8000
(maybe a port could be configurable, but we could pick a sufficiently rarely used port). This would help in avoiding ip:port
config values and users wouldn't need to run python -m SimpleHTTPServer
before starting the wrapper. Is it worth trying to embed the server in this same PR?
I'd defer that to a later PR.
That sounds fine too if it's a simple static-serving HTTP server. I actually planned on supplying a simple/fast/hacky one in Python for running the game quickly without much overhead, but I think I didn't commit it because the Windows network stack has some weird performance issues over loopback (and usually I use lighttpd configured to gzip the large assets, which works well.)
Apologies since this doesn't seem to be documented, as for the ip:port
values I meant that in the context of a --join
argument, to join a multiplayer game (mpserv.py
hosts a WebSocket server), which needs the server and port to join. To do that you just use http://whatever/play.html?join=server
, although it seems like we hardcode the port here for now. 🤔
(Hosting is also play.html?host=mapname
)
Thanks, all should be fixed now. I didn't add the command-line arguments since there's no easy way for users to launch GUI apps from command line on macOS. I've added a preferences window though, where URL parameters can be changed to an arbitrary value with artemple
being the default. Hope this works.
The new PreferencesController
still has an "All rights reserved." copyright.
Once that's changed, looks good to me. The preferences dialog is a reasonable solution too.
Ah, sorry about that. That's fixed now. Thank you!
Looks good. Thanks for your contribution!
Hi @darkf, thank you for the great project!
I've been finding that browser UI distracts from the gameplay a bit and thought that wrapping the engine in a web view app could improve that. In this PR a wrapper app based on the standard macOS
WKWebView
is added. It doesn't pull any dependencies and can be built on any macOS device with standard developer tools installed.Here's how it looks in action:
Please let me know if there's any chance this can be merged and if any changes are needed.