Index: CompleteWordDlg.cpp =================================================================== RCS file: /cvs/mushclient/CompleteWordDlg.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** CompleteWordDlg.cpp 26 Apr 2007 06:10:06 -0000 1.3 --- CompleteWordDlg.cpp 11 Jun 2008 02:15:37 -0000 1.4 *************** *** 12,17 **** --- 12,18 ---- #endif extern set LuaFunctionsSet; + extern set LuaTablesSet; ///////////////////////////////////////////////////////////////////////////// // CCompleteWordDlg dialog *************** *** 84,90 **** // add Lua functions if (m_bLua) { ! for (set::const_iterator it = LuaFunctionsSet.begin (); it != LuaFunctionsSet.end (); it++) --- 85,93 ---- // add Lua functions if (m_bLua) { ! set::const_iterator it; ! ! for (it = LuaFunctionsSet.begin (); it != LuaFunctionsSet.end (); it++) *************** *** 99,104 **** --- 102,124 ---- iCount++; } } // end of doing each Lua function + + for (it = LuaTablesSet.begin (); + it != LuaTablesSet.end (); + it++) + + { + strFunction = it->c_str (); + strFunction.MakeLower (); + strFunction = strFunction.Left (iFilterLength); + + if (m_strFilter == strFunction) + { + m_ctlFunctions.AddString (it->c_str ()); + iCount++; + } + } // end of doing each Lua function + } // if Lua wanted // select the exact match, if any (so, if they highlight world.Note then it is selected) Index: GlobalPrefs.cpp =================================================================== RCS file: /cvs/mushclient/GlobalPrefs.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -c -r1.37 -r1.38 *** GlobalPrefs.cpp 21 Jul 2007 03:43:37 -0000 1.37 --- GlobalPrefs.cpp 11 Jun 2008 01:13:03 -0000 1.38 *************** *** 36,41 **** --- 36,42 ---- LPARAM lParam, LPARAM lpData ); + void RemoveTrailingBackslash (CString& str); // working directory at login time Index: MUSHclient.cpp =================================================================== RCS file: /cvs/mushclient/MUSHclient.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -c -r1.85 -r1.86 *** MUSHclient.cpp 27 May 2008 01:51:32 -0000 1.85 --- MUSHclient.cpp 11 Jun 2008 01:13:03 -0000 1.86 *************** *** 247,252 **** --- 247,255 ---- else m_strMUSHclientFileName = ".\\MUSHclient.exe"; + // stupid cursor disappears under Parallels + g_hCursorIbeam = CopyCursor(AfxGetApp()->LoadCursor (IDC_MY_IBEAM)); + // in case of error dialogs, etc. m_strFixedPitchFont = "FixedSys"; m_iFixedPitchFontSize = 9; *************** *** 523,529 **** CStaticLink::g_hCursorLink = AfxGetApp()->LoadCursor (ID_FINGER_CURSOR); ! bool bAutoOpen = true; // simple command line parsing if (m_lpCmdLine[0] == '\0') --- 526,532 ---- CStaticLink::g_hCursorLink = AfxGetApp()->LoadCursor (ID_FINGER_CURSOR); ! bool bAutoOpen = true; // simple command line parsing if (m_lpCmdLine[0] == '\0') Index: MUSHclient.dsp =================================================================== RCS file: /cvs/mushclient/MUSHclient.dsp,v retrieving revision 1.97 retrieving revision 1.98 diff -c -r1.97 -r1.98 *** MUSHclient.dsp 27 May 2008 01:51:32 -0000 1.97 --- MUSHclient.dsp 11 Jun 2008 01:13:03 -0000 1.98 *************** *** 738,743 **** --- 738,747 ---- # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" # Begin Source File + SOURCE=.\res\cursor1.cur + # End Source File + # Begin Source File + SOURCE=.\res\doc.ico # End Source File # Begin Source File *************** *** 1471,1488 **** # End Source File # End Target # End Project ! # Section MUSHclient : {F3B1306C-16CC-11D0-B7D0-00A0247B3BFD} ! # 0:8:Splash.h:D:\SOURCE\MUSHclient\Splash.h ! # 0:10:Splash.cpp:D:\SOURCE\MUSHclient\Splash.cpp ! # 1:10:IDB_SPLASH:102 ! # 2:10:ResHdrName:resource.h ! # 2:11:ProjHdrName:stdafx.h ! # 2:10:WrapperDef:_SPLASH_SCRN_ ! # 2:12:SplClassName:CSplashWnd ! # 2:21:SplashScreenInsertKey:4.0 ! # 2:10:HeaderName:Splash.h ! # 2:10:ImplemName:Splash.cpp ! # 2:7:BmpID16:IDB_SPLASH # End Section # Section MUSHclient : {F3B13065-16CC-11D0-B7D0-00A0247B3BFD} # 0:8:TipDlg.h:D:\SOURCE\MUSHclient\TipDlg.h --- 1475,1482 ---- # End Source File # End Target # End Project ! # Section MUSHclient : {00000000-0001-0000-0000-000000000000} ! # 1:23:CG_IDR_POPUP_MAIN_FRAME:126 # End Section # Section MUSHclient : {F3B13065-16CC-11D0-B7D0-00A0247B3BFD} # 0:8:TipDlg.h:D:\SOURCE\MUSHclient\TipDlg.h *************** *** 1509,1514 **** --- 1503,1521 ---- # 2:18:CG_IDS_FILE_ABSENT:CG_IDS_FILE_ABSENT # 2:10:TipDlg.cpp:TipDlg.cpp # End Section + # Section MUSHclient : {F3B1306C-16CC-11D0-B7D0-00A0247B3BFD} + # 0:8:Splash.h:D:\SOURCE\MUSHclient\Splash.h + # 0:10:Splash.cpp:D:\SOURCE\MUSHclient\Splash.cpp + # 1:10:IDB_SPLASH:102 + # 2:10:ResHdrName:resource.h + # 2:11:ProjHdrName:stdafx.h + # 2:10:WrapperDef:_SPLASH_SCRN_ + # 2:12:SplClassName:CSplashWnd + # 2:21:SplashScreenInsertKey:4.0 + # 2:10:HeaderName:Splash.h + # 2:10:ImplemName:Splash.cpp + # 2:7:BmpID16:IDB_SPLASH + # End Section # Section MUSHclient : {00000000-0000-0000-0000-000000000000} # 1:22:CG_IDR_POPUP_SEND_VIEW:124 # End Section *************** *** 1517,1523 **** # End Section # Section MUSHclient : {00000000-000C-0000-0C00-00004944445F} # 1:26:CG_IDR_POPUP_ACTIVITY_VIEW:127 - # End Section - # Section MUSHclient : {00000000-0001-0000-0000-000000000000} - # 1:23:CG_IDR_POPUP_MAIN_FRAME:126 # End Section --- 1524,1527 ---- Index: MUSHclient.h =================================================================== RCS file: /cvs/mushclient/MUSHclient.h,v retrieving revision 1.54 retrieving revision 1.55 diff -c -r1.54 -r1.55 *** MUSHclient.h 9 Aug 2007 01:20:55 -0000 1.54 --- MUSHclient.h 11 Jun 2008 01:13:03 -0000 1.55 *************** *** 262,267 **** --- 262,268 ---- CTextDocument * FindNotepad (const CString strTitle); BOOL ActivateNotepad(LPCTSTR Title); + HCURSOR g_hCursorIbeam; /* virtual void OnFinalRelease() Index: MUSHclient.rc =================================================================== RCS file: /cvs/mushclient/MUSHclient.rc,v retrieving revision 1.217 retrieving revision 1.218 diff -c -r1.217 -r1.218 *** MUSHclient.rc 3 Jun 2008 03:50:02 -0000 1.217 --- MUSHclient.rc 11 Jun 2008 01:13:03 -0000 1.218 *************** *** 13,18 **** --- 13,37 ---- #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// + // English (U.S.) resources + + #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) + #ifdef _WIN32 + LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + #pragma code_page(1252) + #endif //_WIN32 + + ///////////////////////////////////////////////////////////////////////////// + // + // Cursor + // + + IDC_MY_IBEAM CURSOR DISCARDABLE "res\\cursor1.cur" + #endif // English (U.S.) resources + ///////////////////////////////////////////////////////////////////////////// + + + ///////////////////////////////////////////////////////////////////////////// // English (Australia) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA) *************** *** 56,63 **** // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,26,0 ! PRODUCTVERSION 4,0,26,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L --- 75,82 ---- // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,27,0 ! PRODUCTVERSION 4,0,27,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.26\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2008 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.26\0" VALUE "SpecialBuild", "\0" END END --- 94,107 ---- VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.27\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2008 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.27\0" VALUE "SpecialBuild", "\0" END END Index: TextDocument.cpp =================================================================== RCS file: /cvs/mushclient/TextDocument.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -c -r1.18 -r1.19 *** TextDocument.cpp 12 Jun 2007 04:01:56 -0000 1.18 --- TextDocument.cpp 11 Jun 2008 01:13:03 -0000 1.19 *************** *** 486,491 **** --- 486,492 ---- case eNotepadWorldLoadError: case eNotepadXMLcomments: case eNotepadPluginInfo: + case eNotepadRecall: return TRUE; default: Index: doc.cpp =================================================================== RCS file: /cvs/mushclient/doc.cpp,v retrieving revision 1.222 retrieving revision 1.223 diff -c -r1.222 -r1.223 *** doc.cpp 29 Apr 2008 00:19:18 -0000 1.222 --- doc.cpp 11 Jun 2008 01:13:03 -0000 1.223 *************** *** 502,507 **** --- 502,508 ---- DISP_FUNCTION(CMUSHclientDoc, "GetPluginTriggerOption", GetPluginTriggerOption, VT_VARIANT, VTS_BSTR VTS_BSTR VTS_BSTR) DISP_FUNCTION(CMUSHclientDoc, "GetPluginAliasOption", GetPluginAliasOption, VT_VARIANT, VTS_BSTR VTS_BSTR VTS_BSTR) DISP_FUNCTION(CMUSHclientDoc, "GetPluginTimerOption", GetPluginTimerOption, VT_VARIANT, VTS_BSTR VTS_BSTR VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "AcceleratorTo", AcceleratorTo, VT_I4, VTS_BSTR VTS_BSTR VTS_I2) 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) *************** *** 1188,1194 **** // double IAC to IAC IAC ! str.Replace (_T("\xFF"), _T("\xFF\xFF")); // send it --- 1189,1196 ---- // double IAC to IAC IAC ! if (!m_bDoNotTranslateIACtoIACIAC) ! str.Replace (_T("\xFF"), _T("\xFF\xFF")); // send it Index: doc.h =================================================================== RCS file: /cvs/mushclient/doc.h,v retrieving revision 1.236 retrieving revision 1.237 diff -c -r1.236 -r1.237 *** doc.h 3 Jun 2008 03:50:03 -0000 1.236 --- doc.h 11 Jun 2008 01:13:04 -0000 1.237 *************** *** 21,28 **** // New versions - things to change ! #define THISVERSION 426 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.26"; // 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 427 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.27"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT *************** *** 789,794 **** --- 789,795 ---- CString m_strSpamMessage; // what spam filler to send unsigned short m_bDoNotShowOutstandingLines; // don't show outstanding lines in tabbed windows + unsigned short m_bDoNotTranslateIACtoIACIAC; // don't translate outgoing IAC to IAC/IAC // new in 3.36 *************** *** 1182,1187 **** --- 1183,1189 ---- WORD m_nextAcceleratorCommand; // next free command map m_AcceleratorToCommandMap; // command to send for accelerator map m_CommandToMacroMap; // what that command does + map m_CommandToSendToMap; // where it goes (eg. 0 = world, 1 = command etc.) HACCEL m_accelerator; // for mapping colours to colours *************** *** 2403,2408 **** --- 2405,2411 ---- afx_msg VARIANT GetPluginTriggerOption(LPCTSTR PluginID, LPCTSTR TriggerName, LPCTSTR OptionName); afx_msg VARIANT GetPluginAliasOption(LPCTSTR PluginID, LPCTSTR AliasName, LPCTSTR OptionName); afx_msg VARIANT GetPluginTimerOption(LPCTSTR PluginID, LPCTSTR TimerName, LPCTSTR OptionName); + afx_msg long AcceleratorTo(LPCTSTR Key, LPCTSTR Send, short SendTo); afx_msg long GetNormalColour(short WhichColour); afx_msg void SetNormalColour(short WhichColour, long nNewValue); afx_msg long GetBoldColour(short WhichColour); Index: doc_construct.cpp =================================================================== RCS file: /cvs/mushclient/doc_construct.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** doc_construct.cpp 3 Jun 2008 03:50:03 -0000 1.25 --- doc_construct.cpp 11 Jun 2008 01:13:04 -0000 1.26 *************** *** 92,97 **** --- 92,98 ---- m_echo_colour = 9; m_bAlwaysRecordCommandHistory = false; m_bDoNotShowOutstandingLines = false; + m_bDoNotTranslateIACtoIACIAC = false; m_bCopySelectionToClipboard = false; m_bCarriageReturnClearsLine = false; m_bConvertGAtoNewline = false; Index: functionlist.cpp =================================================================== RCS file: /cvs/mushclient/functionlist.cpp,v retrieving revision 1.27 retrieving revision 1.29 diff -c -r1.27 -r1.29 *** functionlist.cpp 10 Jan 2008 01:24:53 -0000 1.27 --- functionlist.cpp 11 Jun 2008 02:15:37 -0000 1.29 *************** *** 13,18 **** --- 13,19 ---- const char * sFunctions [] = { "Accelerator", + "AcceleratorTo", "AcceleratorList", "Activate", "ActivateClient", *************** *** 356,362 **** // scan backwards from cursor while (nStartChar >= 0 && strWord.GetLength () < 20 && ! (isalnum (strSelection [nStartChar]) || strSelection [nStartChar] == '.') ) { strWord = strSelection.Mid (nStartChar, 1) + strWord; --- 357,363 ---- // scan backwards from cursor while (nStartChar >= 0 && strWord.GetLength () < 20 && ! (isalnum (strSelection [nStartChar]) || strSelection [nStartChar] == '.' || strSelection [nStartChar] == '_') ) { strWord = strSelection.Mid (nStartChar, 1) + strWord; Index: lua_methods.cpp =================================================================== RCS file: /cvs/mushclient/lua_methods.cpp,v retrieving revision 1.80 retrieving revision 1.82 diff -c -r1.80 -r1.82 *** lua_methods.cpp 27 May 2008 01:51:32 -0000 1.80 --- lua_methods.cpp 11 Jun 2008 02:15:37 -0000 1.82 *************** *** 341,346 **** --- 341,360 ---- } // end of L_Accelerator //---------------------------------------- + // world.AcceleratorTo + //---------------------------------------- + static int L_AcceleratorTo (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->AcceleratorTo ( + my_checkstring (L, 1), // Key + my_checkstring (L, 2), // Send + my_checknumber (L, 3) // SendTo + )); + return 1; // number of result fields + } // end of L_AcceleratorTo + + //---------------------------------------- // world.AcceleratorList //---------------------------------------- static int L_AcceleratorList (lua_State *L) *************** *** 4180,4188 **** static int L_Save (lua_State *L) { CMUSHclientDoc *pDoc = doc (L); ! lua_pushboolean (L, pDoc->Save ( ! my_optstring (L, 1, "") // Name ! )); return 1; // number of result fields } // end of L_Save --- 4194,4207 ---- static int L_Save (lua_State *L) { CMUSHclientDoc *pDoc = doc (L); ! CString strOldName = pDoc->GetPathName (); ! bool bSaveAs = optboolean (L, 2, 0); // Save-As flag ! if (bSaveAs) ! lua_pushboolean (L, pDoc->Save (my_checkstring (L, 1))); ! else ! lua_pushboolean (L, pDoc->Save (my_optstring (L, 1, ""))); ! if (bSaveAs) ! pDoc->SetPathName (strOldName, FALSE); return 1; // number of result fields } // end of L_Save *************** *** 4822,4827 **** --- 4841,4847 ---- { {"Accelerator", L_Accelerator}, + {"AcceleratorTo", L_AcceleratorTo}, {"AcceleratorList", L_AcceleratorList}, {"Activate", L_Activate}, {"ActivateClient", L_ActivateClient}, *************** *** 5435,5440 **** --- 5455,5482 ---- { NULL, 0 } }; + static flags_pair send_to_destinations [] = + { + + { "world", eSendToWorld }, + { "command", eSendToCommand }, + { "output", eSendToOutput }, + { "status", eSendToStatus }, + { "notepad", eSendToNotepad }, + { "notepadappend", eAppendToNotepad }, + { "logfile", eSendToLogFile }, + { "notepadreplace", eReplaceNotepad }, + { "commandqueue", eSendToCommandQueue }, + { "variable", eSendToVariable }, + { "execute", eSendToExecute }, + { "speedwalk", eSendToSpeedwalk }, + { "script", eSendToScript }, + { "immediate", eSendImmediate }, + { "scriptafteromit", eSendToScriptAfterOmit }, + + { NULL, 0 } + }; + extern const struct luaL_reg *ptr_xmllib; *************** *** 5519,5524 **** --- 5561,5568 ---- MakeFlagsTable (L, "error_code", error_codes); // return codes - map number to description MakeIntFlagsTable (L, "error_desc", error_descriptions); + // send-to table + MakeFlagsTable (L, "sendto", send_to_destinations); // colour names *************** *** 5779,5782 **** } // end of DisableDLLs #endif // LUA - \ No newline at end of file --- 5823,5825 ---- Index: lua_progressdlg.cpp =================================================================== RCS file: /cvs/mushclient/lua_progressdlg.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** lua_progressdlg.cpp 17 Oct 2006 21:24:16 -0000 1.2 --- lua_progressdlg.cpp 11 Jun 2008 01:13:04 -0000 1.3 *************** *** 71,80 **** // done with the dialog, delete it static int Lprogress_gc (lua_State *L) { ! CProgressDlg *pProgressDlg = Lprogress_getdialog (L); delete pProgressDlg; // set userdata to NULL, so we don't try to use it now - CProgressDlg **ud = (CProgressDlg **) luaL_checkudata (L, 1, progress_dlg_handle); *ud = NULL; return 0; } // end of Lprogress_gc --- 71,80 ---- // done with the dialog, delete it static int Lprogress_gc (lua_State *L) { ! CProgressDlg **ud = (CProgressDlg **) luaL_checkudata (L, 1, progress_dlg_handle); ! CProgressDlg *pProgressDlg = *ud; // note, might be NULL already if they manually closed it delete pProgressDlg; // set userdata to NULL, so we don't try to use it now *ud = NULL; return 0; } // end of Lprogress_gc Index: lua_scripting.cpp =================================================================== RCS file: /cvs/mushclient/lua_scripting.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -c -r1.41 -r1.42 *** lua_scripting.cpp 24 Dec 2007 01:18:05 -0000 1.41 --- lua_scripting.cpp 11 Jun 2008 02:15:37 -0000 1.42 *************** *** 10,15 **** --- 10,16 ---- #ifdef USE_LUA set LuaFunctionsSet; + set LuaTablesSet; extern "C" { *************** *** 62,73 **** // add to set LuaFunctionsSet.insert (sFullName); ! } ! } ! } lua_pop (L, 1); // get rid of global table now ! } // for world completion, and help lookup, find all functions in the following tables static void BuildLuaFunctions (lua_State * L) --- 63,106 ---- // add to set LuaFunctionsSet.insert (sFullName); ! } // not prefixed by _ ! } // end if function ! } // end for loop lua_pop (L, 1); // get rid of global table now ! } // end of BuildOneLuaFunction ! ! static void BuildOneLuaTable (lua_State * L, const char * sTableName) ! { ! lua_settop (L, 0); // get rid of stuff lying around ! ! // get global table ! lua_getglobal (L, sTableName); ! ! const int table = 1; ! ! if (!lua_istable (L, table)) ! return; // aha! caught you! ! ! // standard Lua table iteration ! for (lua_pushnil (L); lua_next (L, table) != 0; lua_pop (L, 1)) ! { ! if (lua_isstring (L, -2)) ! { ! ! string sName (lua_tostring (L, -2)); ! ! string sFullName = sTableName; ! sFullName += "." + sName; // table.entry, eg. sendto.world ! ! // add to set ! LuaTablesSet.insert (sFullName); ! } // if string key ! } // end for loop ! ! lua_pop (L, 1); // get rid of global table now ! } // end of BuildOneLuaTable ! // for world completion, and help lookup, find all functions in the following tables static void BuildLuaFunctions (lua_State * L) *************** *** 102,107 **** --- 135,161 ---- } // end of BuildLuaFunctions + // for world completion, find all entries in the following tables + static void BuildLuaTables (lua_State * L) + { + const char * table_names [] = { + "trigger_flag", + "alias_flag", + "timer_flag", + "custom_colour", + "error_code", + "sendto", + + // add more tables here + + "" // end of table marker + }; + + // add all functions from each table + for (int i = 0; table_names [i] [0]; i++) + BuildOneLuaTable (L, table_names [i]); + + } // end of BuildLuaTables // I need this extra function to avoid: *************** *** 143,149 **** --- 197,206 ---- // for function-name completion, and help if (LuaFunctionsSet.empty ()) + { BuildLuaFunctions (L); + BuildLuaTables (L); + } // unless they explicitly enable it, remove ability to load DLLs DisableDLLs (L); Index: lua_utils.cpp =================================================================== RCS file: /cvs/mushclient/lua_utils.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -c -r1.23 -r1.24 *** lua_utils.cpp 30 Jul 2007 00:06:52 -0000 1.23 --- lua_utils.cpp 11 Jun 2008 01:13:04 -0000 1.24 *************** *** 616,623 **** if (sTitle) dlg.m_ofn.lpstrTitle = sTitle; ! if (dlg.DoModal() != IDOK) ! lua_pushnil (L); else lua_pushstring (L, dlg.GetPathName()); --- 616,623 ---- if (sTitle) dlg.m_ofn.lpstrTitle = sTitle; ! if (dlg.DoModal() != IDOK) ! lua_pushnil (L); else lua_pushstring (L, dlg.GetPathName()); *************** *** 625,630 **** --- 625,698 ---- } // end of filepicker + + // The field below is needed to initialise the browse directory dialog + // with the initial directory + + extern CString strStartingDirectory; + + // function prototypes needed for folder browsing + + extern int __stdcall BrowseCallbackProc( + HWND hwnd, + UINT uMsg, + LPARAM lParam, + LPARAM lpData + ); + + // directory picker routine + // arg1 = title of dialog + // arg2 = default directory name + // + // returns: chosen directory name, or nil if: cancelled, or none selected + + // test: /print (utils.directorypicker ("test", "c:\\source")) + + static int directorypicker (lua_State *L) + { + const char * sTitle = luaL_optstring (L, 1, ""); + const char * sDefaultName = luaL_optstring (L, 2, ""); + + // Gets the Shell's default allocator + LPMALLOC pMalloc; + if (::SHGetMalloc(&pMalloc) == NOERROR) + { + char pszBuffer[MAX_PATH]; // receives result + BROWSEINFO bi; + LPITEMIDLIST pidl; + + // Get help on BROWSEINFO struct - it's got all the bit settings. + bi.hwndOwner = NULL; + bi.pidlRoot = NULL; + bi.pszDisplayName = pszBuffer; + bi.lpszTitle = sTitle; + bi.ulFlags = BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS; + bi.lpfn = BrowseCallbackProc; + bi.lParam = 0; + strStartingDirectory = sDefaultName; + + // This next call issues the dialog box. + if ((pidl = ::SHBrowseForFolder(&bi)) != NULL) + { + if (::SHGetPathFromIDList(pidl, pszBuffer)) + lua_pushstring (L, pszBuffer); + else + lua_pushnil (L); + + // Free the PIDL allocated by SHBrowseForFolder. + pMalloc->Free(pidl); + } + else + lua_pushnil (L); + + // Release the shell's allocator. + pMalloc->Release(); + } + + return 1; + + } // end of directorypicker + static int spellcheckdialog (lua_State *L) { CSpellCheckDlg dlg; *************** *** 1213,1218 **** --- 1281,1287 ---- {"xmlread", xmlread}, {"functionlist", functionlist}, {"filepicker", filepicker}, + {"directorypicker", directorypicker}, {"metaphone", metaphone}, {"info", info}, {"spellcheckdialog", spellcheckdialog}, Index: methods.cpp =================================================================== RCS file: /cvs/mushclient/methods.cpp,v retrieving revision 1.207 retrieving revision 1.208 diff -c -r1.207 -r1.208 *** methods.cpp 3 Jun 2008 03:50:03 -0000 1.207 --- methods.cpp 11 Jun 2008 01:13:04 -0000 1.208 *************** *** 9921,9932 **** }; }; // end of fFindAccelerator - long CMUSHclientDoc::Accelerator(LPCTSTR Key, LPCTSTR Send) - { BYTE fVirt; WORD key; try { --- 9921,9936 ---- }; }; // end of fFindAccelerator + long CMUSHclientDoc::AcceleratorTo(LPCTSTR Key, LPCTSTR Send, short SendTo) + { BYTE fVirt; WORD key; + // check they are sending to somewhere valid + + if (SendTo < 0 || SendTo >= eSendToLast) + return eOptionOutOfRange; try { *************** *** 10019,10024 **** --- 10023,10031 ---- // remember what to send if they use that command m_CommandToMacroMap [command] = Send; + // and where to send it + m_CommandToSendToMap [command] = SendTo; + } // end of having something to do (ie. not deleting accelerator) // create new handle *************** *** 10036,10043 **** --- 10043,10058 ---- // App.m_pWorldDocTemplate->m_hAccelTable = hAccel; return eOK; + } // end of CMUSHclientDoc::AcceleratorTo + + long CMUSHclientDoc::Accelerator(LPCTSTR Key, LPCTSTR Send) + { + return AcceleratorTo (Key, Send, eSendToExecute); } + + + // /Accelerator ("F5", "sing") // /Note (Accelerator ("Alt+Shift+Ctrl+V", "hello")) // /Note (Accelerator ("Ctrl+F8", "hello")) *************** *** 10073,10080 **** CString key = KeyCodeToString (it->first >> 16, it->first); string command = m_CommandToMacroMap [it->second]; // the array must be a bloody array of variants, or VBscript kicks up ! COleVariant v (CFormat ("%s = %s", (LPCTSTR) key, command.c_str ())); sa.PutElement (&iCount, &v); } // end of looping through each accelerator } // end of having at least one --- 10088,10103 ---- CString key = KeyCodeToString (it->first >> 16, it->first); string command = m_CommandToMacroMap [it->second]; + CString strSendTo; + strSendTo.Format ("\t[%i]", m_CommandToSendToMap [it->second]); + + // for backwards compatability, send to Execute is shown as empty + if (m_CommandToSendToMap [it->second] == eSendToExecute) + strSendTo = ""; // the array must be a bloody array of variants, or VBscript kicks up ! COleVariant v (CFormat ("%s = %s%s", (LPCTSTR) key, ! command.c_str (), ! (LPCTSTR) strSendTo)); sa.PutElement (&iCount, &v); } // end of looping through each accelerator } // end of having at least one Index: mushclient.clw =================================================================== RCS file: /cvs/mushclient/mushclient.clw,v retrieving revision 1.338 retrieving revision 1.339 diff -c -r1.338 -r1.339 *** mushclient.clw 10 Jan 2008 01:24:53 -0000 1.338 --- mushclient.clw 11 Jun 2008 01:13:04 -0000 1.339 *************** *** 679,685 **** ImplementationFile=prefspropertypages.cpp Filter=D VirtualFilter=idWC ! LastObject=IDC_FILTER [CLS:CPrefsP9] Type=0 --- 679,685 ---- ImplementationFile=prefspropertypages.cpp Filter=D VirtualFilter=idWC ! LastObject=CPrefsP8 [CLS:CPrefsP9] Type=0 Index: mushclient.cnt =================================================================== RCS file: /cvs/mushclient/mushclient.cnt,v retrieving revision 1.30 retrieving revision 1.31 diff -c -r1.30 -r1.31 *** mushclient.cnt 21 Feb 2008 21:11:04 -0000 1.30 --- mushclient.cnt 11 Jun 2008 01:13:04 -0000 1.31 *************** *** 158,163 **** --- 158,164 ---- ; 2 World function list 3 Accelerator=FNC_Accelerator + 3 Accelerator=FNC_AcceleratorTo 3 AcceleratorList=FNC_AcceleratorList 3 Activate=FNC_Activate 3 ActivateClient=FNC_ActivateClient Index: mushclient.hlp =================================================================== RCS file: /cvs/mushclient/mushclient.hlp,v retrieving revision 1.91 retrieving revision 1.93 diff -c -r1.91 -r1.93 Binary files /tmp/cvsrkChI0 and /tmp/cvsw8us9M differ Index: mushclient.hpj =================================================================== RCS file: /cvs/mushclient/mushclient.hpj,v retrieving revision 1.3 retrieving revision 1.4 diff -c -r1.3 -r1.4 *** mushclient.hpj 4 May 2002 03:51:57 -0000 1.3 --- mushclient.hpj 11 Jun 2008 01:13:04 -0000 1.4 *************** *** 1,13 **** ; This file is maintained by HCW. Do not modify this file directly. [OPTIONS] ! COMPRESS=60 Hall Zeck ! LCID=0xc09 0x0 0x0 ; English (Australian) REPORT=Yes CONTENTS=new_index TITLE=MUSHclient Application Help ! COPYRIGHT=Copyright 1996 by Nick Gammon.%date ! CITATION=Copyright 1996 by Nick Gammon. BMROOT=hlp HLP=.\MushClient.hlp --- 1,13 ---- ; This file is maintained by HCW. Do not modify this file directly. [OPTIONS] ! COMPRESS=12 Hall Zeck ! LCID=0xc09 0x0 0x0 ; English (Australia) REPORT=Yes CONTENTS=new_index TITLE=MUSHclient Application Help ! COPYRIGHT=Copyright 2008 by Nick Gammon.%date ! CITATION=Copyright 2008 by Nick Gammon. BMROOT=hlp HLP=.\MushClient.hlp Index: mushclient.odl =================================================================== RCS file: /cvs/mushclient/mushclient.odl,v retrieving revision 1.107 retrieving revision 1.108 diff -c -r1.107 -r1.108 *** mushclient.odl 10 Jan 2008 01:25:03 -0000 1.107 --- mushclient.odl 11 Jun 2008 01:13:04 -0000 1.108 *************** *** 70,83 **** [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(318), propget] long NormalColour(short WhichColour); ! [id(318), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(319), propget] long BoldColour(short WhichColour); ! [id(319), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(320), propget] long CustomColourText(short WhichColour); ! [id(320), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(321), propget] long CustomColourBackground(short WhichColour); ! [id(321), 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(319), propget] long NormalColour(short WhichColour); ! [id(319), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(320), propget] long BoldColour(short WhichColour); ! [id(320), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(321), propget] long CustomColourText(short WhichColour); ! [id(321), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(322), propget] long CustomColourBackground(short WhichColour); ! [id(322), 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); *************** *** 349,354 **** --- 349,355 ---- [id(315)] VARIANT GetPluginTriggerOption(BSTR PluginID, BSTR TriggerName, BSTR OptionName); [id(316)] VARIANT GetPluginAliasOption(BSTR PluginID, BSTR AliasName, BSTR OptionName); [id(317)] VARIANT GetPluginTimerOption(BSTR PluginID, BSTR TimerName, BSTR OptionName); + [id(318)] long AcceleratorTo(BSTR Key, BSTR Send, short SendTo); //}}AFX_ODL_METHOD }; Index: mushview.cpp =================================================================== RCS file: /cvs/mushclient/mushview.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -c -r1.88 -r1.89 *** mushview.cpp 18 Mar 2008 06:02:24 -0000 1.88 --- mushview.cpp 11 Jun 2008 01:13:04 -0000 1.89 *************** *** 2161,2167 **** // not a hyperlink - just display the I-beam ! ::SetCursor (::LoadCursor (NULL, IDC_IBEAM)); return TRUE; } else --- 2161,2170 ---- // not a hyperlink - just display the I-beam ! // ::SetCursor (::LoadCursor (NULL, IDC_IBEAM)); ! ! ::SetCursor (App.g_hCursorIbeam); ! return TRUE; } else Index: resource.h =================================================================== RCS file: /cvs/mushclient/resource.h,v retrieving revision 1.128 retrieving revision 1.129 diff -c -r1.128 -r1.129 *** resource.h 9 Aug 2007 01:21:04 -0000 1.128 --- resource.h 11 Jun 2008 01:13:04 -0000 1.129 *************** *** 203,208 **** --- 203,209 ---- #define IDD_LUA_DEBUG 338 #define IDD_SPELLCHECK_DIALOG 340 #define IDD_INSERT_UNICODE 342 + #define IDC_MY_IBEAM 349 #define ID_IGNORE_BTN 1001 #define ID_LEX_CONTENTS_CB 1001 #define ID_IGNORE_ALL_BTN 1002 *************** *** 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 --- 1562,1568 ---- #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 ! #define _APS_NEXT_RESOURCE_VALUE 350 #define _APS_NEXT_COMMAND_VALUE 33054 #define _APS_NEXT_CONTROL_VALUE 2897 #define _APS_NEXT_SYMED_VALUE 312 Index: scriptingoptions.cpp =================================================================== RCS file: /cvs/mushclient/scriptingoptions.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -c -r1.52 -r1.53 *** scriptingoptions.cpp 3 Jun 2008 03:50:03 -0000 1.52 --- scriptingoptions.cpp 11 Jun 2008 01:13:04 -0000 1.53 *************** *** 72,78 **** {"ctrl_z_goes_to_end_of_buffer", false, O(m_bCtrlZGoesToEndOfBuffer)}, {"custom_16_is_default_colour", false, O(m_bCustom16isDefaultColour), 0, 0, OPT_UPDATE_VIEWS}, {"detect_pueblo", true, O(m_bPueblo)}, ! {"do_not_show_outstanding_lines", false, O(m_bDoNotShowOutstandingLines)}, {"disable_compression", false, O(m_bDisableCompression)}, {"display_my_input", true, O(m_display_my_input)}, {"double_click_inserts", false, O(m_bDoubleClickInserts)}, --- 72,79 ---- {"ctrl_z_goes_to_end_of_buffer", false, O(m_bCtrlZGoesToEndOfBuffer)}, {"custom_16_is_default_colour", false, O(m_bCustom16isDefaultColour), 0, 0, OPT_UPDATE_VIEWS}, {"detect_pueblo", true, O(m_bPueblo)}, ! {"do_not_show_outstanding_lines", false, O(m_bDoNotShowOutstandingLines)}, ! {"do_not_translate_iac_to_iac_iac", false, O(m_bDoNotTranslateIACtoIACIAC)}, {"disable_compression", false, O(m_bDisableCompression)}, {"display_my_input", true, O(m_display_my_input)}, {"double_click_inserts", false, O(m_bDoubleClickInserts)}, Index: sendvw.cpp =================================================================== RCS file: /cvs/mushclient/sendvw.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -c -r1.82 -r1.83 *** sendvw.cpp 21 Feb 2008 22:06:01 -0000 1.82 --- sendvw.cpp 11 Jun 2008 01:13:04 -0000 1.83 *************** *** 2501,2506 **** --- 2501,2522 ---- m_topview->OnMXPMenu (nID); } + + // see Josuttis: page 211 + template + class value_equals { + private: + V value; + public: + // constructor + value_equals (const V& v) : value (v) {} + // comparison + bool operator () (pair elem) + { + return elem.second == value; + } + }; + void CSendView::OnAcceleratorCommand (UINT nID) { CMUSHclientDoc* pDoc = GetDocument(); *************** *** 2520,2526 **** pDoc->m_iCurrentActionSource = eUserAccelerator; ! SendCommand (sCommand.c_str (), TRUE, FALSE); // save previous, don't keep in history pDoc->m_iCurrentActionSource = eUnknownActionSource; --- 2536,2579 ---- pDoc->m_iCurrentActionSource = eUserAccelerator; ! // for backwards compatability, call the same thing as before ! if (pDoc->m_CommandToSendToMap [nID] == eSendToExecute) ! SendCommand (sCommand.c_str (), TRUE, FALSE); // save previous, don't keep in history ! else ! { ! ! // new in 4.27 - allow sending to other places ! ! // I want to find the accelerator key name - need a linear search unfortunately ! // need to iterate over the command map, looking for a match on the ID we got ! map::const_iterator it; ! it = find_if (pDoc->m_AcceleratorToCommandMap.begin (), ! pDoc->m_AcceleratorToCommandMap.end (), ! value_equals(nID)); ! ! CString key = "unknown key"; // in case not found ! if (it != pDoc->m_AcceleratorToCommandMap.end ()) ! key = KeyCodeToString (it->first >> 16, it->first); ! ! CString strExtraOutput; ! pDoc->m_iCurrentActionSource = eUserAccelerator; ! ! // ok let's do it now ! pDoc->SendTo (pDoc->m_CommandToSendToMap [nID], ! sCommand.c_str (), ! TRUE, // omit from output ! TRUE, // omit from log ! TFormat ("Accelerator: %s", (LPCTSTR) key), ! "", // Variable name ! strExtraOutput // if we sent to output, it goes here ! ); ! ! // display any stuff sent to output window ! ! if (!strExtraOutput.IsEmpty ()) ! pDoc->DisplayMsg (strExtraOutput, strExtraOutput.GetLength (), COMMENT); ! ! } pDoc->m_iCurrentActionSource = eUnknownActionSource; Index: stdafx.h =================================================================== RCS file: /cvs/mushclient/stdafx.h,v retrieving revision 1.105 retrieving revision 1.106 diff -c -r1.105 -r1.106 *** stdafx.h 3 Jun 2008 03:50:03 -0000 1.105 --- stdafx.h 11 Jun 2008 01:13:04 -0000 1.106 *************** *** 822,824 **** --- 822,827 ---- #define ALIASES_USE_UTF8 0 + #define IsCTRLpressed() ( (GetKeyState(VK_CONTROL) & (1 << (sizeof(SHORT)*8-1))) != 0 ) + #define IsSHIFTpressed() ( (GetKeyState(VK_SHIFT) & (1 << (sizeof(SHORT)*8-1))) != 0 ) + Index: install/mushclient.nsi =================================================================== RCS file: /cvs/mushclient/install/mushclient.nsi,v retrieving revision 1.56 retrieving revision 1.58 diff -c -r1.56 -r1.58 *** install/mushclient.nsi 27 May 2008 01:51:41 -0000 1.56 --- install/mushclient.nsi 11 Jun 2008 03:45:17 -0000 1.58 *************** *** 85,90 **** --- 85,91 ---- File "Readme.txt" ; in install directory File "..\WinRel\mushclient.exe" + File "..\StatusBar.exe" File "..\WinRel\lua5.1.dll" File "..\..\lua51_dll\Release\lua5.1.lib" File "..\mushclient.HLP" *************** *** 155,160 **** --- 156,199 ---- SetOutPath $INSTDIR + ; + ; directory for name generation files + ; + CreateDirectory "$INSTDIR\names" + SetOutPath $INSTDIR\names + + File "..\names\ALBION.NAM" + File "..\names\ALVER.NAM" + File "..\names\ALVER1.NAM" + File "..\names\ALVER2.NAM" + File "..\names\DEVERRY1.NAM" + File "..\names\DEVERRY2.NAM" + File "..\names\DVARGAR.NAM" + File "..\names\Dragonl1.nam" + File "..\names\Felana.nam" + File "..\names\GALLER.NAM" + File "..\names\HOBER.NAM" + File "..\names\MALL.NAM" + File "..\names\ORC1.NAM" + File "..\names\ORC2.NAM" + File "..\names\albion1.nam" + File "..\names\albion2.nam" + File "..\names\dvargar1.nam" + File "..\names\dvargar2.nam" + File "..\names\f_female.nam" + File "..\names\f_male.nam" + File "..\names\gnome1.nam" + File "..\names\gnome2.nam" + File "..\names\hober1.nam" + File "..\names\hober2.nam" + File "..\names\kender1.nam" + File "..\names\kender2.nam" + File "..\names\kerrel.nam" + File "..\names\orc.nam" + File "..\names\sparhawk.nam" + + SetOutPath $INSTDIR + SectionEnd Section "Spell checker" *************** *** 348,353 **** --- 387,393 ---- ; program Delete "$INSTDIR\MUSHclient.exe" + Delete "$INSTDIR\StatusBar.exe" Delete "$INSTDIR\lua5.1.dll" Delete "$INSTDIR\lua5.1.lib" Delete "$INSTDIR\MUSHclient.ico" *************** *** 464,469 **** --- 504,541 ---- Delete "$INSTDIR\locale\detect_locale_changes.lua" Delete "$INSTDIR\locale\locale_notes.txt" + ; names files + + Delete "$INSTDIR\names\ALBION.NAM" + Delete "$INSTDIR\names\ALVER.NAM" + Delete "$INSTDIR\names\ALVER1.NAM" + Delete "$INSTDIR\names\ALVER2.NAM" + Delete "$INSTDIR\names\DEVERRY1.NAM" + Delete "$INSTDIR\names\DEVERRY2.NAM" + Delete "$INSTDIR\names\DVARGAR.NAM" + Delete "$INSTDIR\names\Dragonl1.nam" + Delete "$INSTDIR\names\Felana.nam" + Delete "$INSTDIR\names\GALLER.NAM" + Delete "$INSTDIR\names\HOBER.NAM" + Delete "$INSTDIR\names\MALL.NAM" + Delete "$INSTDIR\names\ORC1.NAM" + Delete "$INSTDIR\names\ORC2.NAM" + Delete "$INSTDIR\names\albion1.nam" + Delete "$INSTDIR\names\albion2.nam" + Delete "$INSTDIR\names\dvargar1.nam" + Delete "$INSTDIR\names\dvargar2.nam" + Delete "$INSTDIR\names\f_female.nam" + Delete "$INSTDIR\names\f_male.nam" + Delete "$INSTDIR\names\gnome1.nam" + Delete "$INSTDIR\names\gnome2.nam" + Delete "$INSTDIR\names\hober1.nam" + Delete "$INSTDIR\names\hober2.nam" + Delete "$INSTDIR\names\kender1.nam" + Delete "$INSTDIR\names\kender2.nam" + Delete "$INSTDIR\names\kerrel.nam" + Delete "$INSTDIR\names\orc.nam" + Delete "$INSTDIR\names\sparhawk.nam" + ; MUST REMOVE UNINSTALLER, too Delete $INSTDIR\uninstall.exe Index: install/readme.txt =================================================================== RCS file: /cvs/mushclient/install/readme.txt,v retrieving revision 1.165 retrieving revision 1.166 diff -c -r1.165 -r1.166 *** install/readme.txt 3 Jun 2008 03:50:03 -0000 1.165 --- install/readme.txt 11 Jun 2008 01:13:04 -0000 1.166 *************** *** 1,7 **** ! MUSHclient version 4.26 ======================= ! Tuesday, 3rd June 2008 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ --- 1,7 ---- ! MUSHclient version 4.27 ======================= ! Wednesday, 11th June 2008 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ Index: lua/tprint.lua =================================================================== RCS file: /cvs/mushclient/lua/tprint.lua,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** lua/tprint.lua 7 Sep 2006 07:46:11 -0000 1.2 --- lua/tprint.lua 11 Jun 2008 01:13:04 -0000 1.3 *************** *** 16,21 **** --- 16,25 ---- --]] function tprint (t, indent, done) + -- in case we run it standalone + local Note = Note or print + local Tell = Tell or io.write + -- show strings differently to distinguish them from numbers local function show (val) if type (val) == "string" then