mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-04-19 08:58:56 +00:00
Setup language definition based on the keywords file.
Although, seems like those files are not in the base game?
This commit is contained in:
parent
e8d48cc6e0
commit
a1a9f61330
2 changed files with 25 additions and 23 deletions
|
@ -321,6 +321,31 @@ void SyntaxRichEditCtrl::SetKeyWords( const keyWord_t kws[] ) {
|
|||
}
|
||||
keyWordHash.Add( hash, i );
|
||||
}
|
||||
|
||||
TextEditor::LanguageDefinition langDef;
|
||||
|
||||
for ( i = 0; i < numKeyWords; i++ ) {
|
||||
if ( keyWords[i].description != '\0' ) {
|
||||
TextEditor::Identifier id;
|
||||
id.mDeclaration = keyWords[i].description;
|
||||
langDef.mIdentifiers.insert( std::make_pair( std::string( keyWords[i].keyWord ), id ) );
|
||||
} else {
|
||||
langDef.mKeywords.insert( std::string( keyWords[i].keyWord ) );
|
||||
}
|
||||
}
|
||||
|
||||
langDef.mTokenize = TextEditor::LanguageDefinition::C().mTokenize;
|
||||
|
||||
langDef.mCommentStart = "/*";
|
||||
langDef.mCommentEnd = "*/";
|
||||
langDef.mSingleLineComment = "//";
|
||||
|
||||
langDef.mCaseSensitive = caseSensitive;
|
||||
langDef.mAutoIndentation = true;
|
||||
|
||||
langDef.mName = "doomscript"; // TODO: change?
|
||||
|
||||
scriptEdit->SetLanguageDefinition( langDef );
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -588,28 +613,6 @@ void SyntaxRichEditCtrl::SetColor( int startCharIndex, int endCharIndex, const i
|
|||
updateSyntaxHighlighting = true;*/
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
SyntaxRichEditCtrl::GetForeColor
|
||||
================
|
||||
*/
|
||||
idVec3 SyntaxRichEditCtrl::GetForeColor( int charIndex ) const {
|
||||
/*tom::ITextRange* range;
|
||||
tom::ITextFont *font;
|
||||
long foreColor;
|
||||
|
||||
m_TextDoc->Range( charIndex, charIndex, &range );
|
||||
range->get_Font( &font );
|
||||
|
||||
font->get_BackColor( &foreColor );
|
||||
|
||||
font->Release();
|
||||
range->Release();
|
||||
|
||||
return foreColor;*/
|
||||
return vec3_origin;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
SyntaxRichEditCtrl::GetBackColor
|
||||
|
|
|
@ -112,7 +112,6 @@ public:
|
|||
void SetStringColor( const idVec3 &color, const idVec3 &altColor = vec3_origin );
|
||||
void SetLiteralColor( const idVec3 &color );
|
||||
|
||||
idVec3 GetForeColor( int charIndex ) const;
|
||||
idVec3 GetBackColor( int charIndex ) const;
|
||||
|
||||
void GetCursorPos( int &line, int &column, int &character ) const;
|
||||
|
|
Loading…
Reference in a new issue