summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/map-editor')
-rw-r--r--src/map-editor/src/ElmModule/Update.elm7
-rw-r--r--src/map-editor/src/Struct/Event.elm1
-rw-r--r--src/map-editor/src/Struct/UI.elm2
-rw-r--r--src/map-editor/src/Update/GoToMainMenu.elm24
-rw-r--r--src/map-editor/src/View/MainMenu.elm22
-rw-r--r--src/map-editor/src/View/SubMenu/Settings.elm6
-rw-r--r--src/map-editor/www/index.html2
7 files changed, 54 insertions, 10 deletions
diff --git a/src/map-editor/src/ElmModule/Update.elm b/src/map-editor/src/ElmModule/Update.elm
index bc84f5b..850e659 100644
--- a/src/map-editor/src/ElmModule/Update.elm
+++ b/src/map-editor/src/ElmModule/Update.elm
@@ -8,15 +8,17 @@ import Struct.Model
import Update.ChangeScale
import Update.ClearToolboxSelection
+import Update.GoToMainMenu
import Update.HandleServerReply
import Update.PrettifySelectedTiles
-import Update.SendMapUpdate
import Update.SelectTab
import Update.SelectTile
+import Update.SendMapUpdate
import Update.SetRequestedHelp
import Update.SetToolboxMode
import Update.SetToolboxShape
import Update.SetToolboxTemplate
+
--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------
@@ -75,3 +77,6 @@ update event model =
Struct.Event.SendMapUpdateRequested ->
(Update.SendMapUpdate.apply_to new_model)
+
+ Struct.Event.GoToMainMenu ->
+ (Update.GoToMainMenu.apply_to new_model)
diff --git a/src/map-editor/src/Struct/Event.elm b/src/map-editor/src/Struct/Event.elm
index d0d84e1..449f590 100644
--- a/src/map-editor/src/Struct/Event.elm
+++ b/src/map-editor/src/Struct/Event.elm
@@ -28,6 +28,7 @@ type Type =
| TemplateRequested (Int, Int)
| PrettifySelectionRequested
| SendMapUpdateRequested
+ | GoToMainMenu
attempted : (Result.Result err val) -> Type
attempted act =
diff --git a/src/map-editor/src/Struct/UI.elm b/src/map-editor/src/Struct/UI.elm
index fe7b700..b35a60a 100644
--- a/src/map-editor/src/Struct/UI.elm
+++ b/src/map-editor/src/Struct/UI.elm
@@ -51,7 +51,7 @@ default : Type
default =
{
zoom_level = 1.0,
- displayed_tab = Nothing,
+ displayed_tab = (Just TilesTab),
previous_action = Nothing
}
diff --git a/src/map-editor/src/Update/GoToMainMenu.elm b/src/map-editor/src/Update/GoToMainMenu.elm
new file mode 100644
index 0000000..f2ec989
--- /dev/null
+++ b/src/map-editor/src/Update/GoToMainMenu.elm
@@ -0,0 +1,24 @@
+module Update.GoToMainMenu exposing (apply_to)
+-- Elm -------------------------------------------------------------------------
+
+-- Battle ----------------------------------------------------------------------
+import Action.Ports
+
+import Constants.IO
+
+import Struct.Model
+import Struct.Event
+
+--------------------------------------------------------------------------------
+-- LOCAL -----------------------------------------------------------------------
+--------------------------------------------------------------------------------
+
+--------------------------------------------------------------------------------
+-- EXPORTED --------------------------------------------------------------------
+--------------------------------------------------------------------------------
+apply_to : Struct.Model.Type -> (Struct.Model.Type, (Cmd Struct.Event.Type))
+apply_to model =
+ (
+ model,
+ (Action.Ports.go_to (Constants.IO.base_url ++"/main-menu/"))
+ )
diff --git a/src/map-editor/src/View/MainMenu.elm b/src/map-editor/src/View/MainMenu.elm
index b9a8922..fd5801e 100644
--- a/src/map-editor/src/View/MainMenu.elm
+++ b/src/map-editor/src/View/MainMenu.elm
@@ -31,8 +31,24 @@ get_html =
[
(Html.Attributes.class "map-main-menu")
]
- (List.map
- (get_menu_button_html)
- (Struct.UI.get_all_tabs)
+ (
+ (
+ (Html.button
+ [ (Html.Events.onClick Struct.Event.GoToMainMenu) ]
+ [ (Html.text "Main Menu") ]
+ )
+ ::
+ (List.map
+ (get_menu_button_html)
+ (Struct.UI.get_all_tabs)
+ )
+ )
+ ++
+ [
+ (Html.button
+ [ (Html.Events.onClick Struct.Event.SendMapUpdateRequested) ]
+ [ (Html.text "Save Map") ]
+ )
+ ]
)
)
diff --git a/src/map-editor/src/View/SubMenu/Settings.elm b/src/map-editor/src/View/SubMenu/Settings.elm
index 98405d0..1661053 100644
--- a/src/map-editor/src/View/SubMenu/Settings.elm
+++ b/src/map-editor/src/View/SubMenu/Settings.elm
@@ -36,10 +36,6 @@ get_html model =
[
(scale_button (0.75) "Zoom -"),
(scale_button 0 "Zoom Reset"),
- (scale_button (1.15) "Zoom +"),
- (Html.button
- [ (Html.Events.onClick Struct.Event.SendMapUpdateRequested) ]
- [ (Html.text "Save Map") ]
- )
+ (scale_button (1.15) "Zoom +")
]
)
diff --git a/src/map-editor/www/index.html b/src/map-editor/www/index.html
index 80b147d..3828b22 100644
--- a/src/map-editor/www/index.html
+++ b/src/map-editor/www/index.html
@@ -9,6 +9,7 @@
<script src="script/main.js"></script>
<script src="../global/script/session.js"></script>
<script src="../global/script/urlparams.js"></script>
+ <script src="../global/script/navigation.js"></script>
<script>
tacticians_online.session.load();
@@ -23,6 +24,7 @@
);
tacticians_online.session.attach_to(tacticians_online.app);
+ tacticians_online.navigation.attach_to(tacticians_online.app);
</script>
</body>
</html>