Skip to content

Commit

Permalink
2.73.1369
Browse files Browse the repository at this point in the history
  • Loading branch information
toconnell committed Mar 21, 2018
1 parent 10937c8 commit e5d1e42
Show file tree
Hide file tree
Showing 29 changed files with 908 additions and 149 deletions.
5 changes: 3 additions & 2 deletions v1/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -3795,7 +3795,7 @@ class settlement:
<div class="campaign_summary_survivor_tags_container">
<div
class="survivor_tag fighting_arts_tag"
ng-repeat="fa in s.sheet.fighting_arts"
ng-repeat="fa in s.sheet.fighting_arts track by $index"
>
{{settlement.game_assets.fighting_arts[fa].name}}
</div>
Expand Down Expand Up @@ -4597,7 +4597,7 @@ class settlement:
</div>
<ul class="quickview_asset_list">
<li
ng-repeat="fa in s.sheet.fighting_arts"
ng-repeat="fa in s.sheet.fighting_arts track by $index"
ng-class="{true: 'faded'}[s.sheet.cannot_use_fighting_arts]"
>
<b>{{settlement.game_assets.fighting_arts[fa].name}}:</b>
Expand Down Expand Up @@ -6645,6 +6645,7 @@ def render(view_html, head=[], http_headers=None, body_class=None, include_templ
'survivor_search.html',
'timeline.html',
'event_log.html',
'help.html',
]
ui_templates += include_templates
for t in ui_templates:
Expand Down
74 changes: 51 additions & 23 deletions v1/media/kdmManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,32 +361,42 @@ app.controller('rootController', function($scope, $rootScope, $http, $log) {
} else {
// pass
};
};
}; //end of dashboard stuff

console.time('/admin/get/webapp_alerts');
$http.get($scope.api_url + 'admin/get/webapp_alerts').then(
function(result){
$scope.webappAlerts = result.data;
console.timeEnd('/admin/get/webapp_alerts');
},
function(result){console.error('Could not retrieve webapp alerts!');}
);

},
function(errorPayload) {
console.error("[USER] Could not retrieve user information!");
console.error("[USER] " + errorPayload.status + " -> " + errorPayload.data);
}
);
function(errorPayload) {
console.error("[USER] Could not retrieve user information!");
console.error("[USER] " + errorPayload.status + " -> " + errorPayload.data);
}
);

// now do stuff that we need the settlement to do
if ($scope.settlementPromise !== undefined) {
$scope.settlementPromise.then(function() {
$scope.userPromise.then(function() {
// determine if the user is a settlement admin
if ($scope.settlement.sheet.admins.indexOf($scope.user_login) == -1) {
$scope.user_is_settlement_admin = false;
console.error($scope.user_login + ' is not a settlement admin.');
} else {
$scope.user_is_settlement_admin = true;
console.warn($scope.user_login + ' is a settlement admin!');
};
});
// now do stuff that we need the settlement to do
if ($scope.settlementPromise !== undefined) {
$scope.settlementPromise.then(function() {
$scope.userPromise.then(function() {
// determine if the user is a settlement admin
if ($scope.settlement.sheet.admins.indexOf($scope.user_login) == -1) {
$scope.user_is_settlement_admin = false;
console.error($scope.user_login + ' is not a settlement admin.');
} else {
$scope.user_is_settlement_admin = true;
console.warn($scope.user_login + ' is a settlement admin!');
};
});
};

});
};

};

$scope.initializeSettlement = function(src_view, api_url, settlement_id) {

// every view in the legacy webapp has to call this method. Therefore,
Expand Down Expand Up @@ -841,6 +851,23 @@ app.controller("updateExpansionsController", function($scope) {
$scope.scratch= {}
$scope.scratch['expansions_updated'] = false;
$scope.toggleExpansion = function(e_handle, index) {
// figure out if its mandatory
var mandatoryExpansion = false;
if ($scope.settlement.game_assets.campaign.settlement_sheet_init.expansions.indexOf(e_handle) != -1){
mandatoryExpansion = true;
};

// bail verbosely if it is mandatory
if (mandatoryExpansion === true) {
var campaign_name = $scope.settlement.game_assets.campaign.name;
var e_name = $scope.settlement.game_assets.expansions[e_handle].name;
var err_msg = "The " + e_name + " expansion is required by the " + campaign_name + " campaign and may not be removed!";
console.error(err_msg);
window.alert(err_msg);
return false;
};

// otherwise, lock and load (or unload)
$scope.scratch['expansions_updated'] = true;
// console.error('updated: ' + $scope.scratch.expansions_updated);
if ($scope.settlement.sheet.expansions.indexOf(e_handle) === -1) {
Expand Down Expand Up @@ -1347,8 +1374,9 @@ app.controller ("survivorSearchController", function($scope) {

});



// modal help overlay -- all views
app.controller ("helpModalController", function($scope) {
});


// console.log($scope.settlement.game_assets.campaign.settlement_sheet_init.expansions.includes(e_handle));
7 changes: 5 additions & 2 deletions v1/media/settlement_event_log.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.survivor_curse {background-color: #FFD740; background: #FFD740; }
.survivor_death {background-color: #F50057; background: #F50057; color: #fff}
.survivor_death:before {content: "f"; margin-left: 0.5%; font-family: "kdm-font-10"}
.survivor_birth {background-color: #B2FF59; background: linear-gradient(#B2FF59, #d2fF59, #B2FF59)}
.survivor_join {background-color: #EEFF41; background: #EEFF41; }
.defeated_monster {color: #fff; background-color: #997030; background: #997030; }
.new_settlement {background-color: #1C7FC2; background: linear-gradient(to bottom, #1C7FC2, #137ABF); color: #fff; }
.add_location {color: #fff; background: linear-gradient(to bottom, #73C26C, #51B952); }
.add_innovation {color: #fff; background: linear-gradient(#4EC7F1, #40ADD0); }
.sysadmin {color: #fff; background: #999; }
.sysadmin {background: #999; color: #fff; }
.sysadmin:before {content: "a"; margin-left: 0.5%; font-family: "kdm-font-2"}
.set_retired {background: #C5C6CB; }
.set_principle {background-color: #FF0040; color: #fff;}
.set_principle {background-color: #A67526; color: #fff;}
.set_principle:before {content: "g"; margin-left: 0.5%; font-family: "kdm-font-10"}
35 changes: 35 additions & 0 deletions v1/media/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ div#mySidenav button {
.expansion_toggle_container {padding: 2%; width: 90%; margin: 0 auto; border: 4px solid #aaa; margin-bottom: 3%; color: #aaa; }
.expansion_toggle_container .kd_sheet_ui_box {border-color: #aaa; }
.expansion_toggle_container.enabled {color: #000; border-color: #000; }
.expansion_toggle_container.enabled.mandatory_expansion {color: #DC2426; }
.expansion_toggle_container.enabled.mandatory_expansion .kd_sheet_ui_box {border-color: #DC2426; }
.expansion_toggle_container.enabled.mandatory_expansion .kd_sheet_ui_box.checked {background-color: #DC2426; }
.expansion_toggle_container.enabled .kd_sheet_ui_box { border-color: #000; }
.expansion_toggle_subtitle {font-family: 'Metrophobic'; font-size: 25pt; margin-left: 90px; }
.expansion_management_form button {font-weight: bold; }
Expand Down Expand Up @@ -304,6 +307,17 @@ div#mySidenav button {
.timeline_current_ly_controls {border-bottom: 3px solid #ccc; width: 95%; margin: 0 auto; margin-bottom: 5%; }
.timeline_current_ly_buttons_container button {font-family: 'Metrophobic';}

/* nav bar help tips - mobile */
.help_container p {font-size: 30pt; font-family: 'metrophobic'; }
.help_container h4 {margin-left: 2%; margin-bottom: 1%; }
.help_container .kd_sheet_ui_row_tip {width: 96%; margin: 0 auto; }
.help_modal_tip_repeater {margin: 2%; margin-left: 3%; font-family: 'Metrophobic'; font-size: 30pt; }
.help_modal_tip_repeater .kd_sheet_ui_box {margin-left: 1%; margin-right: 1%; width: 20px; height: 20px; }
.help_modal_tip_repeater.kpi {background-color: #ffefef; padding: 2%; text-align: justify; font-size: 30pt; }
.webapp_alert_detail_bar {display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: space-between; padding: 1%; padding-right: 2%; }
.webapp_alert_detail_bar .type_stamp {font-size: 25pt; }
.webapp_alert_detail_bar .date_stamp {font-size: 25pt; font-style: italic; }

/* event log styles - mobile */
.event_log .kd_sheet_ui_row_tip {margin: 0 auto; width: 93%; margin-bottom: 3%; margin-top: 3%; }
.event_log_clicker {border: 2px solid #000; padding: 1%; width: 93%; margin: 1%; font-family: 'Metrophobic'; margin-left: 2%; font-size: 35pt; margin-bottom: 3%}
Expand Down Expand Up @@ -1557,6 +1571,18 @@ span.survivor_search_retired_survivors_warning {color: #999; font-style:italic;
.timeline_current_ly_buttons_container {display: flex; flex-direction: row; flex-wrap: nowrap; }
.timeline_current_ly_buttons_container button {font-size: 15pt; margin-top: 1%; }

/* modal help - tablet */
.kd_sheet_ui_inner_ring_container.help_container {width: 90%; }
.help_container p {font-size: 17pt; }
.help_container h4 {margin-top: auto; }
.help_container .kd_sheet_ui_row_tip {margin: 0 auto; width: 92%; font-size: 17pt; }
.help_col_container {column-count: 2; column-width: auto; column-gap: 5px; margin: 1%; }
.help_modal_tip_repeater {font-size: 17pt; break-inside: avoid;}
.help_modal_tip_repeater .kd_sheet_ui_box {width: 12px; height: 12px; }
.help_modal_tip_repeater.kpi {font-size: 17pt; }
.webapp_alert_detail_bar .type_stamp,
.webapp_alert_detail_bar .date_stamp {font-size: 15pt; }

/* event log - tablet */
.event_log_clicker {font-size: 20pt; }
.event_log_line {font-size: 18pt; }
Expand Down Expand Up @@ -2607,6 +2633,15 @@ span.survivor_search_retired_survivors_warning {color: #999; font-style:italic;
.timeline_current_ly_controls {display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; padding-bottom: 2%; }
.timeline_current_ly_controls button {width: 40%; margin: 1%; display: block; }

/* help modal - wide */
.webapp_alert_detail_bar {padding-top: 0; }
.webapp_alert_detail_bar .type_stamp,
.webapp_alert_detail_bar .date_stamp {font-size: 9pt; }
.help_modal_tip_repeater.kpi {font-size: 10pt; padding: 1%; }
.help_modal_tip_repeater {font-size: 11pt; }
.help_container .kd_sheet_ui_row_tip {font-size: 10pt; }
.help_modal_tip_repeater .kd_sheet_ui_box {width: 9px; height: 9px; }

/* event log - wide */
.event_log_clicker {font-size: 12pt; margin-bottom: 1%; }
.event_log_line {font-size: 12pt; margin: 3px; padding: 2px; padding-left: 4px; }
Expand Down
2 changes: 1 addition & 1 deletion v1/settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title = Interactive campaign manager for Kingdom Death: Monster.
admin_email = toconnell@tyrannybelle.com
debug = True
version = 2.72.1348
version = 2.73.1369
tld = https://kdm-manager.com
static_url = https://media.kdm-manager.com
validate_email = False
Expand Down
20 changes: 13 additions & 7 deletions v1/templates/expansion_content_manager.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ <h3>Expansions!</h3>
<div
class="expansions_controls_container"
ng-init="addNewSettlementsToScope('$api_url')"
ng-if="settlement.sheet != undefined && settlement.game_assets != undefined"
>

<p class="kd_sheet_ui_row_tip" ng-if="user.user.preferences.show_ui_tips">
Expand All @@ -31,12 +32,18 @@ <h4 class="expansion_category_header">{{category}}</h4>
class="clickable expansion_toggle_container"
ng-repeat="x in new_settlement_assets.expansions"
ng-if="x.ui.pretty_category == category"
ng-class="{enabled: settlement.sheet.expansions.indexOf(x.handle) != -1}"
ng-init="x.mandatory = settlement.game_assets.campaign.settlement_sheet_init.expansions.indexOf(x.handle) != -1"
ng-class="{
enabled: settlement.sheet.expansions.indexOf(x.handle) != -1,
mandatory_expansion: x.mandatory === true,
}"
ng-click="toggleExpansion(x.handle, settlement.sheet.expansions.indexOf(x.handle))"
>
<div
class="kd_sheet_ui_box"
ng-class="{checked: settlement.sheet.expansions.indexOf(x.handle) != -1}"
ng-class="{
checked: settlement.sheet.expansions.indexOf(x.handle) != -1,
}"
></div>
{{x.name}}
<div
Expand Down Expand Up @@ -73,11 +80,10 @@ <h4 class="expansion_category_header">{{category}}</h4>
user.user.preferences.show_ui_tips
"
>
<b>Warning!</b> Disabling expansion content when it is
required by the campaign or the items on the campaign's
Settlement and Survivor Sheets (innovations, locations,
Fighting Arts, etc.) <b>will</b> cause errors and other
unexpected/undesirable behavior!
<b>Warning!</b> Unselecting expansion content after you
have added that expansion's game assets (Fighting Arts, Disorders,
Story Events, etc.) to your campaign <b>will</b> cause
errors and other issues in the Manager.
</p>

<button
Expand Down
Loading

0 comments on commit e5d1e42

Please sign in to comment.