<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 13 January 2018 at 05:24, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>s/SliceLoadFromFile/load_plank<wbr>_from_file/ in my previous mail<br><br></div>Opps! ;)<br></div></blockquote><div><br></div><div>Wait a minute, I just finally noticed you switched to my spelling, and have been doing it for a long time!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-6523433106397112700gmail-HOEnZb"><div class="m_-6523433106397112700gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 12, 2018 at 8:19 AM, James Paige <span dir="ltr"><<a href="mailto:Bob@hamsterrepublic.com" target="_blank">Bob@hamsterrepublic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Opps! I'll fix where I forgot to free the collection in SliceLoadFromFile<br></div>It looks like I am leaking the whole collection every time, even if the load succeeds.<br></div></div></div></blockquote></div></div></div></div></blockquote><div><br></div><div>Oh, I didn't even notice that bug! That wasn't what I meant.  The only way to check whether SliceLoadFromFile failed or not is to check if any slices were actually loaded... but if they didn't load, then the lookupslice will fail anyway, so that "if col = 0 then ..." does nothing<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-6523433106397112700gmail-HOEnZb"><div class="m_-6523433106397112700gmail-h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div>I'm looking forward to learning more about template slices and menu slices. I'll probably have to read your writeup before I understand :)<br></div></div></blockquote></div></div></div></div></blockquote><div><br></div><div>Hmm, this is a long and unfinished writeup, and at the top I have notes to myself to firsr finish and email, or in merge in two other writeups!</div><div><br></div>Template slices is basically just hidden slices, ignored for almost all purposes (importantly, collision detection, so you can't click on them) but which are shown by default in the slice editor, tagged with [TEMPLATE]. Their main use is to replace plank collections. If you want to add a new menu item to a plankmenu, just clone a template slice (indexed with a lookup code), instead of loading a collection and copying over the plank. Conceivably you could have multiple item templates. So, this will let you see the whole menu while you edit the menu slice collection. <br></div><div class="gmail_quote">My branch: <a href="https://bitbucket.org/rbv/ohrrpgce/commits/d1963ff335e7afd8e82d12dd1d92df3251b2f6e8?at=templates" target="_blank">https://bitbucket.org/rbv/<wbr>ohrrpgce/commits/<wbr>d1963ff335e7afd8e82d12dd1d92df<wbr>3251b2f6e8?at=templates</a></div><div class="gmail_quote">(This turned out a bit messy, I wanted to try to clean it up)<br></div><div class="gmail_quote"><div><br></div><div>As for the rest of it, let me just state this core crazy idea:<br></div><div>Replace menu handles and menu item handles with menu slice handles and menu item slice handles.</div><div><br></div><div>The "create menu" command would create *both* a new menu and a new menu slice, which appear to be exactly the same thing from the point of view of scripts. The handle it returns could be passed to any existing menu command, or used as a slice handle. Note that "create menu" fits the pattern for "create rect", "create text", etc.</div><div>Having both menus and menu slices and making them different things with different kinds of handles, and adding commands to convert from one to the other, seems totally unnecessary and harmfully confusing. Three different handle types for heroes is endless trouble.<br></div><div>Ditto for menu items: they also would become slices, but they would be different from other slice types in that they are always linked to a certain menu slice, must be a descendant of that slice, and can't be created independently. Typically they will have a single text slice child, and various existing menu and menu item command will have the effect of modifying that child.<br></div><div>We could either merge MenuDef and plankmenu entirely at a low level, or at a higher one (so MenuDef builds on top of plankmenu or vice versa, or an abstraction layer over the two).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_-6523433106397112700gmail-HOEnZb"><div class="m_-6523433106397112700gmail-h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br>---<br></div>James<br><br><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-6523433106397112700gmail-m_2511306127841915548h5">On Fri, Jan 12, 2018 at 8:04 AM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_-6523433106397112700gmail-m_2511306127841915548h5"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On 12 January 2018 at 13:00,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.co<wbr>m</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">james<br>
2018-01-11 16:00:45 -0800 (Thu, 11 Jan 2018)<br>
38<br>
load_plank_from_file() helper function<br>
---<br>
U   wip/plankmenu.bas<br>
U   wip/<a href="http://plankmenu.bi" rel="noreferrer" target="_blank">plankmenu.bi</a><br></blockquote><div><br></div></span><div>+ DIM col as Slice Ptr<br>+ col = NewSliceOfType(slSpecial)<br>+ SliceLoadFromFile col, filename<br>+ IF col = 0 THEN visible_debug "load_plank_from_file: unable to load slices from """ & filename & """": RETURN 0<br><br></div><div>This doesn't work:  if SliceLoadFromFile fails, it doesn't delete col.</div><div><br></div><div>I actually have a git branch where I was working on making SliceLoadFromFile return a new slice instead of modify an existing one. Which was a surprisingly large change. I don't remember why I didn't check that in; maybe it didn't seem worth the effort to finish it.</div><div><br></div><div>BTW, I have been working on changing the way that plankmenus work. I am getting rid of "plank" collections and instead using template slices parented directly to the menu slice collection. Oh... I didn't check in template slices yet either? Well, it's basically just another Slice bit which works very similarly to Slice.Visible. Well, after planks are gone maybe plank menus should be renamed... I have a suggestion: Menu Slices. As in, promote them to a new slice type so that they can be used by scripts too, not just from FB. I have a long writeup about this which I haven't finished yet...<br></div></div></div></div>
<br></div></div><span>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
<br></blockquote></div><br></div></div>