From e092ee9abcc21ceecbfe4bf2bf8a48dd84f3bae0 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 1 Aug 2007 19:37:51 +0000 Subject: [PATCH] - we prefer hyphens in property names to underscores - save /sim/multiplayer/chat-display to autosave.xml - remove trailing spaces --- Nasal/multiplayer.nas | 28 ++++++++++++++-------------- gui/dialogs/chat.xml | 8 ++++---- gui/dialogs/chat_full.xml | 12 ++++++------ gui/dialogs/rendering.xml | 2 +- preferences.xml | 1 + 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/Nasal/multiplayer.nas b/Nasal/multiplayer.nas index 312b1adf7..cc4153176 100644 --- a/Nasal/multiplayer.nas +++ b/Nasal/multiplayer.nas @@ -11,15 +11,15 @@ var messages = {}; check_messages = func -{ +{ var mp = props.globals.getNode("/ai/models").getChildren("multiplayer"); - + foreach (i; mp) { var lmsg = getprop(i.getPath() ~ "/sim/multiplay/chat"); var lcallsign = getprop(i.getPath() ~ "/callsign"); - + if ((lmsg != nil) and (lmsg != "") and (lcallsign != nil) and (lcallsign != "")) { #print("Call Sign: " ~ lcallsign); @@ -30,13 +30,13 @@ check_messages = func { # Indicate we've seen this message. messages[lcallsign] = lmsg; - echo_message(lmsg, lcallsign); + echo_message(lmsg, lcallsign); } } } - + # Check for new messages every couple of seconds. - settimer(check_messages, 3); + settimer(check_messages, 3); } echo_message = func(msg, callsign) @@ -45,8 +45,8 @@ echo_message = func(msg, callsign) { msg = callsign ~ ": " ~ msg; } - - var ldisplay = getprop("/sim/multiplay/chat_display"); + + var ldisplay = getprop("/sim/multiplay/chat-display"); if ((ldisplay != nil) and (ldisplay == "1")) { @@ -55,20 +55,20 @@ echo_message = func(msg, callsign) } # Add the chat to the chat history. - var lchat = getprop("/sim/multiplay/chat_history"); + var lchat = getprop("/sim/multiplay/chat-history"); if (lchat == nil) { - setprop("/sim/multiplay/chat_history", msg); - } + setprop("/sim/multiplay/chat-history", msg); + } else { if (substr(lchat, size(lchat) -1, 1) != "\n") { lchat = lchat ~ "\n"; } - - setprop("/sim/multiplay/chat_history", lchat ~ msg); + + setprop("/sim/multiplay/chat-history", lchat ~ msg); } } @@ -79,7 +79,7 @@ settimer(func { # check for new messages check_messages(); - + }, 1); diff --git a/gui/dialogs/chat.xml b/gui/dialogs/chat.xml index 0fec4b754..b9448a42e 100644 --- a/gui/dialogs/chat.xml +++ b/gui/dialogs/chat.xml @@ -14,7 +14,7 @@ true fill 50 - /sim/multiplay/chat_compose + /sim/multiplay/chat-compose