Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase width so "extras" would fit. Add remove dweller functionality. #23

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {

body > .container {
height: 450px;
width: 900px;
width: 1024px;
margin: -225px 0 0 -450px;
position: absolute;
top: 50%;
Expand Down
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (C) 2017
Copyright (C) 2017

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down Expand Up @@ -288,7 +288,7 @@
<select class="form-control" name="equipedOutfit" ng-model="dweller.equipedOutfit.id"
ng-options="label as value for (label,value) in dwelleroutfitslist"></select>
</div>

<div class="col-sm-4">
<label>Equiped Weapon</label>
<select class="form-control" name="equipedWeaponid" ng-model="dweller.equipedWeapon.id"
Expand Down Expand Up @@ -317,6 +317,7 @@

<div class="row save">
<button type="button" class="btn btn-primary pull-right" ng-click="maxSpecial()">Max Stats</button>
<button type="button" class="btn btn-primary pull-right" ng-click="deleteDweller()">Delete dweller</button>
</div>
<br>
<br>
Expand All @@ -339,12 +340,12 @@
<input type="text" class="form-control" name="otherName" placeholder="Name"
ng-model="otherName">
</div>

<div class="col-sm-4">
<label>Health</label>
<input type="number" class="form-control" name="healthother" min="0" ng-model="other.health">
</div>

<div class="col-sm-4">
<label>Is Death?</label>
<select class="form-control" name="death" ng-model="other.death"
Expand Down
16 changes: 16 additions & 0 deletions js/shelter.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,22 @@ app.controller('dwellerController', function ($scope) {
$scope.dweller = {};
};

$scope.deleteDweller = function (dweller) {
var lengthOld = $scope.save.dwellers.dwellers.length
var indexToDelete = -1
for( var i = (lengthOld - 1); i >= 0; i-- )
{
var dweller = $scope.save.dwellers.dwellers[i];
if( dweller.serializeId == $scope.dweller.serializeId )
{
indexToDelete = i
break
}
}

$scope.save.dwellers.dwellers.splice(indexToDelete, 1);
};

$scope.editTeam = function (team) {
$scope.team = team;
};
Expand Down