Skip to content

Commit ce86936

Browse files
committed
case no tutorial in map
1 parent 489f411 commit ce86936

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Tutorial-o-Matic/src/main/groovy/ToM.groovy

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,10 @@ class ToM{
205205

206206
def static addTutorialsPane(myP, mapa){
207207
def nodosTutoriales = mapa.root.find{it.style.name == styles.tutorial}
208-
if ( nodosTutoriales.size() > 1 ){
208+
if ( nodosTutoriales.size() != 1 ){
209209
def pane = tomui.createEmptyGridBagPanel()
210-
addPageTitle(myP, "Tutorials present in '${mapa.name}' map".toString())
210+
def pre = nodosTutoriales.size() == 0 ? "No t" : "T"
211+
addPageTitle(myP, "${pre}utorials present in '${mapa.name}' map".toString())
211212
nodosTutoriales.each{ nT ->
212213
def title = nT.text
213214
def bttnAction = { e ->
@@ -224,16 +225,14 @@ class ToM{
224225
def stopButton = tomui.createButton('Exit tutorial', {tomui.closeTab(tabName)})
225226
pane.add(stopButton, tomui.GBC)
226227
myP.add(pane, tomui.GBC)
227-
} else if ( nodosTutoriales.size() == 1 ) {
228+
} else {
228229
def nT = nodosTutoriales[0]
229230
def tutNodes = getTutNodes(nT)
230231
if(tutNodes) {
231232
fillContentPane(myP, tutNodes)
232233
} else {
233234
ui.informationMessage( "no tutorial components(nodes) found for tutorial '${nT.text}'".toString() )
234235
}
235-
} else {
236-
ui.informationMessage( "no tutorial found in '${mapa.name}' map".toString())
237236
}
238237
}
239238

Tutorial-o-Matic/zips/doc/Tutorial-o-Matic/Tutorial Sample.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<node TEXT="Tutorial Sample" FOLDED="false" ID="ID_452131666" STYLE="oval">
44
<font NAME="SansSerif" SIZE="18"/>
55
<hook NAME="MapStyle">
6-
<properties mapUsesOwnSaveOptions="true" save_last_visited_node="default" save_modification_times="false" show_icon_for_attributes="true" fit_to_viewport="false" show_note_icons="true" edgeColorConfiguration="#808080ff,#ff0000ff,#0000ffff,#00ff00ff,#ff00ffff,#00ffffff,#7c0000ff,#00007cff,#007c00ff,#7c007cff,#007c7cff,#7c7c00ff" save_folding="default"/>
6+
<properties save_modification_times="false" save_last_visited_node="default" mapUsesOwnSaveOptions="true" fit_to_viewport="false" show_icon_for_attributes="true" show_note_icons="true" edgeColorConfiguration="#808080ff,#ff0000ff,#0000ffff,#00ff00ff,#ff00ffff,#00ffffff,#7c0000ff,#00007cff,#007c00ff,#7c007cff,#007c7cff,#7c7c00ff" save_folding="default"/>
77

88
<map_styles>
99
<stylenode LOCALIZED_TEXT="styles.root_node" ID="ID_1611611797" STYLE="oval" UNIFORM_SHAPE="true" VGAP_QUANTITY="24 pt">

0 commit comments

Comments
 (0)