From: Jonathan C. <jco...@gm...> - 2020-04-18 11:49:06
|
So, for the last couple of days I've been working on a weird little app that I've wanted for a while. A lot of moves in 18xx games are quite simple, especially doing the SR...but a rails move requires you to be at your computer, load up java, make a move, etc. A lot of the time it's much faster to just make a move on the go via email, letting someone else update...but then if the game state changes a lot, that can be tough. So I have made an app that will listen to drop box and then send an email with the game state every time a new file appears. That said! I am running into a final barrier that is a bit past my knowledge of swing (which is nonexistent). I figured the devs would probably know exactly what is going on, so I thought I'd ask. In order to achieve this, I hacked rails master to have a class which starts rails, takes the screen shots, and then shuts down. It's ugly! But it doesn't have to be pretty. Here is a diff with master that shows what I did: https://github.com/jcoveney/Rails/compare/master...jcoveney:master_printer (as an aside: if you have any advice for achieving all of this in a cleaner way I'm all ears) If I run this on a game currently in an SR, you can see the resulting screenshot below. The relevant code: ORWindow orWindowPanel = orUIManager.getOrWindow(); orWindowPanel.setVisible(true); orWindowPanel.toFront(); PrintGame.printPanel(orWindowPanel, "or_window.png"); I'm not sure what else I need to do to get the map to render properly. I've had this problem with various iterations, so I thought I would ask. Any advice? And while I doubt there is much interest, if anyone is curious about the code that bridges everything together... https://github.com/jcoveney/poll_rails_game/tree/scratchspace_rebaseintomaster/src/main/scala/poll_rails_game Nothing particularly crazy, it's just taken some time to get all of the pieces working together, as there are a lot of random integrations (dropbox, sendgrid, getting vnc working properly in aws). [image: or_window.png] |