Monkey v70c now up! [MONKEY NEWS]
Monkey Forums/Monkey Programming/Monkey v70c now up! [MONKEY NEWS]
| ||
Hi, Latest Monkey is now up (see bottom of product updates page), featuring an improved doc system and lots of minor tweaks. You can now add docs to modules via separate monkeydoc files in the same dir (or in a monkeydoc/ subdir) as the main module file, or via #Rem monkeydoc comments in module source .monkey files. 'Rebuild Docs' is back in Ted (see Help menu) and you can add doc themes in the docs/templates dir. To change the theme used by Makedocs, edit bin/docstyle.txt. Currently, there's only devolonter and blitzmunter to choose from. See MonkeyDoc tool docs. I've added Mojo OnClose/OnBack handlers mainly to keep win8 happy - as far as I can work out, there's no way to programatically close a win8 app. All you can do is NOT cancel an OnBack event inside an OnBack handler, so on Win8, you must Error "" (or use new EndApp) inside OnBack or it wont work. Android/Winphone8 apps will call OnBack when back button is pressed, and Glfw apps will call OnClose when window close gadget is pressed. By default, OnBack calls OnClose, and OnClose calls EndApp, so by default, apps will now just 'end' when back/close is pressed. I've got the virtual keyboard mostly going in winphone8, the only snag being there's no way to stop it closing when 'back' is pressed. See EnableKeyboard docs for more info on this. This is proving MUCH trickier to achieve for win 'store' apps and I'm still a bit stuck on this one. Winphone8 apps can also now use TCP modules as winphone8 supports the widely used/understood etc sockets API. Alas, for some bizarre reason the sockets API is not available to win store apps, and has been replaced by something 'modern' (that no doubt uses sockets underneath) and I haven't quite got my head around Monkeyizing that yet. [edit] v70e now up! Another fix for ios device size issues [/edit] [edit] v70d now up! Fixes an android manifest problem AND adds Win8 multitouch support! [/edit] Updated glfw linux makefile. Fixed bool const evalutor bug in trans. Fixed Invalid DeviceWidth/DeviceHeight in OnCreate on iOS. Added ANDROID_VERSION_CODE and ANDROID_VERSION_NAME app config settings. Fixed winrt threads and winphone8 sockets. Added Rebuild Help to Ted - can't get QWebPage reload working though, so you'll have to manually right-click/reload the page. Added Makedocs to rebuildall.bmx/bin. Added Close Others to Ted. Added Stack.Sort. Added brl.filesystem module. Added Check/Update to Ted's build menu. Added OnClose and OnBack to mojo App class - on window phone 8, these are the ONLY places you can call EndApp. By default, OnBack calls OnClose and OnClose calls EndApp, so by default back/close will both end an app. Added EndApp to Mojo. Use this instead of Error "" if you're using Mojo. Error "" still works. Added monkeydoc as a textfile type to Ted so you get wordwrap. Html5 Mojo now handles Audio-less DOMs. Ted rebuilt with Qt4.8.4 on Windows/Mac - tried on Linux: too hard... Ted console no longer htmlizes app output. Fixed JoyHit not reseting. Added temp SaveState_V66b(). Merged mwtb's html5 SetScissor fix. Merged Devolonter's bananas tweaks. Added WIN8_PRINT_ENABLED app config var - defaults to 'false', due to apps with print failing 'app store' guidelines. Added EnabledKeyboard/DisableKeyboard support to windows phone 8 - not yet windows (store?) 8. Note: 'back' on windows phone 8 ALWAYS clears virtual keyboard, whether or not you call DisableKeyboard in response to GetChar()=27. See EnableKeyboard/DisableKeyboard docs for how to handle this. Fixed Select in generic code causing internal error. Fixed Android LoadBitmap so it returns Null instead of throwing exception. Added file path to 'invalid utf8' warning in os.LoadString; rebuilt trans. Added "screenSize" to android target manifest android:configChanges setting so apps with targetSdkVersion>=12 don't reset when orientation changes. Merged Ziggy's mserver tweaks. |
| ||
Thank you for the Win8 "Back button" fix. :) |
| ||
Thanks. What are Ziggy's MSERVER tweaks? |
| ||
Thanks a lot for the windows 8 fixes. I have asked this many times but never recieved an answer, are there plans to support multitouch for win 8 / phone8? I seems really strange to me that this isn't of higher priority, am I missing something? Since this is a part of mojo, and is not open source, I would prefer not to have to implement this myself. |
| ||
Whats the difference between ExitApp(os) and EndApp(mojo)? (The new doco looks excellent!) When I try Rebuild Help in Ted I get the following output: "H:/Dropbox/CodeMonkey/MonkeyPro70c/bin/makedocs_winnt" Parsing apis... Parsing docs... Making indices... Making apis... monkey.lang : Can't find link:Throw monkey.lang.Throwable : Can't find link:Throw monkey.lang.Throwable : Can't find link:Throw Making docs... docs/monkeydoc/Programming/Keywords/End.monkeydoc : Can't find link:Select docs/monkeydoc/Programming/Keywords/Strict.monkeydoc : Can't find link:Return docs/monkeydoc/Tools/Trans.monkeydoc : Can't find link:Jungle docs/monkeydoc/Tutorials/First monkey steps.monkeydoc : Can't find link:Skid Finished! Done. Is this normal? @Mike Thanks. What are Ziggy's MSERVER tweaks? You can see Ziggy's tweaks here: https://github.com/blitz-research/monkey/commits/master/src/mserver *Added version info on the MServer GUI as there was no version numbering of any kind. *Removed small debug print from source *Just removed a comment that should not be there *This commit adds content-type header to http requests so it can be loaded nicer on WebKit or Chrominium based browsing engines. |
| ||
So I decided to "quickly" update MonkeyMax to v70... but running into issues due to all the pre-processor stuff in brl/gametarget.monkey, monkey/lang.monkey and mojo/app.monkey. What's the "official" way to get around the pre-processors? We've already implemented BRL_GAMETARGET_IMPLEMENTED? |
| ||
the Android commands are very welcome will make development easier :D |
| ||
Upgrading to 70c my game, using the playniax framework, now spits out this error: Android Target:[gettype] [Fatal Error] :5:22: Open quote is expected for attribute "{1}" associated with an element type "android:versionCode". I've deleted my build folder. |
| ||
Thank you Mark ! |
| ||
Thanks!, I have re-submitted two WP8 apps with back button functionality, fingers crossed. |
| ||
Thanks you Mark! |
| ||
When compiling for Android you get:[gettype] [Fatal Error] :5:22: Open quote is expected for attribute "{1}" associated with an element type "android:versionCode". To fix it edit: MonkeyPro/targets/android/template/templates/AndroidManifest.xml Change: android:versionCode=${ANDROID_VERSION_CODE} android:versionName=${ANDROID_VERSION_NAME}To: android:versionCode="${ANDROID_VERSION_CODE}" android:versionName="${ANDROID_VERSION_NAME}" Anywho. It should maybe be considered a "bug". |
| ||
> are there plans to support multitouch for win 8 / phone8? Try v70d (just uploaded). I had a hack at this a while back with no joy, but had another go this morning and think I've got it sussed. > When I try Rebuild Help in Ted I get the following output: This is normal. > Upgrading to 70c my game, using the playniax framework, now spits out this error: Android Target My bad, try new v70d. |
| ||
Thanks Mark... any info about extra targets regarding the predecessors in brl/gametarget.monkey, monkey/lang.monkey and mojo/app.monkey.? |
| ||
> any info about extra targets regarding the predecessors in brl/gametarget.monkey, monkey/lang.monkey and mojo/app.monkey.? To add a bmx/max2d target you'll need to do at least the following. * Implement/import native lang.bmx somehow. * Implement/import native mojo.max2d.bmx somehow. * Implement/import native max2dgame.bmx file containing eg: BBMax2dGame class somehow and set #BRL_GAMETARGET_IMPLEMENTED=True The easiest way to go is probably to place all these files in the target modules dir, eg: targets/max2d/modules/native/lang.bmx targets/max2d/modules/native/max2dgame.bmx targets/max2d/modules/native/mojo.max2d.bmx targets/max2d/modules/monkeytarget.monkey ...and the last might look like... Import brl.gametarget Import "native/lang.bmx" Import "native/max2dgame.bmx" Import "native/mojo.max2d.bmx" #BRL_GAMETARGET_IMPLEMENTED=True Note that this file will be auto imported when the max2d target is used. |
| ||
Thanks Mark, we had all the native files within the brl, monkey, mojo etc folders. Our monkeytarget.monkey ended up looking like this: Import brl.gametarget Import "native/gametarget.bmx" Import "native/lang.bmx" Import "native/bmaxgame.bmx" Import "native/mojo.bmax.bmx" Import "native/monkeytarget.bmx" #BRL_THREAD_IMPLEMENTED=True #BRL_GAMETARGET_IMPLEMENTED=True We had to add the BRL_THREAD_IMPLEMENTED as well or we got "Error : Native Thread class not found." error. |
| ||
Is monkey v70 the last stable release, on the home page it says v70 out now... but on the product updates its v69 is the last stable release and v70d is experimental? |
| ||
@EdzUp: the home page announcement says... Monkey V70 is now available. This is my first attempt at creating a release from the Github 'master' branch [...] so I've uploaded it to the experimental section for now. ... so V69 is the current stable release. |
| ||
Thanks! |
| ||
If its still experimental why post news about it at all? |
| ||
Is the doc system working for other module folders then the native one? |
| ||
Guess so. When I move the module back into the main module folder the doc system works, but not with a user defined module folder. :-/ |
| ||
Anyone tried building on iOS yet. My game image get shrunk down to 1/4 size and sits in the bottom left corner on iPhone5. Works ok if I build with v70b. Also my iPad mini works fine when building with either version. |
| ||
Si, I ran into the shrunken view on iPhone4S, for quick fix I ended up changing (commenting out 2 lines) targets/ios/modules/native/iosgame.cpp[355]//Bit of a kludge for now... void BBIosGame::StartGame(){ MonkeyView *view=_appDelegate->view; // view->backingWidth=view.frame.size.width; // view->backingHeight=view.frame.size.height; BBGame::StartGame(); } |
| ||
Very weird, this was a fix for the 'device width/height is 0 in OnCreate' problem and it works fine here on my iPad. Take out the above and device width/height should be 0 inside OnCreate? Or does that depend on device too? But there's another way to fix this that should be more robust - ie: the old way! v70e coming soon... |
| ||
Okay, v70e now up and hopefully fixes all these issues! |
| ||
I think I found a bug with line drawing on Windows 8. For example, if I replace line 46 in clock.monkey to MouseX,MouseY and try to run under win8 I get a strange trailing effect of the lines. bananas\difference\clock\clock.monkey Method OnRender() Local nowtime:Float = Millisecs + adjust Cls 128,0,255 Local w:Int = 640 Local h:Int = 480 Local r:Float = 0.95 * Min(w,h) / 2.0 PushMatrix Translate MouseX,MouseY ' <----- Change this |
| ||
Win8 mojo is drawing twice as many lines as it should! Fixed in next update, or try replacing ->Draw( n*2,...) with ->Draw( n,...) in mojo.win8.cpp. |
| ||
By the way Mark, any chance you could apply this fix for music mixing on iOS? http://www.monkeycoder.co.nz/Community/posts.php?topic=3057 Would save me having to paste the code in every time I release. :) |
| ||
Great, thanks! |
| ||
Mark: can you put Remove back in lists please it makes it easier to go through the list and remove entries that have timed out etc. As an example:For ScoreFloat = EachIn ScoreFloatList if ScoreFloat.Timer=0 ScoreFloatList.Remove( ScoreFloat ) Endif Next How will we remove items without it? |
| ||
How will we remove items without it? Two methods: #1 list.RemoveEach(item) slow #2 ListNode.Remove() fast You get the node when you add the item to the list. |
| ||
@EdzUp I guess Mark finally removed "Remove". You have to use "RemoveEach" now. It is the same thing. Remove used to call RemoveEach. now you have to do it directly. it was mentioned in previous versions of monkey that "Remove" was deprecated. |
| ||
@Jesse: ah ok thanks :) |
| ||
Okay, v70e now up and hopefully fixes all these issues! I guess you didn't see my post here and also my bug reports. Nothing got fixed regarding the documentation system. |
| ||
re: List.Remove. I actually didn't mean to nuke this just yet - sorry! It will be replaced with RemoveFirst:Void( value:T ), ie: "remove first item in list matching 'value'". This is a pretty common game op, and faster than RemoveEach (although still O(N) really, ie: slow). |
| ||
Ah that sounds like a better option :) |
| ||
Mark what about keeping the List.Remove syntax but give it an optional flag paramater to set it up to either remove first, or each with first being the default , that would mean no code changes for people. although to be honest it was a simple find/replace edit to a few source files to bring my code in line with the new monkey version so I guess its not that big of a deal. |
| ||
I think the thing is to me RemoveEach does sound a bit like it removes all entries relating to the variable like a selective clear call. Remove was very useful if its RemoveFirst why not just reinstate Remove? |
| ||
If the old Remove was just removing the first item, it is better called RemoveFirst. I would leave it as it is now. It's much better when method names correspond to what a method does. Backwards compatibility is great, except when something is being improved. However, when a method is deprecated and it's going to be removed, it would be great if Mark adds a #PRINT "WARINING: Method XXXX is deprecated and will be removed soon. Use XXXX instead" so we can see it in advance in compile time. |
| ||
+1 on that :-) |
| ||
Please *do not* remove "Remove"! I've written tons of code using the demo, and now that I purchased the full version, I really don't want to re-write everything, or even have to make another function... I think the solution proposed above by Taiphoz on post #38 is the best - give it a optional parameter to select between removefirst (default behaviour) or removeeach. It also keeps some compatibility level with Bmax TList (my main concern here - I wrote a very big library wrapping up Monkey commands so I can port easily from Monkey to BMX), which also has "Remove". And on another note... so, there is no way to 'end' a win8 app? Calling 'Error ""', or even EndApp() makes it crash right now. |
| ||
Thanks for the WP8 updates, two apps have just passed submission and are live. |
| ||
The fastest way to remove items from a list is node.Remove() anyway, so I see no big deal in that list.Remove(item) was depreciated. |
| ||
so I see no big deal in that list.Remove(item) was depreciated. Apart from everyone's code which uses it would need to be updated... |
| ||
> Thanks for the WP8 updates, two apps have just passed submission and are live. Woohoo! |
| ||
Everyone's used to updating their code from monkey updates breaking code, and if they aren't, they should be. Keeping a bunch of old cruft in Monkey for obscure compatibility reasons should be reserved for when monkey's pretty much feature-complete, I think. Removing the method requires minimum refactoring, and is obvious because its removal will cause a compile-time error. This has happened already with brl, I don't see what the problem is other than people not knowing that a List isn't a magical container that can be manipulated like a Stack. Remove() is a deceptively-named method. It would be similar to if List.Count() was named List.Length() -- it obscures what's actually going on in there, and should've probably been updated as early as possible. Depreciating the Remove() method with an explicit sunset period is a good compromise which gives everyone time to refactor their code. |
| ||
The issue is that Monkey now is over two years old, so there is a lot of code out there already and Mark doesn't like "warnings" in his languages so people may not know that they have to refactor their code in the first place! |
| ||
Thanks for the WP8 updates, two apps have just passed submission and are live. Great!!!! |
| ||
>The issue is that Monkey now is over two years old, so there is a lot of code out there already and Mark doesn't like "warnings" in his languages so people may not know that they have to refactor their code in the first place! I see. Depreciated functions are the perfect place to have a warning, though! |
| ||
Sadly a warning via #Print can't be used right now as it is always printing text to the console, no matter if you use the embending method. |
| ||
And regarding old code... By your logic, Marc would need to keep depreciated stuff forever. Guess it is time for Monkey version #2 then :-) . |
| ||
Well tbh if the source is using old commands its down the the programmer to update it to use the new stuff. If there was a code archive like the blitzbasic.com then maybe a version number of the monkey that works with the source could be added? |
| ||
By your logic, Marc would need to keep depreciated stuff forever Works for Java ;) |
| ||
Ya could have it come up when the file is tokenised :-) |
| ||
>Added EnabledKeyboard/DisableKeyboard support to windows phone 8 - not yet windows (store?) 8. Note: 'back' on windows phone 8 ALWAYS clears virtual keyboard, whether or not you call DisableKeyboard in response to GetChar()=27. See EnableKeyboard/DisableKeyboard docs for how to handle this. Looking at the latest docs I don't see any info on how to handle this? Can we check if the keyboard is still on screen? Thanks. |