aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/battlemap/src/Update/SelectCharacter.elm5
-rw-r--r--src/battlemap/src/View/Controlled/ManualControls.elm (renamed from src/battlemap/src/View/SubMenu/ManualControls.elm)2
-rw-r--r--src/battlemap/src/View/Controlled/Targets.elm (renamed from src/battlemap/src/View/SubMenu/Targets.elm)0
-rw-r--r--src/battlemap/src/View/SubMenu.elm26
-rw-r--r--src/battlemap/src/View/SubMenu/Characters.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Characters.elm)2
-rw-r--r--src/battlemap/src/View/SubMenu/Settings.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Settings.elm)2
-rw-r--r--src/battlemap/src/View/SubMenu/Status.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Status.elm)6
-rw-r--r--src/battlemap/src/View/SubMenu/Status/CharacterInfo.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Status/CharacterInfo.elm)2
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Timeline.elm)14
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/Attack.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Timeline/Attack.elm)2
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/Movement.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Timeline/Movement.elm)2
-rw-r--r--src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm (renamed from src/battlemap/src/View/SubMenu/TabMenu/Timeline/WeaponSwitch.elm)2
12 files changed, 41 insertions, 24 deletions
diff --git a/src/battlemap/src/Update/SelectCharacter.elm b/src/battlemap/src/Update/SelectCharacter.elm
index 3f0dbd4..152aa9c 100644
--- a/src/battlemap/src/Update/SelectCharacter.elm
+++ b/src/battlemap/src/Update/SelectCharacter.elm
@@ -73,7 +73,10 @@ ctrl_or_focus_character model target_char_id target_char =
model.char_turn
)
),
- ui = (Struct.UI.set_previous_action model.ui Nothing)
+ ui =
+ (Struct.UI.reset_displayed_tab
+ (Struct.UI.set_previous_action model.ui Nothing)
+ )
}
else
{model |
diff --git a/src/battlemap/src/View/SubMenu/ManualControls.elm b/src/battlemap/src/View/Controlled/ManualControls.elm
index f2e900c..8d37333 100644
--- a/src/battlemap/src/View/SubMenu/ManualControls.elm
+++ b/src/battlemap/src/View/Controlled/ManualControls.elm
@@ -1,4 +1,4 @@
-module View.SideBar.ManualControls exposing (get_html)
+module View.ManualControls exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
diff --git a/src/battlemap/src/View/SubMenu/Targets.elm b/src/battlemap/src/View/Controlled/Targets.elm
index 7bb4c36..7bb4c36 100644
--- a/src/battlemap/src/View/SubMenu/Targets.elm
+++ b/src/battlemap/src/View/Controlled/Targets.elm
diff --git a/src/battlemap/src/View/SubMenu.elm b/src/battlemap/src/View/SubMenu.elm
index 694c826..1690024 100644
--- a/src/battlemap/src/View/SubMenu.elm
+++ b/src/battlemap/src/View/SubMenu.elm
@@ -11,16 +11,32 @@ import Struct.UI
import Util.Html
+import View.SubMenu.Characters
+import View.SubMenu.Settings
+import View.SubMenu.Status
+import View.SubMenu.Timeline
+
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
get_inner_html : (
Struct.Model.Type ->
Struct.UI.Tab ->
- (List (Html.Html Struct.Event.Type))
+ (Html.Html Struct.Event.Type)
)
get_inner_html model tab =
- [(Html.text "Not available")]
+ case tab of
+ Struct.UI.StatusTab ->
+ (View.SubMenu.Status.get_html model)
+
+ Struct.UI.CharactersTab ->
+ (View.SubMenu.Characters.get_html model)
+
+ Struct.UI.SettingsTab ->
+ (View.SubMenu.Settings.get_html model)
+
+ Struct.UI.TimelineTab ->
+ (View.SubMenu.Timeline.get_html model)
--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
@@ -30,10 +46,8 @@ get_html model =
case (Struct.UI.try_getting_displayed_tab model.ui) of
(Just tab) ->
(Html.div
- [
- (Html.Attributes.class "battlemap-sub-menu")
- ]
- (get_inner_html model tab)
+ [(Html.Attributes.class "battlemap-sub-menu")]
+ [(get_inner_html model tab)]
)
Nothing ->
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Characters.elm b/src/battlemap/src/View/SubMenu/Characters.elm
index 2eaca27..a34cf4a 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Characters.elm
+++ b/src/battlemap/src/View/SubMenu/Characters.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Characters exposing (get_html)
+module View.SubMenu.Characters exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Dict
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Settings.elm b/src/battlemap/src/View/SubMenu/Settings.elm
index 3f42739..3bd64ff 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Settings.elm
+++ b/src/battlemap/src/View/SubMenu/Settings.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Settings exposing (get_html)
+module View.SubMenu.Settings exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Status.elm b/src/battlemap/src/View/SubMenu/Status.elm
index 1eb3e5e..2ff5bf4 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Status.elm
+++ b/src/battlemap/src/View/SubMenu/Status.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Status exposing (get_html)
+module View.SubMenu.Status exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Dict
@@ -17,7 +17,7 @@ import Struct.Statistics
import Struct.Tile
import Struct.UI
-import View.SideBar.TabMenu.Status.CharacterInfo
+import View.SubMenu.Status.CharacterInfo
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
@@ -143,7 +143,7 @@ get_html model =
(Just (Struct.UI.SelectedCharacter target_char)) ->
case (Dict.get target_char model.characters) of
(Just char) ->
- (View.SideBar.TabMenu.Status.CharacterInfo.get_html
+ (View.SubMenu.Status.CharacterInfo.get_html
model
char
)
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Status/CharacterInfo.elm b/src/battlemap/src/View/SubMenu/Status/CharacterInfo.elm
index 033426a..d5eb8b7 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Status/CharacterInfo.elm
+++ b/src/battlemap/src/View/SubMenu/Status/CharacterInfo.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Status.CharacterInfo exposing (get_html)
+module View.SubMenu.Status.CharacterInfo exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Html
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Timeline.elm b/src/battlemap/src/View/SubMenu/Timeline.elm
index 1073735..eb67085 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Timeline.elm
+++ b/src/battlemap/src/View/SubMenu/Timeline.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Timeline exposing (get_html)
+module View.SubMenu.Timeline exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Array
@@ -13,9 +13,9 @@ import Struct.Event
import Struct.TurnResult
import Struct.Model
-import View.SideBar.TabMenu.Timeline.Attack
-import View.SideBar.TabMenu.Timeline.Movement
-import View.SideBar.TabMenu.Timeline.WeaponSwitch
+import View.SubMenu.Timeline.Attack
+import View.SubMenu.Timeline.Movement
+import View.SubMenu.Timeline.WeaponSwitch
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
@@ -28,13 +28,13 @@ get_turn_result_html : (
get_turn_result_html model turn_result =
case turn_result of
(Struct.TurnResult.Moved movement) ->
- (View.SideBar.TabMenu.Timeline.Movement.get_html model movement)
+ (View.SubMenu.Timeline.Movement.get_html model movement)
(Struct.TurnResult.Attacked attack) ->
- (View.SideBar.TabMenu.Timeline.Attack.get_html model attack)
+ (View.SubMenu.Timeline.Attack.get_html model attack)
(Struct.TurnResult.SwitchedWeapon weapon_switch) ->
- (View.SideBar.TabMenu.Timeline.WeaponSwitch.get_html
+ (View.SubMenu.Timeline.WeaponSwitch.get_html
model
weapon_switch
)
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Timeline/Attack.elm b/src/battlemap/src/View/SubMenu/Timeline/Attack.elm
index 0bd59b8..6dab423 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Timeline/Attack.elm
+++ b/src/battlemap/src/View/SubMenu/Timeline/Attack.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Timeline.Attack exposing (get_html)
+module View.SubMenu.Timeline.Attack exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Dict
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Timeline/Movement.elm b/src/battlemap/src/View/SubMenu/Timeline/Movement.elm
index 4e5579a..f561d6c 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Timeline/Movement.elm
+++ b/src/battlemap/src/View/SubMenu/Timeline/Movement.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Timeline.Movement exposing (get_html)
+module View.SubMenu.Timeline.Movement exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Dict
diff --git a/src/battlemap/src/View/SubMenu/TabMenu/Timeline/WeaponSwitch.elm b/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm
index b64a293..91191c4 100644
--- a/src/battlemap/src/View/SubMenu/TabMenu/Timeline/WeaponSwitch.elm
+++ b/src/battlemap/src/View/SubMenu/Timeline/WeaponSwitch.elm
@@ -1,4 +1,4 @@
-module View.SideBar.TabMenu.Timeline.WeaponSwitch exposing (get_html)
+module View.SubMenu.Timeline.WeaponSwitch exposing (get_html)
-- Elm -------------------------------------------------------------------------
import Dict