Skip to content

Commit

Permalink
Fixed redundant screen behavior application for ImNui.
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanedds committed Oct 4, 2024
1 parent 39ac8cc commit e12461a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Nu/Nu/World/WorldImNui.fs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ module WorldImNui =
then screen.TrySetProperty arg.ArgLens.Name { PropertyType = arg.ArgLens.Type; PropertyValue = arg.ArgValue } world |> __c'
else world)
world args
let world = if screen.GetExists world then World.applyScreenBehavior setScreenSlide behavior screen world else world
let world =
if initializing && screen.GetExists world
then World.applyScreenBehavior setScreenSlide behavior screen world
else world
let world =
if screen.GetExists world && select then
if world.Accompanied && world.Halted // special case to quick cut when halted in the editor
Expand Down
6 changes: 4 additions & 2 deletions Nu/Nu/World/WorldModule2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2941,20 +2941,22 @@ module ScreenDispatcherModule =
type World with

/// Begin the ImNui declaration of a screen with the given arguments using a child group read from the given file path.
/// Note that changing the file path over time has no effect as only the first moment is used.
/// Note that changing the screen behavior and file path over time has no effect as only the first moment is used.
static member beginScreenWithGroupFromFilePlus<'d, 'r when 'd :> ScreenDispatcher> (zero : 'r) init name select behavior groupFilePath world args =
World.beginScreenPlus10<'d, 'r> zero init World.transitionScreen World.setScreenSlide name select behavior (Some groupFilePath) world args

/// Begin the ImNui declaration of a screen with the given arguments using a child group read from the given file path.
/// Note that changing the file path over time has no effect as only the first moment is used.
/// Note that changing the screen behavior and file path over time has no effect as only the first moment is used.
static member beginScreenWithGroupFromFile<'d when 'd :> ScreenDispatcher> name select behavior groupFilePath world args =
World.beginScreen8<'d> World.transitionScreen World.setScreenSlide name select behavior (Some groupFilePath) world args

/// Begin the ImNui declaration of a screen with the given arguments.
/// Note that changing the screen behavior over time has no effect as only the first moment is used.
static member beginScreenPlus<'d, 'r when 'd :> ScreenDispatcher> zero init name select behavior world args =
World.beginScreenPlus10<'d, 'r> zero init World.transitionScreen World.setScreenSlide name select behavior None world args

/// Begin the ImNui declaration of a screen with the given arguments.
/// Note that changing the screen behavior over time has no effect as only the first moment is used.
static member beginScreen<'d when 'd :> ScreenDispatcher> name select behavior world args =
World.beginScreen8<'d> World.transitionScreen World.setScreenSlide name select behavior None world args

Expand Down

0 comments on commit e12461a

Please sign in to comment.