-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update advfort.lua #1394
Update advfort.lua #1394
Conversation
If you just remove that check advfort does actually start in steam version but I still cannot mine with it
We should probably just fix the check instead of removing it? The Lua API says Also, all instances of |
@Bumber64 I believe you I just got here in this project so anyhting you tell me I will do. I have fone the rename and I figured the table has one entry that is still the expected string so the easy fix is to just plant [1] after the value. I also cannot get it to actually work with mining but iad far as I understand self._native.parent:logic() is to trigger some final code that actually 'does' the thing and I cannot get to log what native parent is but I think what fixes this might not be in this file itself |
Applied the comment as I was told
It is a table now but the first entry is still correct
gui/advfort.lua
Outdated
@@ -1837,7 +1837,7 @@ function usetool:onRenderBody(dc) | |||
self:shopMode(self:isOnBuilding()) | |||
self:renderParent() | |||
end | |||
if not (dfhack.gui.getCurFocus()=="dungeonmode/Look" or dfhack.gui.getCurFocus()=="dungeonmode/Default") then | |||
if not (dfhack.gui.getCurFocus()[1]=="dungeonmode/Look" or dfhack.gui.getCurFocus()[1]=="dungeonmode/Default") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be using dfhack.gui.matchFocusString('dungeonmode/Look') or dfhack.gui.matchFocusString('dungeonmode/Default')
there are no guarantees that the string you want will be the first one in the list
this is a good start for updating |
as suggested
Forgot closing
Another update I found out when comparing to advfort 0.47 and probably a major thing: usetool:oninput does not trigger in the new version. I will continue to try and find out why. Can it be because we are missing the ruby scripts dfhack does not recognise the key input for advfort? I spent at least 10 hours now at understanding what happens but I cannot really find out why mining does not happen so this is all I can contribute you may now merge it. |
are there any errors shown on the console? even though advfort uses the older Screen interface (newer tools use ZScreen for focus handling and draggable, resizable windows), the onInput function should still be called |
@myk002 gamelog shows no errors or at least I am unable to find which console those errors should be found in it was far more primitive than that namely pasting print('anything') into the logic of this file on 0.47 version on my laptop and the steam version on my pc to see which triggered and oninit does trigger in the old version and not in the new one. Why that is I do not know. The game also 'freezes' in a way I cannot walk when in advfort mode. |
If you're on Windows, run the |
@myk002 |
If you just remove that check advfort does actually start in steam version but I still cannot mine with it
If this PR makes an externally-visible change in behavior, please add an appropriate line to
changelog.txt
.