Merge remote-tracking branch 'myk002/myk_view_unit' into develop

develop
lethosor 2021-07-05 20:42:49 -04:00
commit 898d4621da
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
2 changed files with 9 additions and 0 deletions

@ -25,6 +25,7 @@ SIDEBAR_MODE_KEYS = {
[df.ui_sidebar_mode.BuildingItems]='D_BUILDITEM',
[df.ui_sidebar_mode.Stockpiles]='D_STOCKPILES',
[df.ui_sidebar_mode.Zones]='D_CIVZONE',
[df.ui_sidebar_mode.ViewUnits]='D_VIEWUNIT',
}
-- Sends ESC keycodes until we get to dwarfmode/Default and then enters the

@ -64,4 +64,12 @@ function test.enterSidebarMode()
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
expect.eq(df.ui_sidebar_mode.Default, df.global.ui.main.mode)
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
-- verify that all supported modes lead where we say they'll go
for k,v in pairs(guidm.SIDEBAR_MODE_KEYS) do
guidm.enterSidebarMode(k)
expect.eq(k, df.global.ui.main.mode)
end
-- end test back in default so the test harness doesn't have to autocorrect
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
end