Content editor: Only enable item's "has equip effects" if the item category is wearable.

This commit is contained in:
Oskar Wiksten
2013-03-16 09:45:15 +01:00
parent 626c558335
commit bea69f06bf
2 changed files with 14 additions and 4 deletions

View File

@@ -13,6 +13,16 @@ var ATEditor = (function(ATEditor, model, ATModelFunctions) {
$scope.$watch('obj.category', function(val) {
$scope.isWeapon = ATModelFunctions.itemCategoryFunctions.isWeaponCategory(val);
$scope.isUsable = ATModelFunctions.itemCategoryFunctions.isUsableCategory(val);
if (!$scope.isUsable) {
$scope.obj.hasUseEffect = false;
}
$scope.isWearable = ATModelFunctions.itemCategoryFunctions.isWearableCategory(val);
if (!$scope.isWearable) {
$scope.obj.hasEquipEffect = false;
$scope.obj.hasHitEffect = false;
$scope.obj.hasKillEffect = false;
}
});
$scope.$watch('obj.hasManualPrice', function(hasManualPrice) {
$scope.obj.baseMarketCost = hasManualPrice ? ATModelFunctions.itemFunctions.calculateItemCost($scope.obj) : 0;

View File

@@ -35,16 +35,16 @@
<option value="4">Rare (purple)</option>
</select>
</div>
<div class="fieldWithLabel">
<div class="fieldWithLabel" ng-ds-fade="isWearable">
<label class="checkbox"><input type="checkbox" id="hasEquipEffect" ng-model="obj.hasEquipEffect" />Has equip effect</label>
</div>
<div class="fieldWithLabel">
<div class="fieldWithLabel" ng-ds-fade="isUsable">
<label class="checkbox"><input type="checkbox" id="hasUseEffect" ng-model="obj.hasUseEffect" />Has use effect</label>
</div>
<div class="fieldWithLabel">
<div class="fieldWithLabel" ng-ds-fade="isWearable">
<label class="checkbox"><input type="checkbox" id="hasHitEffect" ng-model="obj.hasHitEffect" />Has effect on every hit</label>
</div>
<div class="fieldWithLabel">
<div class="fieldWithLabel" ng-ds-fade="isWearable">
<label class="checkbox"><input type="checkbox" id="hasKillEffect" ng-model="obj.hasKillEffect" />Has effect on every kill</label>
</div>
</fieldset>