|
|
@ -36,39 +36,39 @@ function test.enterSidebarMode()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
-- verify expected starting state
|
|
|
|
-- verify expected starting state
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.ui.main.mode)
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.plotinfo.main.mode)
|
|
|
|
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
|
|
|
|
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
|
|
|
|
|
|
|
|
|
|
|
|
-- get into the orders screen
|
|
|
|
-- get into the orders screen
|
|
|
|
gui.simulateInput(dfhack.gui.getCurViewscreen(true), 'D_JOBLIST')
|
|
|
|
gui.simulateInput(dfhack.gui.getCurViewscreen(true), 'D_JOBLIST')
|
|
|
|
gui.simulateInput(dfhack.gui.getCurViewscreen(true), 'UNITJOB_MANAGER')
|
|
|
|
gui.simulateInput(dfhack.gui.getCurViewscreen(true), 'UNITJOB_MANAGER')
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.ui.main.mode)
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.plotinfo.main.mode)
|
|
|
|
expect.eq('jobmanagement/Main', dfhack.gui.getCurFocus(true))
|
|
|
|
expect.eq('jobmanagement/Main', dfhack.gui.getCurFocus(true))
|
|
|
|
|
|
|
|
|
|
|
|
-- get back into default from some deep screen
|
|
|
|
-- get back into default from some deep screen
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.ui.main.mode)
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.plotinfo.main.mode)
|
|
|
|
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
|
|
|
|
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
|
|
|
|
|
|
|
|
|
|
|
|
-- move from default to some other mode
|
|
|
|
-- move from default to some other mode
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.QueryBuilding)
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.QueryBuilding)
|
|
|
|
expect.eq(df.ui_sidebar_mode.QueryBuilding, df.global.ui.main.mode)
|
|
|
|
expect.eq(df.ui_sidebar_mode.QueryBuilding, df.global.plotinfo.main.mode)
|
|
|
|
expect.str_find('^dwarfmode/QueryBuilding', dfhack.gui.getCurFocus(true))
|
|
|
|
expect.str_find('^dwarfmode/QueryBuilding', dfhack.gui.getCurFocus(true))
|
|
|
|
|
|
|
|
|
|
|
|
-- move between non-default modes
|
|
|
|
-- move between non-default modes
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.LookAround)
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.LookAround)
|
|
|
|
expect.eq(df.ui_sidebar_mode.LookAround, df.global.ui.main.mode)
|
|
|
|
expect.eq(df.ui_sidebar_mode.LookAround, df.global.plotinfo.main.mode)
|
|
|
|
expect.str_find('^dwarfmode/LookAround', dfhack.gui.getCurFocus(true))
|
|
|
|
expect.str_find('^dwarfmode/LookAround', dfhack.gui.getCurFocus(true))
|
|
|
|
|
|
|
|
|
|
|
|
-- get back into default from a supported mode
|
|
|
|
-- get back into default from a supported mode
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.ui.main.mode)
|
|
|
|
expect.eq(df.ui_sidebar_mode.Default, df.global.plotinfo.main.mode)
|
|
|
|
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
|
|
|
|
expect.eq('dwarfmode/Default', dfhack.gui.getCurFocus(true))
|
|
|
|
|
|
|
|
|
|
|
|
-- verify that all supported modes lead where we say they'll go
|
|
|
|
-- verify that all supported modes lead where we say they'll go
|
|
|
|
for k,v in pairs(guidm.SIDEBAR_MODE_KEYS) do
|
|
|
|
for k,v in pairs(guidm.SIDEBAR_MODE_KEYS) do
|
|
|
|
guidm.enterSidebarMode(k)
|
|
|
|
guidm.enterSidebarMode(k)
|
|
|
|
expect.eq(k, df.global.ui.main.mode, df.ui_sidebar_mode[k])
|
|
|
|
expect.eq(k, df.global.plotinfo.main.mode, df.ui_sidebar_mode[k])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
-- end test back in default so the test harness doesn't have to autocorrect
|
|
|
|
-- end test back in default so the test harness doesn't have to autocorrect
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
|
|
|
|
guidm.enterSidebarMode(df.ui_sidebar_mode.Default)
|
|
|
|