summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/nginx.conf80
-rw-r--r--src/battlemap/src/Character.elm19
-rw-r--r--src/battlemap/src/Model/HandleServerReply/AddChar.elm5
-rw-r--r--src/battlemap/src/Send/LoadBattlemap.elm2
-rw-r--r--src/battlemap/src/Shim/Model.elm3
-rw-r--r--src/battlemap/src/View/Battlemap.elm9
-rw-r--r--src/battlemap/www/style.css6
7 files changed, 77 insertions, 47 deletions
diff --git a/conf/nginx.conf b/conf/nginx.conf
index c91d76a..66ce5c5 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -64,44 +64,44 @@ http {
}
}
- ## Public tests
- server {
- listen 443;
- server_name tacticians.online;
-
- ssl on;
- ssl_certificate /secure/tacticians.pem;
- ssl_certificate_key /secure/tacticians.key;
-
- access_log /var/log/nginx/public.ssl_access_log main;
- error_log /var/log/nginx/public.ssl_error_log info;
-
- root /my/src/tacticians-client/www/;
-
- location / {
- autoindex on;
- autoindex_exact_size off;
- }
-
- location /handler/ {
- proxy_set_header Host $host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_pass http://127.0.0.1:8000;
- }
- }
-
- ## Let's Encrypt Tests
- server {
- listen 80;
- server_name acme;
-
- location /.well-known/acme-challenge/
- {
- alias /var/www/challenges/;
- try_files $uri =404;
- }
-
- access_log /var/log/nginx/acme.access_log main;
- error_log /var/log/nginx/acme.error_log info;
- }
+# ## Public tests
+# server {
+# listen 443;
+# server_name tacticians.online;
+#
+# ssl on;
+# ssl_certificate /secure/tacticians.pem;
+# ssl_certificate_key /secure/tacticians.key;
+#
+# access_log /var/log/nginx/public.ssl_access_log main;
+# error_log /var/log/nginx/public.ssl_error_log info;
+#
+# root /my/src/tacticians-client/www/;
+#
+# location / {
+# autoindex on;
+# autoindex_exact_size off;
+# }
+#
+# location /handler/ {
+# proxy_set_header Host $host;
+# proxy_set_header X-Real-IP $remote_addr;
+# proxy_pass http://127.0.0.1:8000;
+# }
+# }
+#
+# ## Let's Encrypt Tests
+# server {
+# listen 80;
+# server_name acme;
+#
+# location /.well-known/acme-challenge/
+# {
+# alias /var/www/challenges/;
+# try_files $uri =404;
+# }
+#
+# access_log /var/log/nginx/acme.access_log main;
+# error_log /var/log/nginx/acme.error_log info;
+# }
}
diff --git a/src/battlemap/src/Character.elm b/src/battlemap/src/Character.elm
index 0099b0e..ed80b3c 100644
--- a/src/battlemap/src/Character.elm
+++ b/src/battlemap/src/Character.elm
@@ -10,7 +10,9 @@ module Character exposing
get_location,
set_location,
get_movement_points,
- get_attack_range
+ get_attack_range,
+ is_enabled,
+ set_enabled
)
-- Battlemap -------------------------------------------------------------------
@@ -28,7 +30,8 @@ type alias Type =
location : Battlemap.Location.Type,
team : Int,
movement_points : Int,
- atk_dist : Int
+ atk_dist : Int,
+ enabled : Bool
}
type alias Ref = String
@@ -49,9 +52,10 @@ new : (
Int -> -- team
Int -> -- movement_points
Int -> -- atk_dist
+ Bool -> -- enabled
Type
)
-new id name icon portrait location team movement_points atk_dist =
+new id name icon portrait location team movement_points atk_dist enabled =
{
id = id,
name = name,
@@ -60,7 +64,8 @@ new id name icon portrait location team movement_points atk_dist =
location = location,
team = team,
movement_points = movement_points,
- atk_dist = atk_dist
+ atk_dist = atk_dist,
+ enabled = enabled
}
get_ref : Type -> Ref
@@ -86,3 +91,9 @@ get_movement_points char = char.movement_points
get_attack_range : Type -> Int
get_attack_range char = char.atk_dist
+
+is_enabled : Type -> Bool
+is_enabled char = char.enabled
+
+set_enabled : Type -> Bool -> Type
+set_enabled char enabled = {char | enabled = enabled}
diff --git a/src/battlemap/src/Model/HandleServerReply/AddChar.elm b/src/battlemap/src/Model/HandleServerReply/AddChar.elm
index 0324faa..8924f93 100644
--- a/src/battlemap/src/Model/HandleServerReply/AddChar.elm
+++ b/src/battlemap/src/Model/HandleServerReply/AddChar.elm
@@ -29,7 +29,8 @@ type alias CharData =
loc_y : Int,
team : Int,
mov_pts : Int,
- atk_rg : Int
+ atk_rg : Int,
+ enabled : Bool
}
--------------------------------------------------------------------------------
@@ -48,6 +49,7 @@ char_decoder =
|> (Json.Decode.Pipeline.required "team" Json.Decode.int)
|> (Json.Decode.Pipeline.required "mov_pts" Json.Decode.int)
|> (Json.Decode.Pipeline.required "atk_rg" Json.Decode.int)
+ |> (Json.Decode.Pipeline.required "enabled" Json.Decode.bool)
)
--------------------------------------------------------------------------------
@@ -73,6 +75,7 @@ apply_to model serialized_char =
char_data.team
char_data.mov_pts
char_data.atk_rg
+ char_data.enabled
)
)
diff --git a/src/battlemap/src/Send/LoadBattlemap.elm b/src/battlemap/src/Send/LoadBattlemap.elm
index 1aba7d7..904448d 100644
--- a/src/battlemap/src/Send/LoadBattlemap.elm
+++ b/src/battlemap/src/Send/LoadBattlemap.elm
@@ -32,7 +32,7 @@ try_encoding model =
(Json.Encode.object
[
("session_token", (Json.Encode.string "0")),
- ("player_id", (Json.Encode.string "0")),
+ ("player_id", (Json.Encode.string model.player_id)),
("battlemap_id", (Json.Encode.string "0")),
("instance_id", (Json.Encode.string "0"))
]
diff --git a/src/battlemap/src/Shim/Model.elm b/src/battlemap/src/Shim/Model.elm
index 9a3e68d..502a38d 100644
--- a/src/battlemap/src/Shim/Model.elm
+++ b/src/battlemap/src/Shim/Model.elm
@@ -32,7 +32,8 @@ new_char id team x y mp ad storage =
portrait = id,
location = {x = x, y = y},
movement_points = mp,
- atk_dist = ad
+ atk_dist = ad,
+ enabled = (team == 0)
}
storage
)
diff --git a/src/battlemap/src/View/Battlemap.elm b/src/battlemap/src/View/Battlemap.elm
index beac2ab..c05644f 100644
--- a/src/battlemap/src/View/Battlemap.elm
+++ b/src/battlemap/src/View/Battlemap.elm
@@ -35,6 +35,15 @@ char_on_map char =
(Html.div
[
(Html.Attributes.class "battlemap-character-icon"),
+ (Html.Attributes.class
+ (
+ if (Character.is_enabled char)
+ then
+ "battlemap-character-icon-enabled"
+ else
+ "battlemap-character-icon-disabled"
+ )
+ ),
(Html.Attributes.class "battlemap-tiled"),
(Html.Attributes.class
("asset-character-icon-" ++ (Character.get_icon_id char))
diff --git a/src/battlemap/www/style.css b/src/battlemap/www/style.css
index 406673a..1660547 100644
--- a/src/battlemap/www/style.css
+++ b/src/battlemap/www/style.css
@@ -46,6 +46,12 @@
.battlemap-can-go-to-marker {background-color:rgba(0,0,0,0.5);}
.battlemap-can-attack-marker {background-color:rgba(0,0,0,0.7);}
+.battlemap-character-icon-disabled
+{
+ opacity: 0.5;
+ filter: grayscale(50%);
+ border: 2px dotted rgba(0,0,0,0.7);
+}
/**** Path Icons **************************************************************/
.battlemap-path-icon-NR:before,
.battlemap-path-icon-LR:before,