Exemplo n.º 1
0
BOOL CScriptEdit::OnHelpInfo(HELPINFO* /*pHelpInfo*/) 
{
  CString tmpstr;
  CString helpstr;
  compiler_data compiler_data;

  tmpstr=m_text_control.GetSelText();
  tmpstr.MakeLower();
  tmpstr.TrimLeft();
  tmpstr.TrimRight();
	if(action_data.Lookup(tmpstr,compiler_data) )
  {
    helpstr.Format("%s(%s)",compiler_data.keyword,format_parameters(compiler_data));
    MessageBox(helpstr,"Script Action", MB_ICONINFORMATION|MB_OK);
    return false;
  }
  if(trigger_data.Lookup(tmpstr,compiler_data) )
  {
    helpstr.Format("%s(%s)",compiler_data.keyword,format_parameters(compiler_data));
    MessageBox(helpstr,"Script Trigger", MB_ICONINFORMATION|MB_OK);
    return false;
  }
  int tmp = IDSKey("OBJECT",tmpstr);
  if (tmp!=-1)
  {
    helpstr.Format("%s=%d", tmpstr, tmp);
    MessageBox(helpstr,"Script Object", MB_ICONINFORMATION|MB_OK);
    return false;
  }

  tmp = IDSKey("SPELL", tmpstr);
  if (tmp!=-1)
  {
    helpstr.Format("%s=%s", tmpstr, format_spell_id(tmp));
    MessageBox(helpstr,"Spell", MB_ICONINFORMATION|MB_OK);
    return false;
  }
	return false;	
}
Exemplo n.º 2
0
      static std::string format(const std::string &t_why, 
          const std::vector<Boxed_Value> &t_parameters, 
          bool t_dot_notation,
          const chaiscript::detail::Dispatch_Engine &t_ss)
      {
        std::stringstream ss;

        ss << format_why(t_why);
        ss << " ";

        ss << "With parameters: " << format_parameters(t_parameters, t_dot_notation, t_ss);
        ss << " ";

        return ss.str();
      }