pub fn accept_value(&mut self, context: &mut ScreenContext) -> bool {

        if context.dialog_entry == DialogEntry::NodeNumber {
            let int_value = self.text.parse::<i64>();
            if int_value.is_ok() {
                context.dialog_node_behavior_value.0 = int_value.unwrap() as f64;
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
            let float_value = self.text.parse::<f64>();
            if float_value.is_ok() {
                context.dialog_node_behavior_value.0 = float_value.unwrap();
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
        } else
        if context.dialog_entry == DialogEntry::NodeExpression || context.dialog_entry == DialogEntry::NodeExpressionValue || context.dialog_entry == DialogEntry::NodeScript {

            let has_error = false;

            /*
            let behavior_id = context.dialog_node_behavior_id.0.clone();
            if context.dialog_entry == DialogEntry::NodeExpression {
                if server::gamedata::script::eval_bool_expression_behavior(self.text.as_str(), behavior_id, &mut context.data) == None {
                    has_error = true;
                }
            } else
            if context.dialog_entry == DialogEntry::NodeScript {

                if server::gamedata::script::eval_dynamic_script_behavior(self.text.as_str(), behavior_id, &mut context.data) == false {
                    has_error = true;
                }
            } else {
                if server::gamedata::script::eval_number_expression_behavior(self.text.as_str(), behavior_id, &mut context.data) == None {
                    has_error = true;
                }
            }
            */
            if has_error == false {
                context.dialog_node_behavior_value.4 = self.text.clone();
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
        } else
        if context.dialog_entry == DialogEntry::NodeText || context.dialog_entry == DialogEntry::NodeName {
            context.dialog_node_behavior_value.4 = self.text.clone();
            context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
            return true;
        } else
        if context.dialog_entry == DialogEntry::NodeGridSize {
            context.dialog_node_behavior_value.4 = self.text.clone();
            return true;
        } else
        if context.dialog_entry == DialogEntry::NewName || context.dialog_entry == DialogEntry::NewProjectName  {
            context.dialog_new_name = self.text.clone();
            return true;
        } else
        if context.dialog_entry == DialogEntry::Tags {
            context.dialog_new_name = self.text.clone();
            return true;
        } else
        if context.dialog_entry == DialogEntry::NodeTile {
            if let Some(selected) = &self.tile_selector_widget.selected {
                context.dialog_node_behavior_value.0 = selected.0 as f64;
                context.dialog_node_behavior_value.1 = selected.1 as f64;
                context.dialog_node_behavior_value.2 = selected.2 as f64;
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);

                return true;
            }
        }
        false
    }
/// Accepts the given value (if correct)
Accepts the given value (if correct)
Accepts the given value ( if correct )
pub fn accept_value(&mut self, context: &mut ScreenContext) -> bool {
        if context.dialog_entry == DialogEntry::NodeNumber {
            let int_value = self.text.parse::<i64>();
            if int_value.is_ok() {
                context.dialog_node_behavior_value.0 = int_value.unwrap() as f64;
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
            let float_value = self.text.parse::<f64>();
            if float_value.is_ok() {
                context.dialog_node_behavior_value.0 = float_value.unwrap();
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
        } else
        if context.dialog_entry == DialogEntry::NodeExpression || context.dialog_entry == DialogEntry::NodeExpressionValue || context.dialog_entry == DialogEntry::NodeScript {
            let has_error = false;
            /*
            let behavior_id = context.dialog_node_behavior_id.0.clone();
            if context.dialog_entry == DialogEntry::NodeExpression {
                if server::gamedata::script::eval_bool_expression_behavior(self.text.as_str(), behavior_id, &mut context.data) == None {
                    has_error = true;
                }
            } else
            if context.dialog_entry == DialogEntry::NodeScript {
                if server::gamedata::script::eval_dynamic_script_behavior(self.text.as_str(), behavior_id, &mut context.data) == false {
                    has_error = true;
                }
            } else {
                if server::gamedata::script::eval_number_expression_behavior(self.text.as_str(), behavior_id, &mut context.data) == None {
                    has_error = true;
                }
            }
            */
            if has_error == false {
                context.dialog_node_behavior_value.4 = self.text.clone();
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
        } else
        if context.dialog_entry == DialogEntry::NodeText || context.dialog_entry == DialogEntry::NodeName {
            context.dialog_node_behavior_value.4 = self.text.clone();
            context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
            return true;
        } else
        if context.dialog_entry == DialogEntry::NodeGridSize {
            context.dialog_node_behavior_value.4 = self.text.clone();
            return true;
        } else
        if context.dialog_entry == DialogEntry::NewName || context.dialog_entry == DialogEntry::NewProjectName  {
            context.dialog_new_name = self.text.clone();
            return true;
        } else
        if context.dialog_entry == DialogEntry::Tags {
            context.dialog_new_name = self.text.clone();
            return true;
        } else
        if context.dialog_entry == DialogEntry::NodeTile {
            if let Some(selected) = &self.tile_selector_widget.selected {
                context.dialog_node_behavior_value.0 = selected.0 as f64;
                context.dialog_node_behavior_value.1 = selected.1 as f64;
                context.dialog_node_behavior_value.2 = selected.2 as f64;
                context.data.set_behavior_id_value(context.dialog_node_behavior_id.clone(), context.dialog_node_behavior_value.clone(), context.curr_graph_type);
                return true;
            }
        }
        false
    }
pub fn accept_value ( & mut self , context : & mut ScreenContext ) -> bool { if context . dialog_entry == DialogEntry :: NodeNumber { let int_value = self . text . parse :: < i64 > ( ) ; if int_value . is_ok ( ) { context . dialog_node_behavior_value . 0 = int_value . unwrap ( ) as f64 ; context . data . set_behavior_id_value ( context . dialog_node_behavior_id . clone ( ) , context . dialog_node_behavior_value . clone ( ) , context . curr_graph_type ) ; return true ; } let float_value = self . text . parse :: < f64 > ( ) ; if float_value . is_ok ( ) { context . dialog_node_behavior_value . 0 = float_value . unwrap ( ) ; context . data . set_behavior_id_value ( context . dialog_node_behavior_id . clone ( ) , context . dialog_node_behavior_value . clone ( ) , context . curr_graph_type ) ; return true ; } } else if context . dialog_entry == DialogEntry :: NodeExpression || context . dialog_entry == DialogEntry :: NodeExpressionValue || context . dialog_entry == DialogEntry :: NodeScript { let has_error = false ; /*
            let behavior_id = context.dialog_node_behavior_id.0.clone();
            if context.dialog_entry == DialogEntry::NodeExpression {
                if server::gamedata::script::eval_bool_expression_behavior(self.text.as_str(), behavior_id, &mut context.data) == None {
                    has_error = true;
                }
            } else
            if context.dialog_entry == DialogEntry::NodeScript {

                if server::gamedata::script::eval_dynamic_script_behavior(self.text.as_str(), behavior_id, &mut context.data) == false {
                    has_error = true;
                }
            } else {
                if server::gamedata::script::eval_number_expression_behavior(self.text.as_str(), behavior_id, &mut context.data) == None {
                    has_error = true;
                }
            }
            */ if has_error == false { context . dialog_node_behavior_value . 4 = self . text . clone ( ) ; context . data . set_behavior_id_value ( context . dialog_node_behavior_id . clone ( ) , context . dialog_node_behavior_value . clone ( ) , context . curr_graph_type ) ; return true ; } } else if context . dialog_entry == DialogEntry :: NodeText || context . dialog_entry == DialogEntry :: NodeName { context . dialog_node_behavior_value . 4 = self . text . clone ( ) ; context . data . set_behavior_id_value ( context . dialog_node_behavior_id . clone ( ) , context . dialog_node_behavior_value . clone ( ) , context . curr_graph_type ) ; return true ; } else if context . dialog_entry == DialogEntry :: NodeGridSize { context . dialog_node_behavior_value . 4 = self . text . clone ( ) ; return true ; } else if context . dialog_entry == DialogEntry :: NewName || context . dialog_entry == DialogEntry :: NewProjectName { context . dialog_new_name = self . text . clone ( ) ; return true ; } else if context . dialog_entry == DialogEntry :: Tags { context . dialog_new_name = self . text . clone ( ) ; return true ; } else if context . dialog_entry == DialogEntry :: NodeTile { if let Some ( selected ) = & self . tile_selector_widget . selected { context . dialog_node_behavior_value . 0 = selected . 0 as f64 ; context . dialog_node_behavior_value . 1 = selected . 1 as f64 ; context . dialog_node_behavior_value . 2 = selected . 2 as f64 ; context . data . set_behavior_id_value ( context . dialog_node_behavior_id . clone ( ) , context . dialog_node_behavior_value . clone ( ) , context . curr_graph_type ) ; return true ; } } false }
Accepts the given value (if correct)
Accepts the given value ( if correct )
&mut self
context
&mut ScreenContext
&mut self
context
&mut ScreenContext