Created
November 11, 2020 07:53
-
-
Save IanSSenne/4a7c80dc8b98794e85a6d713bbcee41e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let mcmodel_settings = new Action("Model Settings", { | |
name: intl.translate("actions.model_settings_name"), | |
id: "java_animation_edit_settings", | |
description: intl.translate("actions.model_settings_description"), | |
icon: "info", | |
condition: () => Format.id === format.id, | |
click: function () { | |
var dialog = new Dialog({ | |
id: "project", | |
title: intl.translate("settings.dialog.title"), | |
width: 1000, | |
lines: [intl.translate("settings.dialog.description")], | |
form: Object.assign({ | |
mcFileLocation: { | |
label: intl.translate("settings.mc_file_location"), | |
value: settings.mcFileLocation, | |
}, | |
modelDirLocation: { | |
label: intl.translate("settings.model_dir_location"), | |
value: settings.modelDirLocation, | |
}, | |
modelPredicateLocation: { | |
label: intl.translate("settings.predicate_location"), | |
value: settings.modelPredicateLocation, | |
}, | |
autoDistance: { | |
label: intl.translate("settings.auto_distance"), | |
value: settings.autoDistance, | |
type: "checkbox", | |
}, | |
distanceOverride: { | |
label: intl.translate("settings.distance_override"), | |
value: settings, | |
type: "number", | |
}, | |
item: { | |
label: intl.translate("settings.item"), | |
value: settings.item, | |
}, | |
name: { | |
label: intl.translate("settings.name"), | |
value: settings.name, | |
}, | |
interpolation_type: { | |
label: intl.translate("settings.interpolation_type"), | |
value: settings.interpolation_type, | |
type: "select", | |
options: { | |
armor_stand: "armor_stand", | |
area_effect_cloud: "area_effect_cloud", | |
}, | |
}, | |
constantPosUpdate: { | |
label: intl.translate("settings.constantPosUpdate"), | |
value: settings.constantPosUpdate, | |
type: "checkbox", | |
}, | |
markerToggle: { | |
label: intl.translate("settings.markerToggle"), | |
value: settings.markerToggle, | |
type: "checkbox", | |
}, | |
defaultAnimation: { | |
label: intl.translate("settings.defaultAnimation"), | |
value: settings.defaultAnimation, | |
type: "select", | |
options: Animator.animations.reduce( | |
(a, v) => ({ ...a, [v.uuid]: v.name }), | |
{} | |
), | |
}, | |
},textures.find(v=>v.name.startsWith("STATE:"))?{ | |
defaultState: { | |
label: intl.translate("settings.defaultState"), | |
value: settings.defaultState, | |
type: "select", | |
options: textures | |
.filter((v) => v.name.startsWith("STATE:")) | |
.reduce((a, v) => ({ ...a, [v.uuid]: v.name }), {}), | |
}, | |
}:{ | |
DISABLED_defaultState: { | |
label: intl.translate("settings.defaultState"), | |
value: "disabled", | |
type: "input", | |
readonly:true | |
}, | |
}), | |
onConfirm: function (formResult) { | |
settings.update(formResult); | |
dialog.hide(); | |
}, | |
}); | |
dialog.show(); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment