Merged in GZDB r2499.

This commit is contained in:
MascaraSnake 2016-04-07 22:54:11 +02:00
parent 3e0adfbc4e
commit 2dba78a3d2
18 changed files with 359 additions and 173 deletions

View file

@ -602,6 +602,43 @@ zdoom
id = "Line_Mirror";
requiresactivation = false;
}
156
{
title = "Line Set Portal";
id = "Line_SetPortal";
requiresactivation = false;
arg0
{
title = "Exit Line Tag";
tooltip = "The tag number of the line that will act as the \"exit\" of the current portal";
type = 15;
}
arg2
{
title = "Portal Type";
type = 11;
enum
{
0 = "Visual only";
1 = "Visual + simple teleporter";
2 = "Interactive";
3 = "Static (Eternity style)";
}
}
arg3
{
title = "Plane Align";
tooltip = "Determines how the planes at the other side of the portal are relative to this line";
type = 11;
enum
{
0 = "None";
1 = "Floors";
2 = "Ceilings";
}
}
}
}
door
@ -4097,6 +4134,18 @@ zdoom
hexen
{
line
{
156 // Line_SetPortal
{
arg1
{
title = "This Line Tag";
tooltip = "The tag number of the current line";
type = 15;
}
}
}
polyobj
{
1 // Polyobj Start Line

View file

@ -66,11 +66,8 @@ keywords
//BlueScore = "BlueScore()";
//BlueTeamCount = "BlueTeamCount()";
//BlueTeamScore = "BlueTeamScore()";
bool = "Bool expression";
break = "Break";
CancelFade = "void CancelFade(void)\nIf either FadeTo or FadeRange is currently in progress,\nCancelFade stops it and turns off the palette flash.";
CanRaiseActor = "bool CanRaiseActor(int tid)\nChecks to see if the actor or actors with the specified tid are viable for resurrection.\nIf tid is 0, the check is done on the activator of the script.";
case = "Case expression";
Ceiling_CrushAndRaise = "Ceiling_CrushAndRaise(tag, speed, crush, crushmode)";
Ceiling_CrushAndRaiseA = "Ceiling_CrushAndRaiseA(tag, dspeed, uspeed, crush, crushmode)";
Ceiling_CrushAndRaiseDist = "Ceiling_CrushAndRaiseDist(tag, dist, speed, damage, crushmode)";
@ -120,16 +117,10 @@ keywords
ClearInventory = "void ClearInventory(void)\nClears the player's inventory of weapons, ammo, armor and usable items.";
ClearLineSpecial = "void ClearLineSpecial(void)\nClears the special of the line that activated the script.";
//ConsoleCommand = "void ConsoleCommand(str command)";
const = "const";
continue = "continue";
Cos = "fixed Cos(int angle)";
CreateTranslation = "void CreateTranslation(int transnumber, a:b=c:d, ...)";
DamageThing = "DamageThing(amount, mod)";
DEATH = "Script expression Death";
default = "default:";
Delay = "void Delay(int tics)";
DISCONNECT = "Script expression Disconnect";
do = "do";
Door_Animated = "Door_Animated(tag, speed, delay, lock)";
Door_Close = "Door_Close(tag, speed, lighttag)";
Door_CloseWaitOpen = "Door_CloseWaitOpen(tag, speed, delay, lighttag)";
@ -141,8 +132,6 @@ keywords
Elevator_LowerToNearest = "Elevator_LowerToNearest(tag, speed)";
Elevator_MoveToFloor = "Elevator_MoveToFloor(tag, speed)";
Elevator_RaiseToNearest = "Elevator_RaiseToNearest(tag, speed)";
else = "Else";
ENTER = "Script expression Enter";
Exit_Normal = "Exit_Normal(pos)";
Exit_Secret = "Exit_Secret(pos)";
FadeRange = "void FadeRange(int red1, int green1, int blue1, fixed amount1, int red2, int green2, int blue2, fixed amount2, fixed seconds)\nSets the current flash to the first color set and then fades it to the second color set over the specified number of seconds.";
@ -177,10 +166,8 @@ keywords
FloorAndCeiling_LowerByValue = "FloorAndCeiling_LowerByValue(tag, speed, height)";
FloorAndCeiling_LowerRaise = "FloorAndCeiling_LowerRaise(tag, fspeed, cspeed, boomemu)";
FloorAndCeiling_RaiseByValue = "FloorAndCeiling_RaiseByValue(tag, speed, height)";
for = "for(initialization; condition; iteration)";
ForceField = "ForceField(void)";
FS_Execute = "FS_Execute(script, side, keynum, message)";
function = "function void expression(void)";
GameSkill = "int GameSkill(void)";
GameType = "int GameType(void)";
Generic_Ceiling = "Generic_Ceiling(tag, speed, height, target, flag)";
@ -245,12 +232,9 @@ keywords
GiveActorInventory = "void GiveActorInventory(int tid, str inventory_item, int amount)\nThis function will give the amount of items to the specifed actor.\nThis function does not treat tid 0 as the activator of the script";
GiveInventory = "void GiveInventory(str inventory_item, int amount)\nThis function will give the number of items specified to the activator.";
GlassBreak = "GlassBreak(dontspawnjunk)";
Global = "Global Int expression:identifier";
HealThing = "HealThing(amount)";
HudMessage = "void hudmessage(s:text; int type, int id, int color, fixed x, fixed y, fixed holdTime)";
HudMessageBold = "void HudMessageBold(s:text; int type, int id, int color, fixed x, fixed y, fixed holdTime)";
if = "if(expression)";
int = "int expression";
//IsMultiplayer = "int IsMultiplayer(void)";
//IsOneFlagCTF = "int IsOneFlagCTF(void)";
IsPointerEqual = "bool IsPointerEqual(int ptr_select1, int ptr_select2[, int tid1[, int tid2]])";
@ -267,7 +251,6 @@ keywords
Light_Stop = "Light_Stop(tag)";
Light_Strobe = "Light_Strobe(tag, upper, lower, u-tics, l-tics)";
Light_StrobeDoom = "Light_StrobeDoom(tag, u-tics, l-tics)";
LIGHTNING = "Script expression Lightning";
LineAttack = "LineAttack(int tid, fixed angle, fixed pitch, int damage[, str pufftype = 'BulletPuff'[, str damagetype = 'None'[, fixed range = 2048[, int flags = 0[, int pufftid = 0]]]]])\nFires a hitscan attack. If tid is 0, the activator of the script is the source of the attack.";
Line_AlignCeiling = "Line_AlignCeiling(lineid, side)";
Line_AlignFloor = "Line_AlignFloor(lineid, side)";
@ -280,9 +263,7 @@ keywords
Log = "void Log(type:expression)\nLog will print something in the log area of the screen (top left), as well as logging it to the console.\nIt uses the same parameter format as the Print function.";
MorphActor = "int MorphActor(int tid, [str playerclass, [str monsterclass, [int duration, [int style, [str morphflash, [str unmorphflash]]]]]])";
NamedScriptWait = "void NamedScriptWait(str script)";
NET = "Script expression Net";
NoiseAlert = "NoiseAlert(target_tid, emiter_tid)";
OPEN = "Script expression Open";
PickActor = "bool PickActor(int source_tid, fixed angle, fixed pitch, fixed distance, int tid[, int actorMask = MF_SHOOTABLE[, int wallMask = ML_BLOCKEVERYTHING | ML_BLOCKHITSCAN[, bool forcetid = false]]])";
//PICKUP = "Script expression Pickup";
Pillar_Build = "Pillar_Build(tag, speed, height)";
@ -331,10 +312,6 @@ keywords
Radius_Quake2 = "void Radius_Quake2(int tid, int intensity, int duration, int damrad, int tremrad, str sound)";
Random = "int Random(int min, int max)";
ReplaceTextures = "void ReplaceTextures(str oldtexturename, str newtexturename[, int flags])\nReplaces all occurences of oldtexturename with newtexturename.\nNOT_ flags can be used.";
RESPAWN = "Script expression Respawn";
Restart = "Restart";
return = "Return";
script = "Script expression";
ScriptWait = "void ScriptWait(int script)";
Scroll_Ceiling = "Scroll_Ceiling(tag, x-move, y-move, unused)";
Scroll_Floor = "Scroll_Floor(tag, x-move, y-move, type)";
@ -431,7 +408,6 @@ keywords
Stairs_BuildUpSync = "Stairs_BuildUpSync(tag, speed, height, reset)";
StartConversation = "StartConversation(talker_tid, facetalker)";
StopSound = "void StopSound(int tid, int channel)\nStops the sound currently playing on the specified channel for the actor with matching tid";
str = "str expression";
StrCmp = "int StrCmp(str string1, str string2[, int maxcomparenum])\nCompares the two strings passed in arguments string1 and string2 character by character.\nIf maxcomparenum is specified, it only compares up to maxcomparenum characters of each string.";
StrCpy = "bool StrCpy(a:destination, str source[, int source_index])\nCopy a source string to a destination array as a series of characters.\nOptionally, the copy can start from a given index in the source string.\nReturns TRUE if the entire string (or substring) was successfully copied to the array;\nFALSE if the copy ran out of room or if a negative source_index was given.";
StrIcmp = "int StrCmp(str string1, str string2[, int maxcomparenum])\nStrIcmp is case-insensitive version of StrCmp";
@ -440,9 +416,7 @@ keywords
StrMid = "str StrMid(str string, int start, int length)\nCreates a new string containing the length characters of string starting from the one at position start.\nIf string does not exist or is shorter than start characters, an empty string is returned. \nIf string is shorter than start + length characters, the entire substring beginning at start is returned.";
StrParam = "int StrParam(type:expression)\nStrParam will create a new string formatted based upon the same method for Print or Log.\nThe return value is the string table index of the new string.";
StrRight = "str StrRight(str string, int length)\nCreates a new string containing the length last characters of string.\nIf string does not exist, an empty string is returned.\nIf string is shorter than length characters, the entire string is returned.";
Suspend = "Suspend";
SwapActorTeleFog = "int SwapActorTeleFog(int tid)";
switch = "Switch(expression)";
TagWait = "void TagWait(int tag)";
TakeActorInventory = "void TakeActorInventory(int tid, str inventory_item, int amount)\nThis function will take the amount of items from the specified actor.\nTakeActorInventory can remove items that are flagged as undroppable.";
TakeInventory = "void TakeInventory(str inventory_item, int amount)\nThis function will take the number of items specified from the activator.\nTakeInventory can remove items that are flagged as undroppable.";
@ -455,7 +429,6 @@ keywords
TeleportGroup = "TeleportGroup(groupid, sourceid, destinationid, movesource, fog)";
TeleportInSector = "TeleportInSector(tag, sourceid, destinationid, fog, groupid)";
TeleportOther = "TeleportOther(tid, destinationid, fog)";
Terminate = "Terminate";
Thing_Activate = "Thing_Activate(tid)";
Thing_ChangeTID = "Thing_ChangeTID(oldtid, newtid)";
Thing_Damage = "Thing_Damage(tid, amount, mod)";
@ -489,19 +462,50 @@ keywords
Timer = "int Timer(void)";
TranslucentLine = "TranslucentLine(lineid, amount, additive, moreflags)";
UniqueTID = "int UniqueTID([int tid[, int limit]])";
UNLOADING = "Script expression Unloading";
UnMorphActor = "int UnMorphActor(int tid[, bool force])";
until = "Until(expression)";
UseActorInventory = "int UseActorInventory(int tid, str classname)\nForces the actor(s) with the specified tid to use an item from their inventory, if they have one.\nReturns TRUE if the item was used successfully.";
UseInventory = "int UseInventory(str classname)\nForces the activator to use the specified inventory item, if he has it.\nReturns TRUE if the item was used successfully.";
UsePuzzleItem = "UsePuzzleItem(item, script, arg1, arg2, arg3)";
VectorAngle = "fixed VectorAngle(int x, int y)";
VectorLength = "int VectorLength(int x, int y)";
void = "void";
Warp = "bool Warp(int destinationtid, fixed xofs, fixed yofs, fixed zofs, int angle, int flags[, str success_state[, bool exactstate[, fixed heightoffset]]])";
while = "while(expression)";
//WHITERETURN = "Script expression WhiteReturn";
world = "World Int expression:identifier";
}
properties
{
bool;
break;
case;
const;
continue;
DEATH;
default;
DISCONNECT;
do;
else;
ENTER;
for;
function;
global;
if;
int;
LIGHTNING;
NET;
OPEN;
RESPAWN;
Restart;
return;
script;
str;
Suspend;
switch;
Terminate;
UNLOADING;
until;
void;
while;
world;
}
constants

View file

@ -17,6 +17,7 @@ arrayopen = "[";
arrayclose = "]";
argumentdelimiter = ",";
terminator = ";";
extrawordchars = "#."; // Extra characters to be treated as a part of a word by the Script Editor
keywordhelp = "http://www.zdoom.org/wiki/index.php?title=%K";
scripttype = 3; //0 = unknown script, 1 = acc, 2 = modeldef, 3 = decorate
@ -359,9 +360,19 @@ keywords
IsPointerEqual = "bool IsPointerEqual(int ptr_select1, int ptr_select2)";
}
constants
properties
{
Actor;
//WFDS
if;
else;
return;
//Flow control
Loop;
Stop;
Wait;
Fail;
goto;
//states:
States;
Spawn:;
@ -372,6 +383,7 @@ constants
Pain:;
Pain.Dagger:;
Death:;
Death.Extreme:;
XDeath:;
Burn:;
Ice:;
@ -409,12 +421,6 @@ constants
User2:;
User3:;
User4:;
//flow control
loop;
stop;
wait;
fail;
goto;
////////////////////
//ACTOR PROPERTIES
////////////////////
@ -500,11 +506,7 @@ constants
MaxTargetRange;
PainType;
//Special
Args[0];
Args[1];
Args[2];
Args[3];
Args[4];
Args;
ClearFlags;
DropItem;
Skip_Super;
@ -623,7 +625,6 @@ constants
MorphProjectile.MorphStyle;
MorphProjectile.MorphFlash;
MorphProjectile.UnMorphFlash;
//Actor position and movement
x;
y;
@ -641,9 +642,10 @@ constants
Score;
Special;
Stamina;
////////
//FLAGS
////////
}
constants
{
//pointers
AAPTR_DEFAULT;
AAPTR_NULL;

View file

@ -278,8 +278,8 @@ colors
color15 = -16777216;
color16 = -16744448;
color17 = -16741493;
color18 = -16776961;
color19 = -16744256;
color18 = -16776999;
color19 = -8372160;
color20 = -9868951;
color21 = -12490271;
color22 = -14513374;
@ -315,8 +315,9 @@ colors
color52 = -8355712;
color53 = -1;
color54 = -13395457;
color55 = -6089451;
color55 = -8388608;
color56 = -9868951;
color59 = -16752191;
}

View file

@ -1159,6 +1159,7 @@
<None Include="Resources\ModelDisabled.png" />
<None Include="Resources\ModelFiltered.png" />
<Content Include="Resources\Model_selected.png" />
<None Include="Resources\ScriptProperty.png" />
<None Include="Resources\TextWhitespace.png" />
<None Include="Resources\TextIndent.png" />
<None Include="Resources\TextUnindent.png" />

View file

@ -76,7 +76,9 @@ namespace CodeImp.DoomBuilder.Config
private readonly List<string> keywordkeyssorted; //mxd
private readonly List<string> constants;
private readonly Dictionary<string, string> lowerconstants;
private readonly Dictionary<string, string[]> snippets; //mxd
private readonly List<string> properties; //mxd
private readonly Dictionary<string, string> lowerproperties; //mxd
private readonly Dictionary<string, string[]> snippets; //mxd
private readonly HashSet<string> snippetkeyssorted; //mxd
private readonly HashSet<char> braces; //mxd
@ -110,8 +112,9 @@ namespace CodeImp.DoomBuilder.Config
// Collections
public ICollection<string> Keywords { get { return keywordkeyssorted; } }
public ICollection<string> Properties { get { return properties; } } //mxd
public ICollection<string> Constants { get { return constants; } }
public ICollection<string> Snippets { get { return snippetkeyssorted; } }
public ICollection<string> Snippets { get { return snippetkeyssorted; } } //mxd
public HashSet<char> BraceChars { get { return braces; } } //mxd
#endregion
@ -125,8 +128,10 @@ namespace CodeImp.DoomBuilder.Config
// Initialize
this.keywords = new Dictionary<string, string>(StringComparer.Ordinal);
this.constants = new List<string>();
this.lowerkeywords = new Dictionary<string, string>(StringComparer.Ordinal);
this.properties = new List<string>(); //mxd
this.lowerkeywords = new Dictionary<string, string>(StringComparer.Ordinal);
this.lowerconstants = new Dictionary<string, string>(StringComparer.Ordinal);
this.lowerproperties = new Dictionary<string, string>(StringComparer.Ordinal); //mxd
this.keywordkeyssorted = new List<string>(); //mxd
this.snippets = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase); //mxd
this.snippetkeyssorted = new HashSet<string>(); //mxd
@ -160,8 +165,10 @@ namespace CodeImp.DoomBuilder.Config
// Initialize
this.keywords = new Dictionary<string, string>(StringComparer.Ordinal);
this.constants = new List<string>();
this.lowerkeywords = new Dictionary<string, string>(StringComparer.Ordinal);
this.properties = new List<string>(); //mxd
this.lowerkeywords = new Dictionary<string, string>(StringComparer.Ordinal);
this.lowerconstants = new Dictionary<string, string>(StringComparer.Ordinal);
this.lowerproperties = new Dictionary<string, string>(StringComparer.Ordinal); //mxd
this.keywordkeyssorted = new List<string>(); //mxd
this.snippets = new Dictionary<string, string[]>(StringComparer.OrdinalIgnoreCase); //mxd
this.snippetkeyssorted = new HashSet<string>(); //mxd
@ -204,21 +211,53 @@ namespace CodeImp.DoomBuilder.Config
IDictionary dic = cfg.ReadSetting("keywords", new Hashtable());
foreach(DictionaryEntry de in dic)
{
keywords.Add(de.Key.ToString(), de.Value.ToString());
lowerkeywords.Add(de.Key.ToString().ToLowerInvariant(), de.Key.ToString());
keywordkeyssorted.Add(de.Key.ToString()); //mxd
string keyword = de.Key.ToString();
if(keywords.ContainsKey(keyword)) //mxd
{
General.ErrorLogger.Add(ErrorType.Warning, "Keyword \"" + keyword + "\" is double-defined in \"" + description + "\" script configuration.");
continue;
}
keywords[keyword] = de.Value.ToString();
lowerkeywords[keyword.ToLowerInvariant()] = keyword;
keywordkeyssorted.Add(keyword); //mxd
}
//mxd. Sort keywords lookup
keywordkeyssorted.Sort();
//mxd. Load properties
dic = cfg.ReadSetting("properties", new Hashtable());
foreach (DictionaryEntry de in dic)
{
string property = de.Key.ToString();
if (lowerproperties.ContainsValue(property)) //mxd
{
General.ErrorLogger.Add(ErrorType.Warning, "Property \"" + property + "\" is double-defined in \"" + description + "\" script configuration.");
continue;
}
properties.Add(property);
lowerproperties[property.ToLowerInvariant()] = property;
}
//mxd
properties.Sort();
// Load constants
dic = cfg.ReadSetting("constants", new Hashtable());
foreach(DictionaryEntry de in dic)
{
constants.Add(de.Key.ToString());
lowerconstants.Add(de.Key.ToString().ToLowerInvariant(), de.Key.ToString());
}
string constant = de.Key.ToString();
if (lowerconstants.ContainsValue(constant)) //mxd
{
General.ErrorLogger.Add(ErrorType.Warning, "Constant \"" + constant + "\" is double-defined in \"" + description + "\" script configuration.");
continue;
}
constants.Add(constant);
lowerconstants[constant.ToLowerInvariant()] = constant;
}
//mxd
constants.Sort();

View file

@ -33,28 +33,34 @@ namespace CodeImp.DoomBuilder.Controls
this.button = new System.Windows.Forms.Button();
this.dialog = new System.Windows.Forms.ColorDialog();
this.SuspendLayout();
//
// label
//
this.label.Location = new System.Drawing.Point(-3, 0);
//
// label
//
this.label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.label.Location = new System.Drawing.Point(-3, 0);
this.label.Name = "label";
this.label.Size = new System.Drawing.Size(175, 23);
this.label.TabIndex = 0;
this.label.Text = "Color name:";
this.label.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// panel
//
this.panel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
//
// panel
//
this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.panel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
this.panel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel.Location = new System.Drawing.Point(178, 0);
this.panel.Name = "panel";
this.panel.Size = new System.Drawing.Size(27, 23);
this.panel.TabIndex = 1;
//
// button
//
this.button.BackColor = System.Drawing.SystemColors.Control;
//
// button
//
this.button.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.button.BackColor = System.Drawing.SystemColors.Control;
this.button.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.button.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.button.Image = global::CodeImp.DoomBuilder.Properties.Resources.ColorPick;
@ -81,8 +87,8 @@ namespace CodeImp.DoomBuilder.Controls
this.Controls.Add(this.panel);
this.Controls.Add(this.label);
this.MaximumSize = new System.Drawing.Size(10000, 23);
this.MinimumSize = new System.Drawing.Size(100, 23);
this.Name = "ColorControl";
this.MinimumSize = new System.Drawing.Size(100, 16);
this.Name = "ColorControl";
this.Size = new System.Drawing.Size(348, 23);
this.Resize += new System.EventHandler(this.ColorControl_Resize);
this.ResumeLayout(false);

View file

@ -110,9 +110,9 @@ namespace CodeImp.DoomBuilder.Controls
}
}
activation.Enabled = (l.Activate != 0); //mxd
activationlabel.Enabled = (l.Activate != 0); //mxd
}
activation.Enabled = (l.Activate != 0 || l.Action != 0); //mxd
activationlabel.Enabled = (l.Activate != 0 || l.Action != 0); //mxd
}
else
{
activation.Visible = false;

View file

@ -45,6 +45,7 @@ namespace CodeImp.DoomBuilder.Controls
LineNumber = 5,
String = 6, //mxd
Include = 7, //mxd
Property = 8, //mxd
}
internal partial class ScriptEditorControl : UserControl
@ -58,6 +59,7 @@ namespace CodeImp.DoomBuilder.Controls
ScriptKeyword = 1,
ScriptError = 2,
ScriptSnippet = 3, //mxd
ScriptProperty = 4, //mxd
}
#endregion
@ -168,6 +170,7 @@ namespace CodeImp.DoomBuilder.Controls
RegisterAutoCompleteImage(ImageIndex.ScriptConstant, Resources.ScriptConstant);
RegisterAutoCompleteImage(ImageIndex.ScriptKeyword, Resources.ScriptKeyword);
RegisterAutoCompleteImage(ImageIndex.ScriptSnippet, Resources.ScriptSnippet); //mxd
RegisterAutoCompleteImage(ImageIndex.ScriptProperty, Resources.ScriptProperty); //mxd
RegisterMarkerImage(ImageIndex.ScriptError, Resources.ScriptError);
//mxd. These key combinations put odd characters in the script. Let's disable them
@ -436,6 +439,7 @@ namespace CodeImp.DoomBuilder.Controls
case ScriptStyleType.Literal: colorindex = ColorCollection.LITERALS; break;
case ScriptStyleType.String: colorindex = ColorCollection.STRINGS; break;
case ScriptStyleType.Include: colorindex = ColorCollection.INCLUDES; break;
case ScriptStyleType.Property: colorindex = ColorCollection.PROPERTIES; break;
default: colorindex = ColorCollection.PLAINTEXT; break;
}
@ -462,6 +466,57 @@ namespace CodeImp.DoomBuilder.Controls
scriptedit.SetKeywords(keywordsindex, (scriptconfig.CaseSensitive ? words : words.ToLowerInvariant()));
}
//mxd. Create the properties list and apply it
imageindex = ((int)ImageIndex.ScriptProperty).ToString(CultureInfo.InvariantCulture);
int propertiesindex = lexercfg.ReadSetting(lexername + ".propertiesindex", -1);
if (propertiesindex > -1)
{
StringBuilder propertieslist = new StringBuilder("");
HashSet<string> addedprops = new HashSet<string>();
char[] dot = new[] { '.' };
foreach (string p in scriptconfig.Properties)
{
if (propertieslist.Length > 0) propertieslist.Append(" ");
// Scintilla doesn't highlight keywords with '.' or ':', so get rid of those
if (scriptconfig.ScriptType == ScriptType.DECORATE)
{
string prop = p;
if (prop.Contains(":")) prop = prop.Replace(":", string.Empty);
if (prop.Contains("."))
{
// Split dotted properties into separate entries
string[] parts = prop.Split(dot, StringSplitOptions.RemoveEmptyEntries);
List<string> result = new List<string>();
foreach (string part in parts)
{
if (!addedprops.Contains(part))
{
result.Add(part);
addedprops.Add(part);
}
}
if (result.Count > 0) propertieslist.Append(string.Join(" ", result.ToArray()));
}
else
{
addedprops.Add(prop);
propertieslist.Append(prop);
}
}
else
{
propertieslist.Append(p);
}
// Autocomplete doesn't mind '.' or ':'
autocompletedict[p.ToUpperInvariant()] = p + "?" + imageindex;
}
string words = propertieslist.ToString();
scriptedit.SetKeywords(propertiesindex, (scriptconfig.CaseSensitive ? words : words.ToLowerInvariant()));
}
// Create the constants list and apply it
imageindex = ((int)ImageIndex.ScriptConstant).ToString(CultureInfo.InvariantCulture);
int constantsindex = lexercfg.ReadSetting(lexername + ".constantsindex", -1);

View file

@ -68,7 +68,8 @@ namespace CodeImp.DoomBuilder.Controls
public Color PlainText { set { ApplyStyleColor(ScriptStyleType.PlainText, value); } }
public Color Comments { set { ApplyStyleColor(ScriptStyleType.Comment, value); } }
public Color Keywords { set { ApplyStyleColor(ScriptStyleType.Keyword, value); } }
public Color Literals { set { ApplyStyleColor(ScriptStyleType.Literal, value); } }
public Color Properties { set { ApplyStyleColor(ScriptStyleType.Property, value); } }
public Color Literals { set { ApplyStyleColor(ScriptStyleType.Literal, value); } }
public Color Constants { set { ApplyStyleColor(ScriptStyleType.Constant, value); } }
public Color Strings { set { ApplyStyleColor(ScriptStyleType.String, value); } }
public Color Includes { set { ApplyStyleColor(ScriptStyleType.Include, value); } }
@ -141,16 +142,20 @@ namespace CodeImp.DoomBuilder.Controls
// No text editing beyond this point!
scriptedit.ReadOnly = true;
// Set keywords (0)
const string keywords = "script enter Print int HudMessageBold Thing_ChangeTID";
scriptedit.SetKeywords(0, keywords.ToLowerInvariant());
// Set keywords (0)
const string keywords = "Print HudMessageBold Thing_ChangeTID";
scriptedit.SetKeywords(0, keywords.ToLowerInvariant());
// Set constants (1);
const string constants = "CR_RED";
scriptedit.SetKeywords(1, constants.ToLowerInvariant());
// Set constants (1)
const string constants = "CR_RED";
scriptedit.SetKeywords(1, constants.ToLowerInvariant());
// Reset document slyle
scriptedit.ClearDocumentStyle();
// Set properties (3)
const string properties = "script enter int";
scriptedit.SetKeywords(3, properties.ToLowerInvariant());
// Reset document slyle
scriptedit.ClearDocumentStyle();
scriptedit.StyleResetDefault();
// Create style translation dictionary
@ -169,7 +174,8 @@ namespace CodeImp.DoomBuilder.Controls
{ 37, ScriptStyleType.LineNumber },
{ 6, ScriptStyleType.String },
{ 9, ScriptStyleType.Include },
};
{ 19, ScriptStyleType.Property },
};
// Set the default style and settings
scriptedit.Styles[Style.Default].Font = General.Settings.ScriptFontName;
@ -227,7 +233,8 @@ namespace CodeImp.DoomBuilder.Controls
case ScriptStyleType.Literal: colorindex = ColorCollection.LITERALS; break;
case ScriptStyleType.String: colorindex = ColorCollection.STRINGS; break;
case ScriptStyleType.Include: colorindex = ColorCollection.INCLUDES; break;
default: colorindex = ColorCollection.PLAINTEXT; break;
case ScriptStyleType.Property: colorindex = ColorCollection.PROPERTIES; break;
default: colorindex = ColorCollection.PLAINTEXT; break;
}
scriptedit.Styles[group.Key].ForeColor = General.Colors.Colors[colorindex].ToColor();

View file

@ -1112,6 +1112,13 @@ namespace CodeImp.DoomBuilder.Properties {
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap ScriptProperty {
get {
object obj = ResourceManager.GetObject("ScriptProperty", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].

View file

@ -571,4 +571,7 @@
<data name="ZB16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ZB16.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ScriptProperty" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ScriptProperty.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -37,7 +37,7 @@ namespace CodeImp.DoomBuilder.Rendering
private const float DARK_ADDITION = -0.2f;
// Palette size
private const int NUM_COLORS = 59;
private const int NUM_COLORS = 60;
public const int NUM_THING_COLORS = 20;
public const int THING_COLORS_OFFSET = 20;
@ -101,6 +101,7 @@ namespace CodeImp.DoomBuilder.Rendering
public const int INCLUDES = 56;
public const int SCRIPTFOLDFORE = 57;
public const int SCRIPTFOLDBACK = 58;
public const int PROPERTIES = 59;
#endregion
#region ================== Variables
@ -150,7 +151,8 @@ namespace CodeImp.DoomBuilder.Rendering
public PixelColor PlainText { get { return colors[PLAINTEXT]; } internal set { colors[PLAINTEXT] = value; } }
public PixelColor Comments { get { return colors[COMMENTS]; } internal set { colors[COMMENTS] = value; } }
public PixelColor Keywords { get { return colors[KEYWORDS]; } internal set { colors[KEYWORDS] = value; } }
public PixelColor Literals { get { return colors[LITERALS]; } internal set { colors[LITERALS] = value; } }
public PixelColor Properties { get { return colors[PROPERTIES]; } internal set { colors[PROPERTIES] = value; } }
public PixelColor Literals { get { return colors[LITERALS]; } internal set { colors[LITERALS] = value; } }
public PixelColor Constants { get { return colors[CONSTANTS]; } internal set { colors[CONSTANTS] = value; } }
public PixelColor Strings { get { return colors[STRINGS]; } internal set { colors[STRINGS] = value; } } //mxd
public PixelColor Includes { get { return colors[INCLUDES]; } internal set { colors[INCLUDES] = value; } } //mxd

View file

@ -35,9 +35,11 @@ lexer3 // CPP-style, case-sensitive
37 = 5; // ident guides
6 = 6; // strings
9 = 7; // includes
19 = 8; // Global class -> properties
keywordsindex = 0;
constantsindex = 1;
propertiesindex = 3;
snippetindex = 2;
}
@ -109,8 +111,10 @@ lexer35 // CPP-style, case-insensitive
37 = 5; // ident guides
6 = 6; // strings
9 = 7; // includes
19 = 8; // global class -> properties
keywordsindex = 0;
constantsindex = 1;
propertiesindex = 3;
snippetindex = 2;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

View file

@ -175,6 +175,8 @@ namespace CodeImp.DoomBuilder.Windows
this.label8 = new System.Windows.Forms.Label();
this.scriptfontsize = new System.Windows.Forms.ComboBox();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.label28 = new System.Windows.Forms.Label();
this.scriptcolorpresets = new System.Windows.Forms.ComboBox();
this.colorfoldback = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorfoldfore = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorindicator = new CodeImp.DoomBuilder.Controls.ColorControl();
@ -211,8 +213,7 @@ namespace CodeImp.DoomBuilder.Windows
this.pasteoptions = new CodeImp.DoomBuilder.Controls.PasteOptionsControl();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.browseScreenshotsFolderDialog = new System.Windows.Forms.FolderBrowserDialog();
this.scriptcolorpresets = new System.Windows.Forms.ComboBox();
this.label28 = new System.Windows.Forms.Label();
this.colorproperties = new CodeImp.DoomBuilder.Controls.ColorControl();
label7 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
@ -1946,6 +1947,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox6.Controls.Add(this.colorproperties);
this.groupBox6.Controls.Add(this.label28);
this.groupBox6.Controls.Add(this.scriptcolorpresets);
this.groupBox6.Controls.Add(this.colorfoldback);
@ -1971,16 +1973,38 @@ namespace CodeImp.DoomBuilder.Windows
this.groupBox6.TabIndex = 3;
this.groupBox6.TabStop = false;
this.groupBox6.Text = " Colors ";
//
// label28
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(15, 22);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(40, 13);
this.label28.TabIndex = 40;
this.label28.Text = "Preset:";
//
// scriptcolorpresets
//
this.scriptcolorpresets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.scriptcolorpresets.FormattingEnabled = true;
this.scriptcolorpresets.Items.AddRange(new object[] {
"Use current settings",
"Light theme",
"Dark theme"});
this.scriptcolorpresets.Location = new System.Drawing.Point(61, 18);
this.scriptcolorpresets.Name = "scriptcolorpresets";
this.scriptcolorpresets.Size = new System.Drawing.Size(122, 21);
this.scriptcolorpresets.TabIndex = 39;
this.scriptcolorpresets.SelectedIndexChanged += new System.EventHandler(this.scriptcolorpresets_SelectedIndexChanged);
//
// colorfoldback
//
this.colorfoldback.BackColor = System.Drawing.Color.Transparent;
this.colorfoldback.Label = "Fold BG:";
this.colorfoldback.Location = new System.Drawing.Point(15, 461);
this.colorfoldback.Location = new System.Drawing.Point(15, 457);
this.colorfoldback.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorfoldback.MinimumSize = new System.Drawing.Size(100, 23);
this.colorfoldback.Name = "colorfoldback";
this.colorfoldback.Size = new System.Drawing.Size(168, 23);
this.colorfoldback.Size = new System.Drawing.Size(168, 21);
this.colorfoldback.TabIndex = 16;
this.colorfoldback.ColorChanged += new System.EventHandler(this.colorfoldback_ColorChanged);
//
@ -1988,11 +2012,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorfoldfore.BackColor = System.Drawing.Color.Transparent;
this.colorfoldfore.Label = "Fold:";
this.colorfoldfore.Location = new System.Drawing.Point(15, 435);
this.colorfoldfore.Location = new System.Drawing.Point(15, 433);
this.colorfoldfore.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorfoldfore.MinimumSize = new System.Drawing.Size(100, 23);
this.colorfoldfore.Name = "colorfoldfore";
this.colorfoldfore.Size = new System.Drawing.Size(168, 23);
this.colorfoldfore.Size = new System.Drawing.Size(168, 21);
this.colorfoldfore.TabIndex = 15;
this.colorfoldfore.ColorChanged += new System.EventHandler(this.colorfoldfore_ColorChanged);
//
@ -2000,11 +2023,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorindicator.BackColor = System.Drawing.Color.Transparent;
this.colorindicator.Label = "Matching word:";
this.colorindicator.Location = new System.Drawing.Point(15, 331);
this.colorindicator.Location = new System.Drawing.Point(15, 337);
this.colorindicator.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorindicator.MinimumSize = new System.Drawing.Size(100, 23);
this.colorindicator.Name = "colorindicator";
this.colorindicator.Size = new System.Drawing.Size(168, 23);
this.colorindicator.Size = new System.Drawing.Size(168, 21);
this.colorindicator.TabIndex = 14;
this.colorindicator.ColorChanged += new System.EventHandler(this.colorindicator_ColorChanged);
//
@ -2014,9 +2036,8 @@ namespace CodeImp.DoomBuilder.Windows
this.colorwhitespace.Label = "Whitespace:";
this.colorwhitespace.Location = new System.Drawing.Point(15, 409);
this.colorwhitespace.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorwhitespace.MinimumSize = new System.Drawing.Size(100, 23);
this.colorwhitespace.Name = "colorwhitespace";
this.colorwhitespace.Size = new System.Drawing.Size(168, 23);
this.colorwhitespace.Size = new System.Drawing.Size(168, 21);
this.colorwhitespace.TabIndex = 13;
this.colorwhitespace.ColorChanged += new System.EventHandler(this.colorwhitespace_ColorChanged);
//
@ -2024,11 +2045,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorbracebad.BackColor = System.Drawing.Color.Transparent;
this.colorbracebad.Label = "Mismatching brace:";
this.colorbracebad.Location = new System.Drawing.Point(15, 383);
this.colorbracebad.Location = new System.Drawing.Point(15, 385);
this.colorbracebad.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorbracebad.MinimumSize = new System.Drawing.Size(100, 23);
this.colorbracebad.Name = "colorbracebad";
this.colorbracebad.Size = new System.Drawing.Size(168, 23);
this.colorbracebad.Size = new System.Drawing.Size(168, 21);
this.colorbracebad.TabIndex = 12;
this.colorbracebad.ColorChanged += new System.EventHandler(this.colorbracebad_ColorChanged);
//
@ -2036,11 +2056,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorbrace.BackColor = System.Drawing.Color.Transparent;
this.colorbrace.Label = "Matching brace:";
this.colorbrace.Location = new System.Drawing.Point(15, 357);
this.colorbrace.Location = new System.Drawing.Point(15, 361);
this.colorbrace.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorbrace.MinimumSize = new System.Drawing.Size(100, 23);
this.colorbrace.Name = "colorbrace";
this.colorbrace.Size = new System.Drawing.Size(168, 23);
this.colorbrace.Size = new System.Drawing.Size(168, 21);
this.colorbrace.TabIndex = 11;
this.colorbrace.ColorChanged += new System.EventHandler(this.colorbrace_ColorChanged);
//
@ -2048,11 +2067,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorselectionback.BackColor = System.Drawing.Color.Transparent;
this.colorselectionback.Label = "Selection BG:";
this.colorselectionback.Location = new System.Drawing.Point(15, 305);
this.colorselectionback.Location = new System.Drawing.Point(15, 313);
this.colorselectionback.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorselectionback.MinimumSize = new System.Drawing.Size(100, 23);
this.colorselectionback.Name = "colorselectionback";
this.colorselectionback.Size = new System.Drawing.Size(168, 23);
this.colorselectionback.Size = new System.Drawing.Size(168, 21);
this.colorselectionback.TabIndex = 10;
this.colorselectionback.ColorChanged += new System.EventHandler(this.colorselectionback_ColorChanged);
//
@ -2060,11 +2078,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorselectionfore.BackColor = System.Drawing.Color.Transparent;
this.colorselectionfore.Label = "Selection:";
this.colorselectionfore.Location = new System.Drawing.Point(15, 279);
this.colorselectionfore.Location = new System.Drawing.Point(15, 289);
this.colorselectionfore.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorselectionfore.MinimumSize = new System.Drawing.Size(100, 23);
this.colorselectionfore.Name = "colorselectionfore";
this.colorselectionfore.Size = new System.Drawing.Size(168, 23);
this.colorselectionfore.Size = new System.Drawing.Size(168, 21);
this.colorselectionfore.TabIndex = 9;
this.colorselectionfore.ColorChanged += new System.EventHandler(this.colorselectionfore_ColorChanged);
//
@ -2072,11 +2089,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorincludes.BackColor = System.Drawing.Color.Transparent;
this.colorincludes.Label = "Includes:";
this.colorincludes.Location = new System.Drawing.Point(15, 253);
this.colorincludes.Location = new System.Drawing.Point(15, 265);
this.colorincludes.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorincludes.MinimumSize = new System.Drawing.Size(100, 23);
this.colorincludes.Name = "colorincludes";
this.colorincludes.Size = new System.Drawing.Size(168, 23);
this.colorincludes.Size = new System.Drawing.Size(168, 21);
this.colorincludes.TabIndex = 8;
this.colorincludes.ColorChanged += new System.EventHandler(this.colorincludes_ColorChanged);
//
@ -2084,11 +2100,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorstrings.BackColor = System.Drawing.Color.Transparent;
this.colorstrings.Label = "Strings:";
this.colorstrings.Location = new System.Drawing.Point(15, 175);
this.colorstrings.Location = new System.Drawing.Point(15, 193);
this.colorstrings.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorstrings.MinimumSize = new System.Drawing.Size(100, 23);
this.colorstrings.Name = "colorstrings";
this.colorstrings.Size = new System.Drawing.Size(168, 23);
this.colorstrings.Size = new System.Drawing.Size(168, 21);
this.colorstrings.TabIndex = 7;
this.colorstrings.ColorChanged += new System.EventHandler(this.colorstrings_ColorChanged);
//
@ -2096,11 +2111,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorscriptbackground.BackColor = System.Drawing.Color.Transparent;
this.colorscriptbackground.Label = "Background:";
this.colorscriptbackground.Location = new System.Drawing.Point(15, 45);
this.colorscriptbackground.Location = new System.Drawing.Point(15, 49);
this.colorscriptbackground.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorscriptbackground.MinimumSize = new System.Drawing.Size(100, 23);
this.colorscriptbackground.Name = "colorscriptbackground";
this.colorscriptbackground.Size = new System.Drawing.Size(168, 23);
this.colorscriptbackground.Size = new System.Drawing.Size(168, 21);
this.colorscriptbackground.TabIndex = 0;
this.colorscriptbackground.ColorChanged += new System.EventHandler(this.colorscriptbackground_ColorChanged);
//
@ -2110,9 +2124,8 @@ namespace CodeImp.DoomBuilder.Windows
this.colorplaintext.Label = "Plain text:";
this.colorplaintext.Location = new System.Drawing.Point(15, 97);
this.colorplaintext.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorplaintext.MinimumSize = new System.Drawing.Size(100, 23);
this.colorplaintext.Name = "colorplaintext";
this.colorplaintext.Size = new System.Drawing.Size(168, 23);
this.colorplaintext.Size = new System.Drawing.Size(168, 21);
this.colorplaintext.TabIndex = 2;
this.colorplaintext.ColorChanged += new System.EventHandler(this.colorplaintext_ColorChanged);
//
@ -2120,11 +2133,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorcomments.BackColor = System.Drawing.Color.Transparent;
this.colorcomments.Label = "Comments:";
this.colorcomments.Location = new System.Drawing.Point(15, 123);
this.colorcomments.Location = new System.Drawing.Point(15, 121);
this.colorcomments.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorcomments.MinimumSize = new System.Drawing.Size(100, 23);
this.colorcomments.Name = "colorcomments";
this.colorcomments.Size = new System.Drawing.Size(168, 23);
this.colorcomments.Size = new System.Drawing.Size(168, 21);
this.colorcomments.TabIndex = 3;
this.colorcomments.ColorChanged += new System.EventHandler(this.colorcomments_ColorChanged);
//
@ -2132,23 +2144,21 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorlinenumbers.BackColor = System.Drawing.Color.Transparent;
this.colorlinenumbers.Label = "Line numbers:";
this.colorlinenumbers.Location = new System.Drawing.Point(15, 71);
this.colorlinenumbers.Location = new System.Drawing.Point(15, 73);
this.colorlinenumbers.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorlinenumbers.MinimumSize = new System.Drawing.Size(100, 23);
this.colorlinenumbers.Name = "colorlinenumbers";
this.colorlinenumbers.Size = new System.Drawing.Size(168, 23);
this.colorlinenumbers.Size = new System.Drawing.Size(168, 21);
this.colorlinenumbers.TabIndex = 1;
this.colorlinenumbers.ColorChanged += new System.EventHandler(this.colorlinenumbers_ColorChanged);
//
// colorkeywords
//
this.colorkeywords.BackColor = System.Drawing.Color.Transparent;
this.colorkeywords.Label = "Keywords:";
this.colorkeywords.Location = new System.Drawing.Point(15, 149);
this.colorkeywords.Label = "Functions:";
this.colorkeywords.Location = new System.Drawing.Point(15, 145);
this.colorkeywords.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorkeywords.MinimumSize = new System.Drawing.Size(100, 23);
this.colorkeywords.Name = "colorkeywords";
this.colorkeywords.Size = new System.Drawing.Size(168, 23);
this.colorkeywords.Size = new System.Drawing.Size(168, 21);
this.colorkeywords.TabIndex = 4;
this.colorkeywords.ColorChanged += new System.EventHandler(this.colorkeywords_ColorChanged);
//
@ -2156,11 +2166,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorliterals.BackColor = System.Drawing.Color.Transparent;
this.colorliterals.Label = "Numbers:";
this.colorliterals.Location = new System.Drawing.Point(15, 201);
this.colorliterals.Location = new System.Drawing.Point(15, 217);
this.colorliterals.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorliterals.MinimumSize = new System.Drawing.Size(100, 23);
this.colorliterals.Name = "colorliterals";
this.colorliterals.Size = new System.Drawing.Size(168, 23);
this.colorliterals.Size = new System.Drawing.Size(168, 21);
this.colorliterals.TabIndex = 5;
this.colorliterals.ColorChanged += new System.EventHandler(this.colorliterals_ColorChanged);
//
@ -2168,11 +2177,10 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorconstants.BackColor = System.Drawing.Color.Transparent;
this.colorconstants.Label = "Constants:";
this.colorconstants.Location = new System.Drawing.Point(15, 227);
this.colorconstants.Location = new System.Drawing.Point(15, 241);
this.colorconstants.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorconstants.MinimumSize = new System.Drawing.Size(100, 23);
this.colorconstants.Name = "colorconstants";
this.colorconstants.Size = new System.Drawing.Size(168, 23);
this.colorconstants.Size = new System.Drawing.Size(168, 21);
this.colorconstants.TabIndex = 6;
this.colorconstants.ColorChanged += new System.EventHandler(this.colorconstants_ColorChanged);
//
@ -2384,28 +2392,17 @@ namespace CodeImp.DoomBuilder.Windows
// browseScreenshotsFolderDialog
//
this.browseScreenshotsFolderDialog.Description = "Select a Folder to Save Screenshots Into";
// scriptcolorpresets
//
// colorproperties
//
this.scriptcolorpresets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.scriptcolorpresets.FormattingEnabled = true;
this.scriptcolorpresets.Items.AddRange(new object[] {
"Use current settings",
"Light theme",
"Dark theme"});
this.scriptcolorpresets.Location = new System.Drawing.Point(61, 18);
this.scriptcolorpresets.Name = "scriptcolorpresets";
this.scriptcolorpresets.Size = new System.Drawing.Size(122, 21);
this.scriptcolorpresets.TabIndex = 39;
this.scriptcolorpresets.SelectedIndexChanged += new System.EventHandler(this.scriptcolorpresets_SelectedIndexChanged);
//
// label28
//
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(15, 22);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(40, 13);
this.label28.TabIndex = 40;
this.label28.Text = "Preset:";
this.colorproperties.BackColor = System.Drawing.Color.Transparent;
this.colorproperties.Label = "Keywords:";
this.colorproperties.Location = new System.Drawing.Point(15, 169);
this.colorproperties.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorproperties.Name = "colorproperties";
this.colorproperties.Size = new System.Drawing.Size(168, 21);
this.colorproperties.TabIndex = 41;
this.colorproperties.ColorChanged += new System.EventHandler(this.colorproperties_ColorChanged);
//
// PreferencesForm
//
@ -2659,5 +2656,6 @@ namespace CodeImp.DoomBuilder.Windows
private CodeImp.DoomBuilder.Controls.ColorControl colorfoldfore;
private System.Windows.Forms.ComboBox scriptcolorpresets;
private System.Windows.Forms.Label label28;
private CodeImp.DoomBuilder.Controls.ColorControl colorproperties;
}
}

View file

@ -195,7 +195,8 @@ namespace CodeImp.DoomBuilder.Windows
colorplaintext.Color = General.Colors.PlainText;
colorcomments.Color = General.Colors.Comments;
colorkeywords.Color = General.Colors.Keywords;
colorliterals.Color = General.Colors.Literals;
colorproperties.Color = General.Colors.Properties; //mxd
colorliterals.Color = General.Colors.Literals;
colorconstants.Color = General.Colors.Constants;
colorstrings.Color = General.Colors.Strings; //mxd
colorincludes.Color = General.Colors.Includes; //mxd
@ -336,7 +337,8 @@ namespace CodeImp.DoomBuilder.Windows
General.Colors.PlainText = colorplaintext.Color;
General.Colors.Comments = colorcomments.Color;
General.Colors.Keywords = colorkeywords.Color;
General.Colors.Literals = colorliterals.Color;
General.Colors.Properties = colorproperties.Color; //mxd
General.Colors.Literals = colorliterals.Color;
General.Colors.Constants = colorconstants.Color;
General.Colors.Strings = colorstrings.Color; //mxd
General.Colors.Includes = colorincludes.Color; //mxd
@ -1030,6 +1032,11 @@ namespace CodeImp.DoomBuilder.Windows
if (allowapplycontrol) scriptedit.Keywords = colorkeywords.Color.ToColor();
}
private void colorproperties_ColorChanged(object sender, EventArgs e)
{
if (allowapplycontrol) scriptedit.Properties = colorproperties.Color.ToColor();
}
private void colorstrings_ColorChanged(object sender, EventArgs e)
{
if (allowapplycontrol) scriptedit.Strings = colorstrings.Color.ToColor();
@ -1101,6 +1108,7 @@ namespace CodeImp.DoomBuilder.Windows
colorplaintext.Color = General.Colors.PlainText;
colorcomments.Color = General.Colors.Comments;
colorkeywords.Color = General.Colors.Keywords;
colorproperties.Color = General.Colors.Properties;
colorliterals.Color = General.Colors.Literals;
colorconstants.Color = General.Colors.Constants;
colorstrings.Color = General.Colors.Strings;
@ -1116,13 +1124,15 @@ namespace CodeImp.DoomBuilder.Windows
break;
case 1: // Light theme
colorscriptbackground.Color = PixelColor.FromInt(-1);
colorlinenumbers.Color = PixelColor.FromInt(-13921873);
colorplaintext.Color = PixelColor.FromInt(-16777216);
colorcomments.Color = PixelColor.FromInt(-16744448);
colorkeywords.Color = PixelColor.FromInt(-16741493);
colorliterals.Color = PixelColor.FromInt(-16776961);
colorconstants.Color = PixelColor.FromInt(-16744256);
colorstrings.Color = PixelColor.FromInt(-6089451);
colorproperties.Color = PixelColor.FromInt(-16752191);
colorliterals.Color = PixelColor.FromInt(-16776999);
colorconstants.Color = PixelColor.FromInt(-8372160);
colorstrings.Color = PixelColor.FromInt(-8388608);
colorincludes.Color = PixelColor.FromInt(-9868951);
colorindicator.Color = PixelColor.FromInt(-16711936);
colorbrace.Color = PixelColor.FromInt(-16711681);
@ -1132,7 +1142,6 @@ namespace CodeImp.DoomBuilder.Windows
colorfoldback.Color = PixelColor.FromColor(SystemColors.ControlLightLight);
colorselectionfore.Color = PixelColor.FromInt(-1);
colorselectionback.Color = PixelColor.FromInt(-13395457);
colorscriptbackground.Color = PixelColor.FromInt(-1);
break;
case 2: // Dark theme
@ -1141,6 +1150,7 @@ namespace CodeImp.DoomBuilder.Windows
colorplaintext.Color = new PixelColor(255, 241, 242, 243);
colorcomments.Color = new PixelColor(255, 102, 116, 123);
colorkeywords.Color = new PixelColor(255, 103, 140, 177);
colorproperties.Color = PixelColor.FromColor(Color.LightSkyBlue);
colorliterals.Color = new PixelColor(255, 255, 205, 34);
colorconstants.Color = new PixelColor(255, 147, 199, 99);
colorstrings.Color = new PixelColor(255, 236, 118, 0);
@ -1162,6 +1172,7 @@ namespace CodeImp.DoomBuilder.Windows
scriptedit.PlainText = colorplaintext.Color.ToColor();
scriptedit.Comments = colorcomments.Color.ToColor();
scriptedit.Keywords = colorkeywords.Color.ToColor();
scriptedit.Properties = colorproperties.Color.ToColor();
scriptedit.Strings = colorstrings.Color.ToColor();
scriptedit.Literals = colorliterals.Color.ToColor();
scriptedit.Constants = colorconstants.Color.ToColor();

View file

@ -144,9 +144,6 @@
<metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="scriptallmanstyle.ToolTip" xml:space="preserve">
<value>When enabled, the opening brace
will be placed on a new line when