From bc1bd1c8daed40a303d8f26a06c91c63b1166df9 Mon Sep 17 00:00:00 2001 From: metalwolf Date: Mon, 13 Apr 2020 20:02:46 -0500 Subject: [PATCH] patch v0.0.14 --- README.md | 6 +++++- node.go | 20 +++++++++++++++++--- wajaf.go | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 60edc52..ae1d5f6 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,11 @@ TO DO: Version Changes Control ======================= -v0.0.12 - 2020-04-13 +v0.0.14 - 2020-04-13 +------------------------ +- Correction on node: HELP as messages, not help children + +v0.0.13 - 2020-04-13 ------------------------ - Correction on node: JSON Marshal, wrong ',' calculations (again) diff --git a/node.go b/node.go index a2461fc..7c8d58b 100644 --- a/node.go +++ b/node.go @@ -136,15 +136,26 @@ func (n *Node) GetAttributes() Attributes { } func (n *Node) AddHelp(tooltip string, title string, description string) { - if tooltip == "" && title == "" && description == "" { - return + if tooltip != "" { + m := NewMessage("helpsummary", tooltip) + n.children = append(n.children, m) + } + if title != "" { + m := NewMessage("helptitle", title) + n.children = append(n.children, m) + } + if description != "" { + m := NewMessage("helpdescription", description) + n.children = append(n.children, m) } + return + h := NewHelp(tooltip, title, description) n.children = append(n.children, h) } func (n *Node) AddMessage(name string, value string) { - if value == "" { + if name == "" || value == "" { return } m := NewMessage(name, value) @@ -152,6 +163,9 @@ func (n *Node) AddMessage(name string, value string) { } func (n *Node) AddEvent(name string, code string) { + if name == "" || code == "" { + return + } e := NewEvent(name, code) n.children = append(n.children, e) } diff --git a/wajaf.go b/wajaf.go index d663452..87eb256 100644 --- a/wajaf.go +++ b/wajaf.go @@ -7,7 +7,7 @@ package wajaf // VERSION is the used version nombre of the XCore library. -const VERSION = "0.0.13" +const VERSION = "0.0.14" // LOG is the flag to activate logging on the library. // if LOG is set to TRUE, LOG indicates to the XCore libraries to log a trace of functions called, with most important parameters.