Index: MUSHclient.h =================================================================== RCS file: /cvs/mushclient/MUSHclient.h,v retrieving revision 1.53 retrieving revision 1.54 diff -c -r1.53 -r1.54 *** MUSHclient.h 25 Jul 2007 05:02:19 -0000 1.53 --- MUSHclient.h 9 Aug 2007 01:20:55 -0000 1.54 *************** *** 247,252 **** --- 247,254 ---- void LoadGlobalsFromRegistry (void); void SaveGlobalsToRegistry (void); void ShowGlobalOptions (CMUSHclientDoc * pDoc); + VARIANT GetGlobalOption(LPCTSTR Name); + VARIANT GetGlobalOptionList(); void OpenLuaDelayed (); // for spell checker Index: MUSHclient.rc =================================================================== RCS file: /cvs/mushclient/MUSHclient.rc,v retrieving revision 1.207 diff -c -r1.207 MUSHclient.rc *** MUSHclient.rc 26 Jul 2007 00:46:46 -0000 1.207 --- MUSHclient.rc 9 Aug 2007 01:22:16 -0000 *************** *** 56,63 **** // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,16,0 ! PRODUCTVERSION 4,0,16,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L --- 56,63 ---- // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,18,0 ! PRODUCTVERSION 4,0,18,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L *************** *** 75,88 **** VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.16\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2007 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.16\0" VALUE "SpecialBuild", "\0" END END --- 75,88 ---- VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.18\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2007 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.18\0" VALUE "SpecialBuild", "\0" END END Index: MySplitterWnd.cpp =================================================================== RCS file: /cvs/mushclient/MySplitterWnd.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -c -r1.6 -r1.7 *** MySplitterWnd.cpp 26 Jul 2007 00:46:46 -0000 1.6 --- MySplitterWnd.cpp 9 Aug 2007 01:20:55 -0000 1.7 *************** *** 42,55 **** void CMySplitterWnd::OnLButtonUp(UINT nFlags, CPoint point) { CSplitterWnd::OnLButtonUp(nFlags, point); ! // this hideous code is so that we know when the user has resized the // input pane, so we don't snap the size back to what it was if (m_pDoc) { int cyCur, cyMin; ! GetRowInfo (1, cyCur, cyMin); // snap to boundary stuff (version 4.16) if (((GetKeyState (VK_LCONTROL) & 0x8000) != 0 || --- 42,55 ---- void CMySplitterWnd::OnLButtonUp(UINT nFlags, CPoint point) { CSplitterWnd::OnLButtonUp(nFlags, point); ! // this hideous code is so that we know when the user has resized the // input pane, so we don't snap the size back to what it was if (m_pDoc) { int cyCur, cyMin; ! GetRowInfo (COMMAND_PANE, cyCur, cyMin); // snap to boundary stuff (version 4.16) if (((GetKeyState (VK_LCONTROL) & 0x8000) != 0 || Index: PaneView.cpp =================================================================== RCS file: /cvs/mushclient/PaneView.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** PaneView.cpp 27 Nov 2004 09:11:30 -0000 1.3 --- PaneView.cpp 9 Aug 2007 01:20:55 -0000 1.4 *************** *** 29,36 **** m_bShowBold = false; m_bShowItalic = false; m_bShowUnderline = false; ! m_nHeight = 12; ! m_strFont = MUSHCLIENT_DEFAULT_FONT; m_cText = RGB_WHITE; m_cBack = RGB_BLACK; --- 29,36 ---- m_bShowBold = false; m_bShowItalic = false; m_bShowUnderline = false; ! m_nHeight = App.m_iFixedPitchFontSize; ! m_strFont = App.m_strFixedPitchFont; m_cText = RGB_WHITE; m_cBack = RGB_BLACK; Index: ProcessPreviousLine.cpp =================================================================== RCS file: /cvs/mushclient/ProcessPreviousLine.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -c -r1.55 -r1.56 *** ProcessPreviousLine.cpp 12 Jun 2007 04:01:56 -0000 1.55 --- ProcessPreviousLine.cpp 9 Aug 2007 01:20:55 -0000 1.56 *************** *** 1059,1068 **** --- 1059,1070 ---- m_iExecutionDepth = 0; // no execution depth yet #ifdef PANE + /* // pane sending needs colours, so do it differently :) if (trigger_item->iSendTo == eSendToPane) TriggerToPane (trigger_item, StyledLine); else + */ #endif // PANE { trigger_item->bExecutingScript = true; // cannot be deleted now *************** *** 1292,1298 **** } // end of CMUSHclientDoc::ProcessOneTriggerSequence #ifdef PANE ! void CMUSHclientDoc::TriggerToPane (CTrigger * pTrigger, CPaneLine & StyledLine) { string sName = pTrigger->strPane; --- 1294,1300 ---- } // end of CMUSHclientDoc::ProcessOneTriggerSequence #ifdef PANE ! /* void CMUSHclientDoc::TriggerToPane (CTrigger * pTrigger, CPaneLine & StyledLine) { string sName = pTrigger->strPane; *************** *** 1341,1344 **** --- 1343,1347 ---- pView->MarkLastLineNewLine (); } // end of CMUSHclientDoc::TriggerToPane + */ #endif // PANE Index: StatLink.cpp =================================================================== RCS file: /cvs/mushclient/StatLink.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** StatLink.cpp 11 Jun 2007 10:42:08 -0000 1.5 --- StatLink.cpp 4 Aug 2007 09:36:29 -0000 1.6 *************** *** 47,53 **** // lines of code and more reliable than turning on SS_NOTIFY in OnCtlColor // because Windows doesn't send WM_CTLCOLOR to bitmap static controls. // ! LRESULT CStaticLink::OnNcHitTest(CPoint point) { return HTCLIENT; } --- 47,53 ---- // lines of code and more reliable than turning on SS_NOTIFY in OnCtlColor // because Windows doesn't send WM_CTLCOLOR to bitmap static controls. // ! UINT CStaticLink::OnNcHitTest(CPoint point) { return HTCLIENT; } Index: StatLink.h =================================================================== RCS file: /cvs/mushclient/StatLink.h,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** StatLink.h 3 Apr 2007 23:10:18 -0000 1.2 --- StatLink.h 4 Aug 2007 09:36:29 -0000 1.3 *************** *** 42,48 **** // message handlers DECLARE_MESSAGE_MAP() ! afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); --- 42,48 ---- // message handlers DECLARE_MESSAGE_MAP() ! afx_msg UINT OnNcHitTest(CPoint point); afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message); Index: childfrm.cpp =================================================================== RCS file: /cvs/mushclient/childfrm.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** childfrm.cpp 31 Oct 2006 19:57:58 -0000 1.11 --- childfrm.cpp 9 Aug 2007 01:20:55 -0000 1.12 *************** *** 9,14 **** --- 9,16 ---- #include "MUSHview.h" #include "mainfrm.h" #include "sendvw.h" + #include "PaneView.h" + #include "winplace.h" *************** *** 59,86 **** m_wndSplitter.m_pDoc = m_pDoc; if (m_wndSplitter.CreateStatic(this,2,1)) { CRect rect; GetOwner ()->GetClientRect(&rect); CSize size = rect.Size(); size.cy-=150; ! if (m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CMUSHView),size,pContext)) ! { ! if (m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CSendView),CSize(0,0),pContext)) ! { ! CMUSHView * topview = (CMUSHView *) m_wndSplitter.GetPane(0,0); ! CSendView * bottomview = (CSendView *) m_wndSplitter.GetPane(1,0); ! m_topview = topview; // for idle processing ! bottomview->m_topview = topview; ! topview->m_owner_frame = this; ! topview->m_bottomview = bottomview; ! bottomview->m_owner_frame = this; ! SetActiveView((CView*) bottomview); ! return TRUE; ! } } - } return FALSE; } --- 61,100 ---- m_wndSplitter.m_pDoc = m_pDoc; + #ifdef USE_EXTRA_PANE + if (m_wndSplitter.CreateStatic(this,3,1)) + #else if (m_wndSplitter.CreateStatic(this,2,1)) + #endif + { CRect rect; GetOwner ()->GetClientRect(&rect); CSize size = rect.Size(); size.cy-=150; ! if (!m_wndSplitter.CreateView(OUTPUT_PANE,0,RUNTIME_CLASS(CMUSHView),size,pContext)) ! return FALSE; ! if (!m_wndSplitter.CreateView(COMMAND_PANE,0,RUNTIME_CLASS(CSendView),CSize(0,0),pContext)) ! return FALSE; ! ! CMUSHView * topview = (CMUSHView *) m_wndSplitter.GetPane(OUTPUT_PANE,0); ! CSendView * bottomview = (CSendView *) m_wndSplitter.GetPane(COMMAND_PANE,0); ! m_topview = topview; // for idle processing ! bottomview->m_topview = topview; ! topview->m_owner_frame = this; ! topview->m_bottomview = bottomview; ! bottomview->m_owner_frame = this; ! SetActiveView((CView*) bottomview); ! ! #ifdef USE_EXTRA_PANE ! ! if (!m_wndSplitter.CreateView(EXTRA_PANE,0,RUNTIME_CLASS(CPaneView),CSize(20,0),pContext)) ! return FALSE; ! ! #endif ! ! return TRUE; } return FALSE; } *************** *** 183,192 **** cyCurTop = 20; // set the info for the top view ! m_wndSplitter.SetRowInfo (0, cyCurTop, 20); // set the info for the bottom view ! m_wndSplitter.SetRowInfo (1, cyCurBottom, 9); // recalculate it all m_wndSplitter.RecalcLayout (); --- 197,206 ---- cyCurTop = 20; // set the info for the top view ! m_wndSplitter.SetRowInfo (OUTPUT_PANE, cyCurTop, 20); // set the info for the bottom view ! m_wndSplitter.SetRowInfo (COMMAND_PANE, cyCurBottom, 9); // recalculate it all m_wndSplitter.RecalcLayout (); Index: configuration.cpp =================================================================== RCS file: /cvs/mushclient/configuration.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -c -r1.48 -r1.49 *** configuration.cpp 12 Jun 2007 04:01:56 -0000 1.48 --- configuration.cpp 30 Jul 2007 00:06:52 -0000 1.49 *************** *** 2,7 **** --- 2,8 ---- #include "MUSHclient.h" #include "TreePropertySheet.h" #include "MissingEntryPoints.h" + #include "mainfrm.h" #ifdef _DEBUG //#define new DEBUG_NEW *************** *** 47,52 **** --- 48,89 ---- #include "genprint.h" + // for debug messages + static const char * sConfigPhase [] = { + "undefined", // 0 - error if this + "general", // 1 + "sounds ", // 2 + "custom colours", // 3 + "logging", // 4 + "ANSI colours", // 5 + "macros", // 6 + "aliases", // 7 + "triggers", // 8 + "commands", // 9 + "send", // 10 + "notes", // 11 + "keypad", // 12 + "paste", // 13 + "output", // 14 + "info", // 15 + "timers", // 16 + "scripts", // 17 + "variables", // 18 + "autosay", // 19 + "printing", // 20 + "connecting", // 21 + "MXP", // 22 + "chat", // 23 + }; + + static DelayDebugMsg (const char * sPhase, int iWhich) + { + CString msg; + if (iWhich < 1 || iWhich > NUMITEMS (sConfigPhase)) + iWhich = 0; + msg.Format ("%s %s config", sPhase, sConfigPhase [iWhich]); + Frame.DelayDebugStatus (msg); + } CString CMUSHclientDoc::AppendMUDName (const CString strName) { *************** *** 64,69 **** --- 101,107 ---- void CMUSHclientDoc::LoadPrefsP1 (CPrefsP1 &page1) { + DelayDebugMsg ("Loading", 1); page1.m_doc = this; page1.m_port = m_port; page1.m_mush_name = m_mush_name; *************** *** 78,89 **** --- 116,129 ---- void CMUSHclientDoc:: LoadPrefsP2 (CPrefsP2 &page2) { + DelayDebugMsg ("Loading", 2); page2.m_doc = this; } // end of CMUSHclientDoc::LoadPrefsP2 void CMUSHclientDoc:: LoadPrefsP3 (CPrefsP3 &page3) { + DelayDebugMsg ("Loading", 3); page3.m_doc = this; memcpy (page3.m_customtext, m_customtext, sizeof (page3.m_customtext)); memcpy (page3.m_customback, m_customback, sizeof (page3.m_customback)); *************** *** 94,99 **** --- 134,141 ---- void CMUSHclientDoc:: LoadPrefsP4 (CPrefsP4 &page4) { + DelayDebugMsg ("Loading", 4); + // Sleep (1000); page4.m_doc = this; page4.m_bLogOutput = m_bLogOutput; page4.m_log_input = m_log_input; *************** *** 115,120 **** --- 157,163 ---- void CMUSHclientDoc:: LoadPrefsP5 (CPrefsP5 &page5) { + DelayDebugMsg ("Loading", 5); page5.m_doc = this; memcpy (page5.m_normalcolour, m_normalcolour, sizeof (page5.m_normalcolour)); memcpy (page5.m_boldcolour, m_boldcolour, sizeof (page5.m_boldcolour)); *************** *** 124,129 **** --- 167,173 ---- void CMUSHclientDoc:: LoadPrefsP6 (CPrefsP6 &page6) { + DelayDebugMsg ("Loading", 6); int i; page6.m_doc = this; for (i = 0; i < NUMITEMS (m_macros); i++) *************** *** 150,155 **** --- 194,200 ---- void CMUSHclientDoc:: LoadPrefsP7 (CPrefsP7 &page7) { + DelayDebugMsg ("Loading", 7); page7.m_doc = this; page7.m_enable_aliases = m_enable_aliases; page7.m_bUseDefaultAliases = m_bUseDefaultAliases; *************** *** 188,193 **** --- 233,239 ---- void CMUSHclientDoc:: LoadPrefsP8 (CPrefsP8 &page8) { + DelayDebugMsg ("Loading", 8); page8.m_doc = this; page8.m_prefsp3 = NULL; // so we can look up colours (in the document) page8.m_enable_triggers = m_enable_triggers; *************** *** 228,233 **** --- 274,280 ---- void CMUSHclientDoc:: LoadPrefsP9 (CPrefsP9 &page9) { + DelayDebugMsg ("Loading", 9); page9.m_doc = this; page9.m_prefsp3 = NULL; // so we can look up colours (in the document) page9.m_command_stack_character = m_strCommandStackCharacter; *************** *** 288,293 **** --- 335,341 ---- void CMUSHclientDoc:: LoadPrefsP10 (CPrefsP10 &page10) { + DelayDebugMsg ("Loading", 10); page10.m_doc = this; page10.m_file_postamble = m_file_postamble; page10.m_file_preamble = m_file_preamble; *************** *** 302,307 **** --- 350,356 ---- void CMUSHclientDoc:: LoadPrefsP11 (CPrefsP11 &page11) { + DelayDebugMsg ("Loading", 11); page11.m_doc = this; page11.m_notes = m_notes; page11.m_pNotesFindInfo = &m_NotesFindInfo; // for finding *************** *** 309,314 **** --- 358,364 ---- void CMUSHclientDoc:: LoadPrefsP12 (CPrefsP12 &page12) { + DelayDebugMsg ("Loading", 12); page12.m_doc = this; for (int i = 0; i < eKeypad_Max_Items; i++) *************** *** 319,324 **** --- 369,375 ---- void CMUSHclientDoc:: LoadPrefsP13 (CPrefsP13 &page13) { + DelayDebugMsg ("Loading", 13); page13.m_doc = this; page13.m_paste_postamble = m_paste_postamble; page13.m_paste_preamble = m_paste_preamble; *************** *** 333,338 **** --- 384,390 ---- void CMUSHclientDoc:: LoadPrefsP14 (CPrefsP14 &page14) { + DelayDebugMsg ("Loading", 14); page14.m_doc = this; page14.m_font_height = m_font_height; page14.m_font_name = m_font_name; *************** *** 378,383 **** --- 430,436 ---- void CMUSHclientDoc:: LoadPrefsP15 (CPrefsP15 &page15) { + DelayDebugMsg ("Loading", 15); __int64 nTotalTriggers = 0, nTotalAliases = 0, *************** *** 517,522 **** --- 570,576 ---- void CMUSHclientDoc:: LoadPrefsP16 (CPrefsP16 &page16) { + DelayDebugMsg ("Loading", 16); page16.m_doc = this; page16.m_bEnableTimers = m_bEnableTimers; m_bConfigEnableTimers = m_bEnableTimers; *************** *** 556,561 **** --- 610,616 ---- void CMUSHclientDoc:: LoadPrefsP17 (CPrefsP17 &page17) { + DelayDebugMsg ("Loading", 17); page17.m_doc = this; page17.m_strLanguage = m_strLanguage; page17.m_bEnableScripts = m_bEnableScripts; *************** *** 604,609 **** --- 659,665 ---- void CMUSHclientDoc:: LoadPrefsP18 (CPrefsP18 &page18) { + DelayDebugMsg ("Loading", 18); page18.m_doc = this; // variables are used directly from the document *************** *** 632,637 **** --- 688,694 ---- void CMUSHclientDoc:: LoadPrefsP19 (CPrefsP19 &page19) { + DelayDebugMsg ("Loading", 19); page19.m_doc = this; page19.m_strAutoSayString = m_strAutoSayString; page19.m_bEnableAutoSay = m_bEnableAutoSay; *************** *** 643,648 **** --- 700,706 ---- void CMUSHclientDoc:: LoadPrefsP20 (CPrefsP20 &page20) { + DelayDebugMsg ("Loading", 20); page20.m_doc = this; page20.m_bBold0 = (m_nNormalPrintStyle [0] & FONT_BOLD) != 0; page20.m_bBold1 = (m_nNormalPrintStyle [1] & FONT_BOLD) != 0; *************** *** 701,706 **** --- 759,765 ---- void CMUSHclientDoc:: LoadPrefsP21 (CPrefsP21 &page21) { + DelayDebugMsg ("Loading", 21); page21.m_doc = this; page21.m_name = m_name; page21.m_password = m_password; *************** *** 710,715 **** --- 769,775 ---- void CMUSHclientDoc:: LoadPrefsP22 (CPrefsP22 &page22) { + DelayDebugMsg ("Loading", 22); page22.m_doc = this; page22.m_iHyperlinkColour = m_iHyperlinkColour; *************** *** 737,742 **** --- 797,803 ---- void CMUSHclientDoc:: LoadPrefsP23 (CPrefsP23 &page23) { + DelayDebugMsg ("Loading", 23); page23.m_doc = this; // take reasonable defaults *************** *** 782,787 **** --- 843,849 ---- bool CMUSHclientDoc::ChangedPrefsP1 (CPrefsP1 &page1) { + DelayDebugMsg ("Checking", 1); page1.m_mush_name.TrimLeft (); page1.m_mush_name.TrimRight (); *************** *** 804,814 **** --- 866,878 ---- bool CMUSHclientDoc:: ChangedPrefsP2 (CPrefsP2 &page2) { + DelayDebugMsg ("Checking", 2); return m_new_activity_sound != page2.m_sound_pathname; } // end of CMUSHclientDoc::ChangedPrefsP2 bool CMUSHclientDoc:: ChangedPrefsP3 (CPrefsP3 &page3) { + DelayDebugMsg ("Checking", 3); bool bChanged = false; for (int i = 0; i < MAX_CUSTOM; i++) if (page3.m_strCustomName [i] != m_strCustomColourName [i]) *************** *** 824,829 **** --- 888,894 ---- bool CMUSHclientDoc:: ChangedPrefsP4 (CPrefsP4 &page4) { + DelayDebugMsg ("Checking", 4); return m_bLogOutput != page4.m_bLogOutput || m_log_input != page4.m_log_input || *************** *** 847,852 **** --- 912,918 ---- bool CMUSHclientDoc:: ChangedPrefsP5 (CPrefsP5 &page5) { + DelayDebugMsg ("Checking", 5); return memcmp (m_normalcolour, page5.m_normalcolour, sizeof (m_normalcolour)) != 0 || *************** *** 859,864 **** --- 925,931 ---- bool CMUSHclientDoc:: ChangedPrefsP6 (CPrefsP6 &page6) { + DelayDebugMsg ("Checking", 6); int i; bool array_changed = false; *************** *** 877,882 **** --- 944,950 ---- bool CMUSHclientDoc:: ChangedPrefsP7 (CPrefsP7 &page7) { + DelayDebugMsg ("Checking", 7); return m_enable_aliases != page7.m_enable_aliases || m_bUseDefaultAliases != page7.m_bUseDefaultAliases; *************** *** 885,890 **** --- 953,959 ---- bool CMUSHclientDoc:: ChangedPrefsP8 (CPrefsP8 &page8) { + DelayDebugMsg ("Checking", 8); return m_enable_triggers != page8.m_enable_triggers || m_enable_trigger_sounds != page8.m_enable_trigger_sounds || *************** *** 893,898 **** --- 962,968 ---- bool CMUSHclientDoc:: ChangedPrefsP9 (CPrefsP9 &page9) { + DelayDebugMsg ("Checking", 9); return m_strCommandStackCharacter != page9.m_command_stack_character [0] || *************** *** 945,950 **** --- 1015,1021 ---- bool CMUSHclientDoc:: ChangedPrefsP10 (CPrefsP10 &page10) { + DelayDebugMsg ("Checking", 10); return m_file_postamble != page10.m_file_postamble || m_file_preamble != page10.m_file_preamble || *************** *** 961,972 **** --- 1032,1045 ---- bool CMUSHclientDoc:: ChangedPrefsP11 (CPrefsP11 &page11) { + DelayDebugMsg ("Checking", 11); return m_notes != page11.m_notes; } // end of CMUSHclientDoc::ChangedPrefsP11 bool CMUSHclientDoc:: ChangedPrefsP12 (CPrefsP12 &page12) { + DelayDebugMsg ("Checking", 12); bool bChanged = false; *************** *** 982,987 **** --- 1055,1061 ---- bool CMUSHclientDoc:: ChangedPrefsP13 (CPrefsP13 &page13) { + DelayDebugMsg ("Checking", 13); return m_paste_postamble != page13.m_paste_postamble || m_paste_preamble != page13.m_paste_preamble || *************** *** 997,1002 **** --- 1071,1077 ---- bool CMUSHclientDoc:: ChangedPrefsP14 (CPrefsP14 &page14) { + DelayDebugMsg ("Checking", 14); return m_font_height != page14.m_font_height || *************** *** 1038,1048 **** --- 1113,1125 ---- bool CMUSHclientDoc:: ChangedPrefsP15 (CPrefsP15 &page15) { + DelayDebugMsg ("Checking", 15); return false; } // end of CMUSHclientDoc::ChangedPrefsP15 bool CMUSHclientDoc:: ChangedPrefsP16 (CPrefsP16 &page16) { + DelayDebugMsg ("Checking", 16); return m_bEnableTimers != page16.m_bEnableTimers || m_bUseDefaultTimers != page16.m_bUseDefaultTimers; *************** *** 1050,1055 **** --- 1127,1133 ---- bool CMUSHclientDoc:: ChangedPrefsP17 (CPrefsP17 &page17) { + DelayDebugMsg ("Checking", 17); return m_strLanguage != page17.m_strLanguage || m_bEnableScripts != page17.m_bEnableScripts || *************** *** 1081,1092 **** --- 1159,1172 ---- bool CMUSHclientDoc:: ChangedPrefsP18 (CPrefsP18 &page18) { + DelayDebugMsg ("Checking", 18); // page 18 - nothing to check return false; } // end of CMUSHclientDoc::ChangedPrefsP18 bool CMUSHclientDoc:: ChangedPrefsP19 (CPrefsP19 &page19) { + DelayDebugMsg ("Checking", 19); return m_strAutoSayString != page19.m_strAutoSayString || m_bEnableAutoSay != page19.m_bEnableAutoSay || *************** *** 1099,1104 **** --- 1179,1185 ---- bool CMUSHclientDoc:: ChangedPrefsP20 (CPrefsP20 &page20) { + DelayDebugMsg ("Checking", 20); // fix up printer styles int i, *************** *** 1210,1215 **** --- 1291,1297 ---- bool CMUSHclientDoc:: ChangedPrefsP21 (CPrefsP21 &page21) { + DelayDebugMsg ("Checking", 21); page21.m_name.TrimLeft (); page21.m_name.TrimRight (); *************** *** 1224,1229 **** --- 1306,1312 ---- bool CMUSHclientDoc:: ChangedPrefsP22 (CPrefsP22 &page22) { + DelayDebugMsg ("Checking", 22); return m_iMXPdebugLevel != page22.m_iMXPdebugLevel || *************** *** 1243,1248 **** --- 1326,1332 ---- bool CMUSHclientDoc:: ChangedPrefsP23 (CPrefsP23 &page23) { + DelayDebugMsg ("Checking", 23); return m_strOurChatName != page23.m_strOurChatName || *************** *** 1268,1273 **** --- 1352,1358 ---- void CMUSHclientDoc::SavePrefsP1 (CPrefsP1 &page1) { + DelayDebugMsg ("Saving", 1); m_port = (unsigned short) page1.m_port; m_mush_name = page1.m_mush_name; m_server = page1.m_server; *************** *** 1282,1291 **** --- 1367,1378 ---- void CMUSHclientDoc:: SavePrefsP2 (CPrefsP2 &page2) { + DelayDebugMsg ("Saving", 2); } // end of CMUSHclientDoc::SavePrefsP2 void CMUSHclientDoc:: SavePrefsP3 (CPrefsP3 &page3) { + DelayDebugMsg ("Saving", 3); memcpy (m_customtext, page3.m_customtext, sizeof (m_customtext)); memcpy (m_customback, page3.m_customback, sizeof (m_customback)); for (int i = 0; i < MAX_CUSTOM; i++) *************** *** 1295,1300 **** --- 1382,1388 ---- void CMUSHclientDoc:: SavePrefsP4 (CPrefsP4 &page4) { + DelayDebugMsg ("Saving", 4); m_bLogOutput = page4.m_bLogOutput; m_log_input = page4.m_log_input; m_bLogNotes = page4.m_bLogNotes; *************** *** 1315,1320 **** --- 1403,1409 ---- void CMUSHclientDoc:: SavePrefsP5 (CPrefsP5 &page5) { + DelayDebugMsg ("Saving", 5); memcpy (m_normalcolour, page5.m_normalcolour, sizeof (m_normalcolour)); memcpy (m_boldcolour, page5.m_boldcolour, sizeof (m_boldcolour)); m_bUseDefaultColours = page5.m_bUseDefaultColours; *************** *** 1323,1328 **** --- 1412,1418 ---- void CMUSHclientDoc:: SavePrefsP6 (CPrefsP6 &page6) { + DelayDebugMsg ("Saving", 6); int i; for (i = 0; i < NUMITEMS (m_macros); i++) { *************** *** 1334,1345 **** --- 1424,1437 ---- void CMUSHclientDoc:: SavePrefsP7 (CPrefsP7 &page7) { + DelayDebugMsg ("Saving", 7); m_enable_aliases = page7.m_enable_aliases; m_bUseDefaultAliases = page7.m_bUseDefaultAliases; } // end of CMUSHclientDoc::SavePrefsP7 void CMUSHclientDoc:: SavePrefsP8 (CPrefsP8 &page8) { + DelayDebugMsg ("Saving", 8); m_enable_triggers = page8.m_enable_triggers; m_enable_trigger_sounds = page8.m_enable_trigger_sounds; m_bUseDefaultTriggers = page8.m_bUseDefaultTriggers; *************** *** 1347,1352 **** --- 1439,1445 ---- void CMUSHclientDoc:: SavePrefsP9 (CPrefsP9 &page9) { + DelayDebugMsg ("Saving", 9); m_strCommandStackCharacter = page9.m_command_stack_character [0]; m_enable_command_stack = page9.m_enable_command_stacking; m_enable_speed_walk = page9.m_enable_speed_walk; *************** *** 1398,1403 **** --- 1491,1497 ---- void CMUSHclientDoc:: SavePrefsP10 (CPrefsP10 &page10) { + DelayDebugMsg ("Saving", 10); m_file_postamble = page10.m_file_postamble; m_file_preamble = page10.m_file_preamble; m_line_postamble = page10.m_line_postamble; *************** *** 1411,1421 **** --- 1505,1517 ---- void CMUSHclientDoc:: SavePrefsP11 (CPrefsP11 &page11) { + DelayDebugMsg ("Saving", 11); m_notes = page11.m_notes; } // end of CMUSHclientDoc::SavePrefsP11 void CMUSHclientDoc:: SavePrefsP12 (CPrefsP12 &page12) { + DelayDebugMsg ("Saving", 12); for (int i = 0; i < eKeypad_Max_Items; i++) m_keypad [i] = page12.m_keypad [i]; *************** *** 1424,1429 **** --- 1520,1526 ---- void CMUSHclientDoc:: SavePrefsP13 (CPrefsP13 &page13) { + DelayDebugMsg ("Saving", 13); m_paste_postamble = page13.m_paste_postamble; m_paste_preamble = page13.m_paste_preamble; m_pasteline_postamble = page13.m_pasteline_postamble; *************** *** 1437,1442 **** --- 1534,1540 ---- void CMUSHclientDoc:: SavePrefsP14 (CPrefsP14 &page14) { + DelayDebugMsg ("Saving", 14); m_font_height = page14.m_font_height; m_font_name = page14.m_font_name; m_font_weight = page14.m_font_weight; *************** *** 1513,1528 **** --- 1611,1629 ---- void CMUSHclientDoc:: SavePrefsP15 (CPrefsP15 &page15) { + DelayDebugMsg ("Saving", 15); } // end of CMUSHclientDoc::SavePrefsP15 void CMUSHclientDoc:: SavePrefsP16 (CPrefsP16 &page16) { + DelayDebugMsg ("Saving", 16); m_bEnableTimers = page16.m_bEnableTimers; m_bUseDefaultTimers = page16.m_bUseDefaultTimers; } // end of CMUSHclientDoc::SavePrefsP16 void CMUSHclientDoc:: SavePrefsP17 (CPrefsP17 &page17) { + DelayDebugMsg ("Saving", 17); // disable old scripting engine if: // a) The language has changed; or // b) The script file name has changed *************** *** 1601,1611 **** --- 1702,1714 ---- void CMUSHclientDoc:: SavePrefsP18 (CPrefsP18 &page18) { + DelayDebugMsg ("Saving", 18); // page 18 - nothing to copy } // end of CMUSHclientDoc::SavePrefsP18 void CMUSHclientDoc:: SavePrefsP19 (CPrefsP19 &page19) { + DelayDebugMsg ("Saving", 19); m_strAutoSayString = page19.m_strAutoSayString; m_bEnableAutoSay = page19.m_bEnableAutoSay; m_bExcludeMacros = page19.m_bExcludeMacros; *************** *** 1616,1627 **** --- 1719,1732 ---- void CMUSHclientDoc:: SavePrefsP20 (CPrefsP20 &page20) { + DelayDebugMsg ("Saving", 20); // do the saving in the "ischanged" routine - it does a lot of work for it } // end of CMUSHclientDoc::SavePrefsP20 void CMUSHclientDoc:: SavePrefsP21 (CPrefsP21 &page21) { + DelayDebugMsg ("Saving", 21); m_name = page21.m_name; m_password = page21.m_password; m_connect_now = page21.m_connect_now; *************** *** 1630,1635 **** --- 1735,1741 ---- void CMUSHclientDoc:: SavePrefsP22 (CPrefsP22 &page22) { + DelayDebugMsg ("Saving", 22); m_iHyperlinkColour = page22.m_iHyperlinkColour; m_iMXPdebugLevel = page22.m_iMXPdebugLevel; *************** *** 1655,1660 **** --- 1761,1767 ---- void CMUSHclientDoc:: SavePrefsP23 (CPrefsP23 &page23) { + DelayDebugMsg ("Saving", 23); unsigned short iOldPort = m_IncomingChatPort; m_bAutoAllowSnooping = page23.m_bAutoAllowSnooping ; *************** *** 1824,1829 **** --- 1931,1938 ---- bool CMUSHclientDoc::GamePreferences (const int iPage) { + Frame.DelayDebugStatus ("Starting world config"); + int iWantedPage = iPage; if (iWantedPage == -1) *************** *** 1842,1847 **** --- 1951,1958 ---- sheet.m_clrCaptionRight = sheet.m_clrCaptionLeft; // no gradient sheet.m_clrCaptionTextLeft = RGB (255, 255, 255); // white + Frame.DelayDebugStatus ("World config - constructing pages"); + // dividers CPrefsP0 page0; // name *************** *** 1891,1896 **** --- 2002,2009 ---- CPrefsP17 page17; CPrefsP18 page18; + Frame.DelayDebugStatus ("World config - loading pages"); + // name LoadPrefsP1 (page1); *************** *** 1946,1951 **** --- 2059,2067 ---- // page0000.m_doc = this; page00000.m_doc = this; + + Frame.DelayDebugStatus ("World config - adding pages to property sheet"); + // Add pages to property sheet. Their page numbers will depend on the order // in which they are added. *************** *** 2034,2047 **** --- 2150,2172 ---- bool bSavedF1Flag = App.m_bF1macro; App.m_bF1macro = false; + Frame.DelayDebugStatus ("World config - showing dialog"); + // do preferences page int iResult = sheet.DoModal (); + + Frame.DelayDebugStatus ("World config - dialog done"); // now put it back - bluurrrggghhh!!! App.m_bF1macro = bSavedF1Flag; if (iResult != IDOK) + { + Frame.SetStatusNormal (); return false; + } + + Frame.DelayDebugStatus ("World config - dialog not cancelled"); // make sure we re-evaluate the IP address if the server address changes *************** *** 2053,2058 **** --- 2178,2185 ---- if (m_strProxyServerName != page1.m_strProxyServerName) ZeroMemory(&m_ProxyAddr, sizeof m_ProxyAddr); + Frame.DelayDebugStatus ("World config - fixing fonts"); + // change input font if necessary if (m_input_font_height != page9.m_input_font_height || *************** *** 2087,2092 **** --- 2214,2221 ---- page14.m_bShowUnderline, page14.m_iLineSpacing); + Frame.DelayDebugStatus ("World config - checking if world changed"); + if ( // name *************** *** 2141,2152 **** --- 2270,2285 ---- if (ChangedPrefsP20 (page20)) SetModifiedFlag (TRUE); + Frame.DelayDebugStatus ("World config - updating views"); + // update all views in case font or colours changed UpdateAllViews (NULL); // save new values in the document + Frame.DelayDebugStatus ("World config - saving pages"); + // name SavePrefsP1 (page1); *************** *** 2187,2192 **** --- 2320,2327 ---- SavePrefsP17 (page17); SavePrefsP18 (page18); + + Frame.SetStatusNormal (); return true; // did it OK } Index: doc.cpp =================================================================== RCS file: /cvs/mushclient/doc.cpp,v retrieving revision 1.219 retrieving revision 1.220 diff -c -r1.219 -r1.220 *** doc.cpp 22 Jul 2007 02:46:05 -0000 1.219 --- doc.cpp 9 Aug 2007 01:20:55 -0000 1.220 *************** *** 497,502 **** --- 497,504 ---- DISP_FUNCTION(CMUSHclientDoc, "GetNotepadList", GetNotepadList, VT_VARIANT, VTS_BOOL) DISP_FUNCTION(CMUSHclientDoc, "TranslateDebug", TranslateDebug, VT_I4, VTS_BSTR) DISP_FUNCTION(CMUSHclientDoc, "SendSpecial", SendSpecial, VT_I4, VTS_BSTR VTS_BOOL VTS_BOOL VTS_BOOL VTS_BOOL) + DISP_FUNCTION(CMUSHclientDoc, "GetGlobalOption", GetGlobalOption, VT_VARIANT, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "GetGlobalOptionList", GetGlobalOptionList, VT_VARIANT, VTS_NONE) DISP_PROPERTY_PARAM(CMUSHclientDoc, "NormalColour", GetNormalColour, SetNormalColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "BoldColour", GetBoldColour, SetBoldColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "CustomColourText", GetCustomColourText, SetCustomColourText, VT_I4, VTS_I2) *************** *** 6561,6566 **** --- 6563,6569 ---- case eSendToPane: { + /* string sName = "test"; string sTitle = "test title"; *************** *** 6594,6599 **** --- 6597,6603 ---- m_iNoteColourBack, m_iNoteStyle, true); + */ } break; *************** *** 7748,7751 **** --- 7752,7756 ---- putontoclipboard (QuoteForumCodes (strContents)); } + Index: doc.h =================================================================== RCS file: /cvs/mushclient/doc.h,v retrieving revision 1.225 retrieving revision 1.228 diff -c -r1.225 -r1.228 *** doc.h 26 Jul 2007 00:46:46 -0000 1.225 --- doc.h 9 Aug 2007 01:20:55 -0000 1.228 *************** *** 21,28 **** // New versions - things to change ! #define THISVERSION 416 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.16"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT --- 21,28 ---- // New versions - things to change ! #define THISVERSION 418 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.18"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT *************** *** 2391,2396 **** --- 2391,2398 ---- afx_msg VARIANT GetNotepadList(BOOL All); afx_msg long TranslateDebug(LPCTSTR Message); afx_msg long SendSpecial(LPCTSTR Message, BOOL Echo, BOOL Queue, BOOL Log, BOOL History); + afx_msg VARIANT GetGlobalOption(LPCTSTR Name); + afx_msg VARIANT GetGlobalOptionList(); afx_msg long GetNormalColour(short WhichColour); afx_msg void SetNormalColour(short WhichColour, long nNewValue); afx_msg long GetBoldColour(short WhichColour); Index: functionlist.cpp =================================================================== RCS file: /cvs/mushclient/functionlist.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** functionlist.cpp 22 Jul 2007 02:46:06 -0000 1.25 --- functionlist.cpp 9 Aug 2007 01:20:55 -0000 1.26 *************** *** 144,151 **** "GetDefaultValue", "GetEntity", "GetFrame", "GetHostAddress", ! "GetHostName", "GetInfo", "GetInternalCommandsList", "GetLineCount", --- 144,153 ---- "GetDefaultValue", "GetEntity", "GetFrame", + "GetGlobalOption", + "GetGlobalOptionList", "GetHostAddress", ! "GetHostName", "GetInfo", "GetInternalCommandsList", "GetLineCount", Index: globalregistryoptions.cpp =================================================================== RCS file: /cvs/mushclient/globalregistryoptions.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** globalregistryoptions.cpp 25 Jul 2007 05:02:19 -0000 1.16 --- globalregistryoptions.cpp 9 Aug 2007 01:20:55 -0000 1.17 *************** *** 112,119 **** for (i = 0; GlobalOptionsTable [i].pName; i++) { ! char * p = (char *) this + GlobalOptionsTable [i].iOffset; ! int Value = GetProfileInt ("Global prefs", GlobalOptionsTable [i].pName, GlobalOptionsTable [i].iDefault); --- 112,119 ---- for (i = 0; GlobalOptionsTable [i].pName; i++) { ! const char * p = (const char *) this + GlobalOptionsTable [i].iOffset; ! const int Value = GetProfileInt ("Global prefs", GlobalOptionsTable [i].pName, GlobalOptionsTable [i].iDefault); *************** *** 123,130 **** for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) { ! char * p = (char *) this + AlphaGlobalOptionsTable [i].iOffset; ! CString strValue = GetProfileString ("Global prefs", AlphaGlobalOptionsTable [i].pName, AlphaGlobalOptionsTable [i].sDefault); --- 123,130 ---- for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) { ! const char * p = (const char *) this + AlphaGlobalOptionsTable [i].iOffset; ! const CString strValue = GetProfileString ("Global prefs", AlphaGlobalOptionsTable [i].pName, AlphaGlobalOptionsTable [i].sDefault); *************** *** 140,146 **** HRSRC hRsrc; HGLOBAL hRsrc_text = NULL; ! char * p = NULL; DWORD iLength = 0; // Load the text of the Lua sandbox --- 140,146 ---- HRSRC hRsrc; HGLOBAL hRsrc_text = NULL; ! const char * p = NULL; DWORD iLength = 0; // Load the text of the Lua sandbox *************** *** 154,160 **** } if (hRsrc_text) ! p = (char *) LockResource (hRsrc_text); if (p) m_strLuaScript = CString (p, iLength); --- 154,160 ---- } if (hRsrc_text) ! p = (const char *) LockResource (hRsrc_text); if (p) m_strLuaScript = CString (p, iLength); *************** *** 172,179 **** for (i = 0; GlobalOptionsTable [i].pName; i++) { ! char * p = (char *) this + GlobalOptionsTable [i].iOffset; ! int Value = * (long *) p; WriteProfileInt ("Global prefs", GlobalOptionsTable [i].pName, Value); --- 172,179 ---- for (i = 0; GlobalOptionsTable [i].pName; i++) { ! const char * p = (const char *) this + GlobalOptionsTable [i].iOffset; ! const int Value = * (const long *) p; WriteProfileInt ("Global prefs", GlobalOptionsTable [i].pName, Value); *************** *** 182,188 **** for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) { ! char * p = (char *) this + AlphaGlobalOptionsTable [i].iOffset; CString strValue = * (CString *) p; WriteProfileString ("Global prefs", --- 182,188 ---- for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) { ! const char * p = (const char *) this + AlphaGlobalOptionsTable [i].iOffset; CString strValue = * (CString *) p; WriteProfileString ("Global prefs", *************** *** 201,208 **** for (i = 0; GlobalOptionsTable [i].pName; i++) { ! char * p = (char *) this + GlobalOptionsTable [i].iOffset; ! int Value = * (long *) p; pDoc->Note (CFormat ("%35s = %ld", (LPCTSTR) GlobalOptionsTable [i].pName, Value)); --- 201,208 ---- for (i = 0; GlobalOptionsTable [i].pName; i++) { ! const char * p = (const char *) this + GlobalOptionsTable [i].iOffset; ! const int Value = * (const long *) p; pDoc->Note (CFormat ("%35s = %ld", (LPCTSTR) GlobalOptionsTable [i].pName, Value)); *************** *** 211,217 **** for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) { ! char * p = (char *) this + AlphaGlobalOptionsTable [i].iOffset; CString strValue = * (CString *) p; pDoc->Note (CFormat ("%35s = %s", --- 211,217 ---- for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) { ! const char * p = (const char *) this + AlphaGlobalOptionsTable [i].iOffset; CString strValue = * (CString *) p; pDoc->Note (CFormat ("%35s = %s", *************** *** 223,225 **** --- 223,299 ---- } // end of CMUSHclientApp::ShowGlobalOptions + + + VARIANT CMUSHclientApp::GetGlobalOption(LPCTSTR Name) + { + VARIANT vaResult; + VariantInit(&vaResult); + + int i; + + for (i = 0; GlobalOptionsTable [i].pName; i++) + { + if (_stricmp (Name, GlobalOptionsTable [i].pName) == 0) + { + const char * p = (const char *) this + GlobalOptionsTable [i].iOffset; + const int Value = * (const long *) p; + vaResult.vt = VT_I4; + vaResult.lVal = Value; + return vaResult; + } + + }; + + for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) + { + if (_stricmp (Name, AlphaGlobalOptionsTable [i].pName) == 0) + { + const char * p = (const char *) this + AlphaGlobalOptionsTable [i].iOffset; + CString strValue = * (CString *) p; + vaResult.vt = VT_BSTR; + vaResult.bstrVal = strValue.AllocSysString (); + return vaResult; + } + }; + + return vaResult; // not found (empty) + } + + + VARIANT CMUSHclientApp::GetGlobalOptionList() + { + COleSafeArray sa; // for list + long i, count = 0; + + // count them + for (i = 0; GlobalOptionsTable [i].pName; i++) + count++; + + for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) + count++; + + sa.CreateOneDim (VT_VARIANT, count); + count = 0; + + // put the numeric option names into the array + for (i = 0; GlobalOptionsTable [i].pName; i++) + { + // the array must be a bloody array of variants, or VBscript kicks up + COleVariant v ((LPCTSTR) GlobalOptionsTable [i].pName); + sa.PutElement (&count, &v); + count++; + } // end of looping through each option + + // put the alpha option names into the array + for (i = 0; AlphaGlobalOptionsTable [i].pName; i++) + { + // the array must be a bloody array of variants, or VBscript kicks up + COleVariant v ((LPCTSTR) AlphaGlobalOptionsTable [i].pName); + sa.PutElement (&count, &v); + count++; + } // end of looping through each option + + return sa.Detach (); + } + Index: lua_methods.cpp =================================================================== RCS file: /cvs/mushclient/lua_methods.cpp,v retrieving revision 1.75 retrieving revision 1.77 diff -c -r1.75 -r1.77 *** lua_methods.cpp 22 Jul 2007 02:46:06 -0000 1.75 --- lua_methods.cpp 9 Aug 2007 01:20:55 -0000 1.77 *************** *** 199,205 **** lua_call(L, 1, 1); s = lua_tostring(L, -1); /* get result */ if (s == NULL) ! luaL_error(L, "`tostring' must return a string to `print'"); if (i>1) sOutput += delimiter; --- 199,205 ---- lua_call(L, 1, 1); s = lua_tostring(L, -1); /* get result */ if (s == NULL) ! luaL_error(L, "'tostring' must return a string to be concatenated"); if (i>1) sOutput += delimiter; *************** *** 2135,2140 **** --- 2135,2159 ---- } // end of L_GetFrame //---------------------------------------- + // world.GetGlobalOption + //---------------------------------------- + static int L_GetGlobalOption (lua_State *L) + { + COleVariant v = doc (L)->GetGlobalOption (my_checkstring (L, 1)); + return pushVariant (L, v); + } // end of L_GetGlobalOption + + + //---------------------------------------- + // world.GetGlobalOptionList + //---------------------------------------- + static int L_GetGlobalOptionList (lua_State *L) + { + COleVariant v = doc (L)->GetGlobalOptionList (); + return pushVariant (L, v); + } // end of L_GetGlobalOptionList + + //---------------------------------------- // world.GetHostAddress //---------------------------------------- static int L_GetHostAddress (lua_State *L) *************** *** 2475,2481 **** return pushVariant (L, v); } // end of L_GetOptionList - //---------------------------------------- // world.PickColour //---------------------------------------- --- 2494,2499 ---- *************** *** 4887,4892 **** --- 4905,4912 ---- {"GetEntity", L_GetEntity}, {"GetXMLEntity", L_GetXMLEntity}, {"GetFrame", L_GetFrame}, + {"GetGlobalOption", L_GetGlobalOption}, + {"GetGlobalOptionList", L_GetGlobalOptionList}, {"GetHostAddress", L_GetHostAddress}, {"GetHostName", L_GetHostName}, {"GetInfo", L_GetInfo}, Index: lua_utils.cpp =================================================================== RCS file: /cvs/mushclient/lua_utils.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** lua_utils.cpp 25 Jul 2007 05:02:19 -0000 1.22 --- lua_utils.cpp 30 Jul 2007 00:06:52 -0000 1.23 *************** *** 1189,1194 **** --- 1189,1204 ---- return 1; } + // used in mainfrm.cpp + extern bool bShowDebugStatus; + + static int showdebugstatus (lua_State *L) + { + bShowDebugStatus = optboolean (L, 1, 1); + return 0; + } + + // table of operations static const struct luaL_reg xmllib [] = { *************** *** 1213,1218 **** --- 1223,1229 ---- {"utf8sub", utf8sub}, {"appendtonotepad", appendtonotepad}, {"activatenotepad", activatenotepad}, + {"showdebugstatus", showdebugstatus}, {NULL, NULL} }; Index: mainfrm.cpp =================================================================== RCS file: /cvs/mushclient/mainfrm.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -c -r1.64 -r1.65 *** mainfrm.cpp 21 Jul 2007 03:43:37 -0000 1.64 --- mainfrm.cpp 30 Jul 2007 00:06:52 -0000 1.65 *************** *** 396,401 **** --- 396,409 ---- } } // end of CWinFormsFrame::SetStatusMessageNow + bool bShowDebugStatus = false; + + void CMainFrame::DelayDebugStatus(const CString& msg) + { + if (bShowDebugStatus) + SetStatusMessageNow (msg); + } // end of CWinFormsFrame::DelayDebugStatus + void CMainFrame::SetStatusNormal (void) { SetStatusMessageNow (Translate ("Ready")); Index: mainfrm.h =================================================================== RCS file: /cvs/mushclient/mainfrm.h,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** mainfrm.h 21 Jul 2007 03:43:37 -0000 1.31 --- mainfrm.h 30 Jul 2007 00:06:52 -0000 1.32 *************** *** 51,56 **** --- 51,57 ---- void SetStatusNormal (void); void ReturnStatusRect (CRect & rect); void ReturnToolbarRect(CRect & rect); + void DelayDebugStatus(const CString& msg); void FixUpTitleBar (void); void OnUpdateBtnWorlds (int iWorld, CCmdUI* pCmdUI); Index: methods.cpp =================================================================== RCS file: /cvs/mushclient/methods.cpp,v retrieving revision 1.201 retrieving revision 1.202 diff -c -r1.201 -r1.202 *** methods.cpp 25 Jul 2007 05:02:19 -0000 1.201 --- methods.cpp 9 Aug 2007 01:20:55 -0000 1.202 *************** *** 2382,2388 **** case 36: SetUpVariantBool (vaResult, trigger_item->bOneShot); break; #ifdef PANE ! case 35: SetUpVariantString (vaResult, trigger_item->strPane); break; #endif // PANE case 101: SetUpVariantString (vaResult, trigger_item->wildcards [1].c_str ()); break; --- 2382,2388 ---- case 36: SetUpVariantBool (vaResult, trigger_item->bOneShot); break; #ifdef PANE ! case 37: SetUpVariantString (vaResult, trigger_item->strPane); break; #endif // PANE case 101: SetUpVariantString (vaResult, trigger_item->wildcards [1].c_str ()); break; *************** *** 9669,9674 **** --- 9669,9675 ---- #ifdef PANE + #if 0 // helper function to find a named pane CPaneView * CMUSHclientDoc::GetPane (LPCTSTR Name) *************** *** 9859,9864 **** --- 9860,9866 ---- return eOK; } + #endif // 0 #endif // PANE *************** *** 11479,11484 **** --- 11481,11498 ---- // wow! finished ok return 0; // ok exit + } + + + + VARIANT CMUSHclientDoc::GetGlobalOption(LPCTSTR Name) + { + return App.GetGlobalOption (Name); + } + + VARIANT CMUSHclientDoc::GetGlobalOptionList() + { + return App.GetGlobalOptionList (); } Index: mushclient.cnt =================================================================== RCS file: /cvs/mushclient/mushclient.cnt,v retrieving revision 1.26 retrieving revision 1.27 diff -c -r1.26 -r1.27 *** mushclient.cnt 22 Jul 2007 02:46:06 -0000 1.26 --- mushclient.cnt 9 Aug 2007 01:20:55 -0000 1.27 *************** *** 289,294 **** --- 289,296 ---- 3 GetDefaultValue=FNC_GetDefaultValue 3 GetEntity=FNC_GetEntity 3 GetFrame=FNC_GetFrame + 3 GetGlobalOption=FNC_GetGlobalOption + 3 GetGlobalOptionList=FNC_GetGlobalOptionList 3 GetHostAddress=FNC_GetHostAddress 3 GetHostName=FNC_GetHostName 3 GetInfo=FNC_GetInfo Index: mushclient.hlp =================================================================== RCS file: /cvs/mushclient/mushclient.hlp,v retrieving revision 1.85 retrieving revision 1.87 diff -c -r1.85 -r1.87 Binary files /tmp/cvspyeDDL and /tmp/cvsiEYCLM differ Index: mushclient.odl =================================================================== RCS file: /cvs/mushclient/mushclient.odl,v retrieving revision 1.105 retrieving revision 1.106 diff -c -r1.105 -r1.106 *** mushclient.odl 22 Jul 2007 02:46:14 -0000 1.105 --- mushclient.odl 9 Aug 2007 01:21:04 -0000 1.106 *************** *** 70,83 **** [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(313), propget] long NormalColour(short WhichColour); ! [id(313), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(314), propget] long BoldColour(short WhichColour); ! [id(314), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(315), propget] long CustomColourText(short WhichColour); ! [id(315), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(316), propget] long CustomColourBackground(short WhichColour); ! [id(316), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); --- 70,83 ---- [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(315), propget] long NormalColour(short WhichColour); ! [id(315), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(316), propget] long BoldColour(short WhichColour); ! [id(316), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(317), propget] long CustomColourText(short WhichColour); ! [id(317), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(318), propget] long CustomColourBackground(short WhichColour); ! [id(318), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); *************** *** 344,349 **** --- 344,351 ---- [id(310)] VARIANT GetNotepadList(BOOL All); [id(311)] long TranslateDebug(BSTR Message); [id(312)] long SendSpecial(BSTR Message, BOOL Echo, BOOL Queue, BOOL Log, BOOL History); + [id(313)] VARIANT GetGlobalOption(BSTR Name); + [id(314)] VARIANT GetGlobalOptionList(); //}}AFX_ODL_METHOD }; Index: prefspropertypages.cpp =================================================================== RCS file: /cvs/mushclient/prefspropertypages.cpp,v retrieving revision 1.103 retrieving revision 1.105 diff -c -r1.103 -r1.105 *** prefspropertypages.cpp 13 Jun 2007 17:57:28 -0000 1.103 --- prefspropertypages.cpp 9 Aug 2007 01:21:04 -0000 1.105 *************** *** 2285,2291 **** // extra code for version 3.53 - don't show in list if it is an accelerator try { ! StringToKeyCode (strMacroDescriptions [nItem], fVirt, key); } catch (CException* e) { --- 2285,2305 ---- // extra code for version 3.53 - don't show in list if it is an accelerator try { ! const char * sKey = strMacroDescriptions [nItem]; ! ! // all lower-case words (like north, quit etc.) won't be keycodes ! bool bLower = true; ! for (const char * p = sKey; *p; p++) ! if (!islower (*p)) ! bLower = false; ! ! if (bLower) ! { ! fVirt = 0; // won't be in list ! key = 0; ! } ! else ! StringToKeyCode (sKey, fVirt, key); } catch (CException* e) { *************** *** 3755,3766 **** trigger_item->bSoundIfInactive == dlg->m_bSoundIfInactive && trigger_item->bLowercaseWildcard == (bool) dlg->m_bLowercaseWildcard && trigger_item->iMatch == iMatch && // colour matching ! (trigger_item->iStyle & HILITE) != 0 == dlg->m_bBold && ! (trigger_item->iStyle & BLINK) != 0 == dlg->m_bItalic && ! (trigger_item->iStyle & UNDERLINE) != 0 == dlg->m_bUnderline && ! (trigger_item->sound_to_play == dlg->m_sound_pathname || (trigger_item->sound_to_play.IsEmpty () && ! dlg->m_sound_pathname == NOSOUNDLIT) && trigger_item->bTemporary == (bool) dlg->m_bTemporary && trigger_item->strGroup == dlg->m_strGroup && trigger_item->strVariable == dlg->m_strVariable && --- 3769,3780 ---- trigger_item->bSoundIfInactive == dlg->m_bSoundIfInactive && trigger_item->bLowercaseWildcard == (bool) dlg->m_bLowercaseWildcard && trigger_item->iMatch == iMatch && // colour matching ! ((trigger_item->iStyle & HILITE) != 0) == dlg->m_bBold && ! ((trigger_item->iStyle & BLINK) != 0) == dlg->m_bItalic && ! ((trigger_item->iStyle & UNDERLINE) != 0) == dlg->m_bUnderline && ! ((trigger_item->sound_to_play == dlg->m_sound_pathname) || (trigger_item->sound_to_play.IsEmpty () && ! (dlg->m_sound_pathname == NOSOUNDLIT))) && trigger_item->bTemporary == (bool) dlg->m_bTemporary && trigger_item->strGroup == dlg->m_strGroup && trigger_item->strVariable == dlg->m_strVariable && *************** *** 3768,3774 **** trigger_item->iOtherBackground == dlg->m_iOtherBackground && trigger_item->iLinesToMatch == dlg->m_iLinesToMatch && trigger_item->iColourChangeType == dlg->m_iColourChangeType - ) ) return false; // no need to set modified flag if nothing changed return true; --- 3782,3787 ---- Index: resource.h =================================================================== RCS file: /cvs/mushclient/resource.h,v retrieving revision 1.127 retrieving revision 1.128 diff -c -r1.127 -r1.128 *** resource.h 21 Jul 2007 03:43:45 -0000 1.127 --- resource.h 9 Aug 2007 01:21:04 -0000 1.128 *************** *** 1561,1567 **** #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 347 #define _APS_NEXT_COMMAND_VALUE 33054 #define _APS_NEXT_CONTROL_VALUE 2897 #define _APS_NEXT_SYMED_VALUE 312 --- 1561,1567 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 349 #define _APS_NEXT_COMMAND_VALUE 33054 #define _APS_NEXT_CONTROL_VALUE 2897 #define _APS_NEXT_SYMED_VALUE 312 Index: sendvw.cpp =================================================================== RCS file: /cvs/mushclient/sendvw.cpp,v retrieving revision 1.79 retrieving revision 1.80 diff -c -r1.79 -r1.80 *** sendvw.cpp 21 Jul 2007 03:43:45 -0000 1.79 --- sendvw.cpp 9 Aug 2007 01:21:04 -0000 1.80 *************** *** 1521,1530 **** int cyCur, cyMin; ! m_owner_frame->m_wndSplitter.GetRowInfo (0, cyCur, cyMin); App.WriteProfileInt(pDoc->m_mush_name, "Top Height", cyCur); ! m_owner_frame->m_wndSplitter.GetRowInfo (1, cyCur, cyMin); App.WriteProfileInt(pDoc->m_mush_name, "Bottom Height", cyCur); // TRACE1 ("Bottom height (saved) = %i\n", cyCur); --- 1521,1530 ---- int cyCur, cyMin; ! m_owner_frame->m_wndSplitter.GetRowInfo (OUTPUT_PANE, cyCur, cyMin); App.WriteProfileInt(pDoc->m_mush_name, "Top Height", cyCur); ! m_owner_frame->m_wndSplitter.GetRowInfo (COMMAND_PANE, cyCur, cyMin); App.WriteProfileInt(pDoc->m_mush_name, "Bottom Height", cyCur); // TRACE1 ("Bottom height (saved) = %i\n", cyCur); Index: stdafx.h =================================================================== RCS file: /cvs/mushclient/stdafx.h,v retrieving revision 1.103 retrieving revision 1.104 diff -c -r1.103 -r1.104 *** stdafx.h 25 Jul 2007 05:02:27 -0000 1.103 --- stdafx.h 9 Aug 2007 01:21:04 -0000 1.104 *************** *** 26,31 **** --- 26,43 ---- #define USE_PHP // Nick's "use PHP" extension ;) #define USE_RUBY // Nick's "use Ruby" extension ;) + //#define PANE // use pane windows + //#define USE_EXTRA_PANE // 3rd pane for messages and stuff + + #ifdef USE_EXTRA_PANE + #define EXTRA_PANE 0 + #define OUTPUT_PANE 1 + #define COMMAND_PANE 2 + #else + #define OUTPUT_PANE 0 + #define COMMAND_PANE 1 + #endif + #include // MFC core and standard components #include // MFC extensions #include // MFC OLE automation classes Index: xml_save_world.cpp =================================================================== RCS file: /cvs/mushclient/xml_save_world.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -c -r1.52 -r1.53 *** xml_save_world.cpp 11 Jun 2007 23:44:15 -0000 1.52 --- xml_save_world.cpp 4 Aug 2007 09:36:29 -0000 1.53 *************** *** 178,187 **** const bool sameline) { if (fNumber) ! Save_XML_string (ar, ! sName, ! FixHTMLString (CFormat ("%.2f", fNumber)), ! sameline); } // end of Save_XML_double void Save_XML_colour (CArchive& ar, --- 178,206 ---- const bool sameline) { if (fNumber) ! { ! // if number has decimal places, need special treatment ! if (floor (fNumber) != fNumber) ! { ! // see: http://www.gammon.com.au/forum/?id=8077 ! char old_locale[256]; ! strncpy(old_locale, setlocale(LC_NUMERIC, NULL), sizeof old_locale); /* store the locale */ ! old_locale [255] = 0; ! // want numbers formatted correctly ! setlocale (LC_NUMERIC, "C" ); ! Save_XML_string (ar, ! sName, ! FixHTMLString (CFormat ("%.2f", fNumber)), ! sameline); ! setlocale(LC_NUMERIC, old_locale); /* restore the old locale */ ! } ! else ! Save_XML_string (ar, ! sName, ! FixHTMLString (CFormat ("%.2f", fNumber)), ! sameline); ! ! } } // end of Save_XML_double void Save_XML_colour (CArchive& ar, Index: install/readme.txt =================================================================== RCS file: /cvs/mushclient/install/readme.txt,v retrieving revision 1.154 retrieving revision 1.157 diff -c -r1.154 -r1.157 *** install/readme.txt 26 Jul 2007 00:46:54 -0000 1.154 --- install/readme.txt 9 Aug 2007 01:21:04 -0000 1.157 *************** *** 1,7 **** ! MUSHclient version 4.16 ======================= ! Thursday, 26th July 2007 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ --- 1,7 ---- ! MUSHclient version 4.18 ======================= ! Thursday, 9th August 2007 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ Index: lua/copytable.lua =================================================================== RCS file: /cvs/mushclient/lua/copytable.lua,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** lua/copytable.lua 21 Jul 2007 03:07:39 -0000 1.1 --- lua/copytable.lua 30 Jul 2007 00:07:00 -0000 1.2 *************** *** 21,28 **** Deep: Copies keys and values recursively. If a value is a table, makes a copy of that table, and so on. Restrictions: Items must be "safe" to copy (eg. not file IO userdata). ! If doing a deep copy, a table may not appear inside itself. Example: --- 21,38 ---- Deep: Copies keys and values recursively. If a value is a table, makes a copy of that table, and so on. + Deep copy based on: http://lua-users.org/wiki/CopyTable + Restrictions: Items must be "safe" to copy (eg. not file IO userdata). ! ! The deep copied tables share the same metatable as the original ones. ! To change this, change the line: ! ! return setmetatable(new_table, getmetatable(object)) ! ! to: ! ! return setmetatable(new_table, _copy (getmetatable(object)) Example: *************** *** 40,69 **** module (..., package.seeall) ! function deep (t, done) ! assert (type (t) == "table", "You must specify a table to copy") ! ! local result = {} ! done = done or {} ! ! assert (not done [t], "table is defined within itself") ! ! done [t] = true -- we will disallow recopying table t ! ! for k, v in pairs (t) do ! if type (v) == "table" then ! result [k] = deep (v, done) ! else ! result [k] = v ! end -- if table or not ! end -- for each table element ! ! done [t] = nil -- table t can be copied again ! -- copy the metatable ! return setmetatable (result, getmetatable (t)) ! end -- function deep function shallow (t) assert (type (t) == "table", "You must specify a table to copy") --- 50,78 ---- module (..., package.seeall) ! ! function deep (object) ! local lookup_table = {} ! ! local function _copy (object) ! if type (object) ~= "table" then ! return object ! elseif lookup_table [object] then ! return lookup_table [object] ! end -- if ! ! local new_table = {} ! lookup_table [object] = new_table ! ! for index, value in pairs (object) do ! new_table [_copy (index)] = _copy (value) ! end -- for ! return setmetatable (new_table, getmetatable (object)) ! end -- function _copy ! return _copy (object) ! end -- function deepcopy function shallow (t) assert (type (t) == "table", "You must specify a table to copy")