It might be useful for people to share links to Abiathar Online level sets so that others can easily browse or fork the levels. So today I added a bit of code that checks for query parameters on the load of the editor page. If all four resources are specified there, the level editing mode launches. It even takes an optional parameter to set the ID of the level to show first.
All of that works perfectly fine, but I started seeing weird graphical artifacts today - it's like only a few tiles get carved out and the rest need a refresh of the level to show up properly. I didn't change anything related to the graphics, and I didn't test before making my changes, and everything looks fine in Edge, so maybe there's something up with Chrome. I will investigate.
Various technical articles, IT-related tutorials, software information, and development journals
Tuesday, May 30, 2017
Monday, May 29, 2017
The client rectangle only considers the scroll bars sometimes
.NET controls have a ClientRectangle property that gives the measurements of the inside of the control, not counting borders or scroll bars. Weirdly, it seems that scrollbars are not always considered. In Policy Plus's Loaded ADMX Files window, where a column header in a list view is resized to barely fit without creating a horizontal scrollbar, the width of a vertical scrollbar only needs to be subtracted out when the dialog is first being set up. After that (during the resize handler), it can be safely ignored; the client rectangle shrinks to make way for it.
Sunday, May 28, 2017
Policy Plus - ADMX details
Previously, Policy Plus provided no way to view all objects defined by a given ADMX file. It could show the path of the ADMX responsible for an object (in the Details window), but there was no way to detail an ADMX.
Now there is. Currently the only way to get to an ADMX Details window is through the new Loaded ADMX Files window, which lists the file title, the containing folder, and the namespace. Double-clicking a row opens that individual ADMX file's window.
As expected, double-clicking an entry here opens the details for that policy object.
These changes are live on GitHub.
Now there is. Currently the only way to get to an ADMX Details window is through the new Loaded ADMX Files window, which lists the file title, the containing folder, and the namespace. Double-clicking a row opens that individual ADMX file's window.
As expected, double-clicking an entry here opens the details for that policy object.
These changes are live on GitHub.
SelectedText in a ComboBox isn't necessarily what it sounds like
The Windows Forms ComboBox control has, among others, properties named SelectedItem, SelectedValue, SelectedIndex, and SelectedText. It sounds like all of those refer to the entry selected in the dropdown, and that was my mistaken assumption. Actually, the last one there, SelectedText, is the text highlighted in the editable text box part of the combo-box. All the others really refer to the current drop-down choice. This seems like a good example of surprise being created by naming two different things in the same style.
Friday, May 26, 2017
Markeen - Equal opportunity for first ring
One of the problems remaining in Markeen is that the first position consulted in the spiral sets the starting weights for the space under consideration. This would not be a problem if the consultation of the other first-ring (immediately adjacent) positions each diluted that contribution so that all four weigh equally. That is, unfortunately, not how the algorithm currently works. So today I tried to fix that and allow other positions to have a fair say in the selection.
First I tried rewriting the scoring algorithm to add up all the possibilities for the first ring, then whittle down the chance of those that don't appear in later rings, but something didn't work out and it just made a huge mess, filling the level with disjointed vertical stripes. Unable to understand the issue, I opted to adjust the previous algorithm instead. Now it averages the weights from each first-ring position and goes back to the old behavior once past that. I'm not yet convinced that it actually makes better levels, but at least it doesn't look too bad for deep profiles, which used to be very broken.
First I tried rewriting the scoring algorithm to add up all the possibilities for the first ring, then whittle down the chance of those that don't appear in later rings, but something didn't work out and it just made a huge mess, filling the level with disjointed vertical stripes. Unable to understand the issue, I opted to adjust the previous algorithm instead. Now it averages the weights from each first-ring position and goes back to the old behavior once past that. I'm not yet convinced that it actually makes better levels, but at least it doesn't look too bad for deep profiles, which used to be very broken.
Thursday, May 25, 2017
ASP.NET postbacks cause Load first
I've been working on an ASP.NET site - pretty much my first serious project with the framework. Many pages do a lot of work in the Load handler to verify that the user should actually be able to see the page, and then fill the page with data. Some of those have buttons on them, which cause postbacks to deliver the notice to the server. This runs the page object setup again, including Init and Load. Therefore, it's not necessary to repeat authentication checks in individual controls' event handlers, since that code won't be reached if Load's code ends the request.
Tuesday, May 23, 2017
Sending text to a printer in PowerShell
Notepad offers some command-line switches to print a document, but if you want to print out some text without an extra process launch or without writing text to a file, PowerShell supplies the Out-Printer cmdlet. You can specify the printer with the -Name switch; by default, without that, the text will go out your default printer. If you want to print an existing file, pipe in the output of Get-Content (gc).
Subscribe to:
Posts (Atom)

