summaryrefslogtreecommitdiff |
diff options
author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-07-10 22:13:48 +0200 |
---|---|---|
committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2018-07-10 22:13:48 +0200 |
commit | 7b891ce04190365080fb4ef5d8dac68528a81af1 (patch) | |
tree | 78f332b074723167bde91b46929e450c8c6049c9 /src/map-editor/src/Struct/UI.elm | |
parent | f63602557a2f7320a7e02a3bf7dd9b339efaf4d1 (diff) |
Still working on it...
Diffstat (limited to 'src/map-editor/src/Struct/UI.elm')
-rw-r--r-- | src/map-editor/src/Struct/UI.elm | 53 |
1 files changed, 6 insertions, 47 deletions
diff --git a/src/map-editor/src/Struct/UI.elm b/src/map-editor/src/Struct/UI.elm index 447cfc4..aa83bd6 100644 --- a/src/map-editor/src/Struct/UI.elm +++ b/src/map-editor/src/Struct/UI.elm @@ -18,40 +18,30 @@ module Struct.UI exposing try_getting_displayed_nav, set_displayed_nav, reset_displayed_nav, - -- Manual Controls - has_manual_controls_enabled, -- Previous Action - has_focus, get_previous_action, set_previous_action ) -- Battlemap ------------------------------------------------------------------- import Struct.Location -import Struct.Navigator -------------------------------------------------------------------------------- -- TYPES ----------------------------------------------------------------------- -------------------------------------------------------------------------------- type Tab = StatusTab - | CharactersTab + | TilesTab | SettingsTab - | TimelineTab type Action = - UsedManualControls - | SelectedLocation Struct.Location.Ref - | SelectedCharacter Int - | AttackedCharacter Int + SelectedLocation Struct.Location.Ref type alias Type = { zoom_level : Float, - show_manual_controls : Bool, displayed_tab : (Maybe Tab), - previous_action : (Maybe Action), - displayed_nav : (Maybe Struct.Navigator.Type) + previous_action : (Maybe Action) } -------------------------------------------------------------------------------- @@ -65,10 +55,8 @@ default : Type default = { zoom_level = 1.0, - show_manual_controls = True, displayed_tab = Nothing, - previous_action = Nothing, - displayed_nav = Nothing + previous_action = Nothing } -- Zoom ------------------------------------------------------------------------ @@ -95,43 +83,14 @@ to_string : Tab -> String to_string tab = case tab of StatusTab -> "Status" - CharactersTab -> "Characters" + TilesTab -> "Tiles" SettingsTab -> "Settings" - TimelineTab -> "Timeline" get_all_tabs : (List Tab) get_all_tabs = - [StatusTab, CharactersTab, SettingsTab, TimelineTab] - --- Navigator ------------------------------------------------------------------- -try_getting_displayed_nav : Type -> (Maybe Struct.Navigator.Type) -try_getting_displayed_nav ui = ui.displayed_nav - -set_displayed_nav : Struct.Navigator.Type -> Type -> Type -set_displayed_nav nav ui = {ui | displayed_nav = (Just nav)} - -reset_displayed_nav : Type -> Type -reset_displayed_nav ui = {ui | displayed_nav = Nothing} - --- ManualControls -------------------------------------------------------------- -has_manual_controls_enabled : Type -> Bool -has_manual_controls_enabled ui = ui.show_manual_controls - -toggle_manual_controls : Type -> Type -toggle_manual_controls ui = - if (ui.show_manual_controls) - then - {ui | show_manual_controls = False} - else - {ui | show_manual_controls = True} - -set_enable_manual_controls : Bool -> Type -> Type -set_enable_manual_controls val ui = {ui | show_manual_controls = val} + [StatusTab, TilesTab, SettingsTab] -- Previous Action ------------------------------------------------------------- -has_focus : Type -> Bool -has_focus ui = True - set_previous_action : (Maybe Action) -> Type -> Type set_previous_action act ui = {ui | previous_action = act} |