Remove evaluator_params
This commit is contained in:
parent
a94a8684ca
commit
65bd9c0a28
2 changed files with 20 additions and 18 deletions
|
|
@ -21,7 +21,6 @@ pub struct Metadata {
|
|||
/// A vtable pointing to the constructor table for the evaluators associated to this type. Can be shared between multiple policies,
|
||||
/// all policies with the same `evaluator_class` should use the same evaluator vtable.
|
||||
pub evaluator_vtable: EvaluatorConstructorVTable,
|
||||
pub evaluator_param: String,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
@ -71,7 +70,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XXXX".to_owned(),
|
||||
}, // Never show anything
|
||||
Metadata {
|
||||
value: Policy::XXXE,
|
||||
|
|
@ -80,7 +78,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XXXE".to_owned(),
|
||||
}, // If outfit and equipped, show equipped
|
||||
Metadata {
|
||||
value: Policy::XXXO,
|
||||
|
|
@ -89,7 +86,6 @@ impl PolicyStore {
|
|||
advanced: false,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XXXO".to_owned(),
|
||||
}, // If outfit and equipped, show outfit (require equipped, no passthrough)
|
||||
Metadata {
|
||||
value: Policy::XXOX,
|
||||
|
|
@ -98,7 +94,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XXOX".to_owned(),
|
||||
}, // If only outfit, show outfit
|
||||
Metadata {
|
||||
value: Policy::XXOE,
|
||||
|
|
@ -107,7 +102,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XXOE".to_owned(),
|
||||
}, // If only outfit, show outfit. If both, show equipped
|
||||
Metadata {
|
||||
value: Policy::XXOO,
|
||||
|
|
@ -116,7 +110,6 @@ impl PolicyStore {
|
|||
advanced: false,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XXOO".to_owned(),
|
||||
}, // If outfit, show outfit (always show outfit, no passthough)
|
||||
Metadata {
|
||||
value: Policy::XEXX,
|
||||
|
|
@ -125,7 +118,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XEXX".to_owned(),
|
||||
}, // If only equipped, show equipped
|
||||
Metadata {
|
||||
value: Policy::XEXE,
|
||||
|
|
@ -134,7 +126,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XEXE".to_owned(),
|
||||
}, // If equipped, show equipped
|
||||
Metadata {
|
||||
value: Policy::XEXO,
|
||||
|
|
@ -143,7 +134,6 @@ impl PolicyStore {
|
|||
advanced: false,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XEXO".to_owned(),
|
||||
}, // If only equipped, show equipped. If both, show outfit
|
||||
Metadata {
|
||||
value: Policy::XEOX,
|
||||
|
|
@ -152,7 +142,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XEOX".to_owned(),
|
||||
}, // If only equipped, show equipped. If only outfit, show outfit
|
||||
Metadata {
|
||||
value: Policy::XEOE,
|
||||
|
|
@ -161,7 +150,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XEOE".to_owned(),
|
||||
}, // If only equipped, show equipped. If only outfit, show outfit. If both, show equipped
|
||||
Metadata {
|
||||
value: Policy::XEOO,
|
||||
|
|
@ -170,7 +158,6 @@ impl PolicyStore {
|
|||
advanced: true,
|
||||
evaluator_class: "Combinatorial",
|
||||
evaluator_vtable: standard::EVALUATOR_VTABLE,
|
||||
evaluator_param: "XEOO".to_owned(),
|
||||
}, // If only equipped, show equipped. If only outfit, show outfit. If both, show outfit
|
||||
];
|
||||
//
|
||||
|
|
@ -187,17 +174,15 @@ impl PolicyStore {
|
|||
advanced: false,
|
||||
evaluator_class: "Script",
|
||||
evaluator_vtable: scripting::EVALUATOR_VTABLE,
|
||||
evaluator_param: format!("Custom{:0>3}", record.id),
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
for custom_item in &custom_items {
|
||||
log::info!(
|
||||
"Added custom script policy. ID={}, UIName={}, Sort={}, Param={}",
|
||||
"Added custom script policy. ID={}, UIName={}, Sort={}",
|
||||
custom_item.value.repr as u8,
|
||||
custom_item.ui_key,
|
||||
custom_item.sort_order,
|
||||
custom_item.evaluator_param
|
||||
);
|
||||
}
|
||||
metadata.append(&mut custom_items);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::policy::{EvaluatorConstructorVTable, Metadata, PolicyEvaluator};
|
||||
use crate::policy::{EvaluatorConstructorVTable, Metadata, Policy, PolicyEvaluator};
|
||||
use commonlibsse::{RE_BIPED_OBJECTS_BIPED_OBJECT_kEditorTotal, RE_TESObjectARMO};
|
||||
use std::any::Any;
|
||||
|
||||
|
|
@ -26,7 +26,24 @@ impl PolicyEvaluator for Evaluator {
|
|||
current_metadata: &Metadata,
|
||||
current_index: u32,
|
||||
) -> Option<*mut RE_TESObjectARMO> {
|
||||
let policy_str = ¤t_metadata.evaluator_param;
|
||||
let policy_str = match current_metadata.value {
|
||||
Policy::XXXX => "XXXX",
|
||||
Policy::XXXE => "XXXE",
|
||||
Policy::XXXO => "XXXO",
|
||||
Policy::XXOX => "XXOX",
|
||||
Policy::XXOE => "XXOE",
|
||||
Policy::XXOO => "XXOO",
|
||||
Policy::XEXX => "XEXX",
|
||||
Policy::XEXE => "XEXE",
|
||||
Policy::XEXO => "XEXO",
|
||||
Policy::XEOX => "XEOX",
|
||||
Policy::XEOE => "XEOE",
|
||||
Policy::XEOO => "XEOO",
|
||||
other => {
|
||||
log::error!("Standard evaluator got an unknown policy {}", other.repr);
|
||||
return None;
|
||||
}
|
||||
};
|
||||
let has_equipped = !equipped[current_index as usize].is_null();
|
||||
let has_outfit = !outfit[current_index as usize].is_null();
|
||||
let code = match (has_equipped, has_outfit) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue