Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Dricus

Pages: [1] 2 3 ... 5
1
FYI:

IIRC one of the reasons (if not the reason) for sticking with Python 2.7 was because pyinstaller did not support Python 3 yet. I just found out that pyinstaller 3 has been released last october, which adds support for Python 3.

2
I saw it after I made this. It's just ui files right now. There's no code involved yet.
Do you know why Dricus has been MIA since the middle of the year?
Should I fork his branch and pick it up from there?
MIA? Me? I'm here :). I'm still following the PyLNP development, but it's just that time again when real life kicks in. Holiday, new job, lots of courses to follow, stuff like that...

As for your UI prototype: For me, it was a very deliberate decision to show much less information on the screen than the current UI does. In my humble opinion, your prototype (just like PyLNP and the old LNP launcher) looks sort of haphazardly thrown together. I mean, why should FPS, sound, save related stuff, process priority, embark, etc all be visible on one single tab? Why should the installation of graphics packs be on the same tab as modifying display settings like varied ground and liquid depth? Sure, to the trained DF player it does make a little bit of sense, but (again, IMHO) it does not do a very good job of making all these settings easy to find in the UI. Especially for newbies, these kinds of UI's can be a bit intimidating.

I'm not saying my attempt is perfect, but to me, it's a step in the right direction.

3
Heyo, I've uploaded a third alpha version of my Qt GUI for PyLNP. Feedback is greatly appreciated.

Changelog
  • Added a widget for installing mods to the settings window.
  • Implemented the Defaults button.
  • Implemented the Update dialog.
Download

Windows executable: https://bitbucket.org/Dricus/python-lnp/downloads/PyLNP-qt_gui-alpha3-win.zip
Linux executable: https://bitbucket.org/Dricus/python-lnp/downloads/PyLNP-qt_gui-alpha3-linux.tar.gz
Mac executable: https://bitbucket.org/Dricus/python-lnp/downloads/PyLNP-qt_gui-alpha3-mac.zip

Source code: https://bitbucket.org/Dricus/python-lnp

4
DF General Discussion / Re: Dwarf Fortress 40_24 Starter Pack r8
« on: April 01, 2015, 11:24:29 am »
I don't know if you did this on purpose, but r8 of the pack contains the PyLNP version which has the bug I described in this post, not the actual 0.9.5a version.

5
I've been using r7 of the Starter Pack, combined with the source code in the latest commit in the PyLNP Bitbucket repository. Just the "vanilla" Starter Pack, no mods, so it should be easy to reproduce.

6
Something strange happened to the graphics pack install code in the commits after v0.9.5a. This is what my game looks like with Spacefox installed using PyLNP 0.9.5a (click for a larger version):



And this is how it looks with the latest code:


7
Heyo, I've uploaded a second alpha version of my Qt GUI for PyLNP.

Changelog
  • Switched to PySide
  • Integrated the settings dialog in the main window
  • Download progress is now shown in a status bar instead of in a modal popup dialog
  • Shouldn't crash anymore when an unknown setting or setting value is encountered
Download

Windows executable: https://bitbucket.org/Dricus/python-lnp/downloads/PyLNP-qt_gui-alpha2-win.zip
Linux executable: https://bitbucket.org/Dricus/python-lnp/downloads/PyLNP-qt_gui-alpha2-linux.tar.gz
Mac executable: https://bitbucket.org/Dricus/python-lnp/downloads/PyLNP-qt_gui-alpha2-mac.zip

Source code: https://bitbucket.org/Dricus/python-lnp

8
Edit: I created a bug report on Bitbucket for this issue.

In the last version of PyLNP, there has been a change to json_config.py so it now always returns deep copies of configuration data instead of references to the actual configuration data itself. Because of this, toggling hacks in hacks.toggle_hack doesn't work anymore. The line of code quoted below doesn't have any effect anymore, because it just changes a copy of the configuration, not the configuration itself:

Code: (hacks.py line 83) [Select]
    get_hack(name)['enabled'] = not get_hack(name)['enabled']

9
I dislike it, because it means that there's no way to preserve an unknown value - it would get clobbered as soon as that file is re-written. If, for example, a user decides he wants to test the 2DASYNC print mode on his machine, it wouldn't really be possible to use PyLNP at the same time.

I am well aware that the starter packs are the main source of PyLNP users, and those users aren't really going to do such things - but I do not want to exclude other users, which is part of the reason why PyLNP supports every DF version. This thought doesn't just apply to older versions, but also (in so far as it is possible) future versions, and that requires allowing unknown values for settings.
Good point, didn't think of that.

Quote
Now, I haven't had a chance to check out all of your changes yet, but it seems like that's not currently possible, due to your implementation (and creation) of SelectionListSettingProperty (it works with indexes, not strings). On the Qt UI side, at least, it should be possible to achieve a similar effect with editable comboboxes and an insert policy of NoInsert.
It should be quite easy to change the implementation of SelectionListSettingProperty to use the plain value in stead of indexes. For settings with an unknown value, the editable flag of the checkbox could be set to true, so the unknown value will be displayed and be editable. Another possibility could be to just add the unknown value to the list of possible values of the setting when the config is loaded.

For YES/NO properties it's different, because a checkbox can't display anything else than checked, unchecked or unknown.

Quote
On a related note: This actually goes beyond just comboboxes. When SET_LABOR_LISTS was introduced in 0.34.03, it was a boolean. In 0.34.07, it gained multiple settings. Suppose we had a PyLNP release with the same basic structure as your Qt-based branch, but made at the time of 0.34.06, and with SET_LABOR_LISTS as a checkbox. What happens if we try to use it to manage 0.34.07? Obviously toggling it wouldn't give the right results, but so long as the user doesn't do this, everything should still work. (If I'm reading the code correctly, it *should* work, but I'm not 100% sure.)
As long as you don't change the setting via the GUI, (whether it's a checkbox or a combobox), the unknown value won't be overwritten, as the underlying setting won't be changed.

When it comes to checkboxes and comboboxes there are a number of options to consider for the Qt UI, including but not limited to:
  • Replace them all with LNP-style togglebuttons. This sacrifices a little bit of user friendliness (imho), but is more compatible with how PyLNP works under the hood.
  • Leave them as they are now, and make sure unknown values don't get overwritten if the user doesn't change the combobox or checkbox value.
  • Add the setting value to the combobox's (or setting's) list of possible values, but don't make the combobox editable. This way we're able to show the user the actual value of the setting, even if it's an unknown one.
  • Make comboboxes editable when the underlying setting contains an unknown value. This way we're able to show the user the actual value of the setting, even if it's an unknown one. Users then won't be able to enter custom values for settings that contain a known value.
  • Make all comboboxes editable for consistency's sake.
  • Replace all checkboxes with (editable) comboboxes, so unknown values will also be visible for YES/NO properties. This will account for situations like the SET_LABOR_LISTS setting you mentioned.

10
A possible solution for the case of unknown values could be to modify DFConfiguration.create_option to keep a dict of fallback options for fields with a limited set of possible values:

Code: [Select]
        if values is not None:
            self.fallback_options[name] = default

DFConfiguration.read_file could then account for that like this:

Code: [Select]
                if match:
                    if (self.options[field] is _force_bool and
                            match.group(1) != "NO"):
                        #Interpret everything other than "NO" as "YES"
                        self.settings[field] = "YES"
                    elif (isinstance(self.options[field], tuple) and
                            match.group(1) not in self.options[field]):
                        self.settings[field] = self.fallback_options[field]
                    else:
                        ...

What I like about this solution is that the "problem" is solved as soon as possible. Opinions?

11
Unknown values are indeed also likely to be a thing with dropdowns. I'm not sure how that should work when using a dropdown - in the current UI, it should preserve the option, but once you start changing it, you can't go back to the old value (without editing the init files manually, of course).
Yeah, I'll see if I can think of a way to gracefully handle this.

Quote
In the case of the unknown *setting*, my personal preference would be to building the UI at run-time, rather than using a pre-designed widget. Not only should it be easier to add more options this way, but it would also prevent non-applicable options from being shown entirely, rather than disabling them at runtime (because the controls simply wouldn't get created).
My personal preference when it comes to designing GUI's for desktop applications is to use a WYSIWYG editor like Qt Designer, which I've used to design the Qt GUI. That way I'm much more productive and there's much less source code to maintain and much less regular refactoring needed to keep that code maintainable. It's still possible to not show controls for unknown settings, but it will just look a bit differrent in code.

12
DF treats any unrecognised print mode as STANDARD, so it won't crash - but it is still a bug.
It is, but IMHO PyLNP should handle these kinds of minor bugs gracefully and not just poop out a stack trace ;).

13
Essentially, the problem is that you're not handling the case where a dropdown is being used for a setting that doesn't exist. This particular setting was added in 0.34.03, so any version before that would break here.
Thanks! I noticed that problem too after installing a graphics pack on a clean DF instance. That graphics pack had PRINT_MODE set to TWBT by default, which isn't valid when TWBT is not detected.

Edit: On second thought, this is not entirely the same problem. I guess I'll have two bugs to fix then ;).

14
Quick update: I switched to PySide and integrated the settings window with the main window.

Screenshot:
Spoiler (click to show/hide)

15
Switching to PySide shouldn't be problem. I will look into that as well. wxPython would require me to rewrite almost everything (which I don't really feel like), so to me that is not an option.

Pages: [1] 2 3 ... 5