Merged in GZDB r2494.

This commit is contained in:
MascaraSnake 2016-04-07 16:14:31 +02:00
parent 5bfb2790d4
commit 7a82022239
7 changed files with 65 additions and 49 deletions

Binary file not shown.

View file

@ -964,6 +964,7 @@
#define SECF_DMGTERRAINFX 128 #define SECF_DMGTERRAINFX 128
#define SECF_DMGENDGODMODE 256 #define SECF_DMGENDGODMODE 256
#define SECF_DMGENDLEVEL 512 #define SECF_DMGENDLEVEL 512
#define SECF_DMGHAZARD 1024
#define BLOCKF_CREATURES 1 #define BLOCKF_CREATURES 1
#define BLOCKF_MONSTERS 2 #define BLOCKF_MONSTERS 2

Binary file not shown.

View file

@ -22,6 +22,7 @@ arrayopen = "[";
arrayclose = "]"; arrayclose = "]";
argumentdelimiter = ","; argumentdelimiter = ",";
terminator = ";"; 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"; keywordhelp = "http://www.zdoom.org/wiki/index.php?title=%K";
snippetsdir = "acs"; snippetsdir = "acs";
scripttype = 1; //0 = unknown script, 1 = acc, 2 = modeldef, 3 = decorate scripttype = 1; //0 = unknown script, 1 = acc, 2 = modeldef, 3 = decorate
@ -37,6 +38,8 @@ keywords
#NoCompact = "#NoCompact"; #NoCompact = "#NoCompact";
#NoWadAuthor = "#NoWadAuthor"; #NoWadAuthor = "#NoWadAuthor";
#WadAuthor = "#WadAuthor"; #WadAuthor = "#WadAuthor";
#region = "#region block";
#endregion = "end of #region block";
ACS_Execute = "ACS_Execute(script, map, arg1, arg2, arg3)"; ACS_Execute = "ACS_Execute(script, map, arg1, arg2, arg3)";
ACS_ExecuteAlways = "ACS_ExecuteAlways(script, map, arg1, arg2, arg3)"; ACS_ExecuteAlways = "ACS_ExecuteAlways(script, map, arg1, arg2, arg3)";
ACS_ExecuteWait = "void ACS_ExecuteWait(int script, int unused, int arg1, int arg2, int arg3)"; ACS_ExecuteWait = "void ACS_ExecuteWait(int script, int unused, int arg1, int arg2, int arg3)";
@ -961,6 +964,7 @@ constants
SDF_PERMANENT; SDF_PERMANENT;
SECF_DMGENDGODMODE; SECF_DMGENDGODMODE;
SECF_DMGENDLEVEL; SECF_DMGENDLEVEL;
SECF_DMGHAZARD;
SECF_DMGTERRAINFX; SECF_DMGTERRAINFX;
SECF_FLOORDROP; SECF_FLOORDROP;
SECF_FRICTION; SECF_FRICTION;

View file

@ -25,7 +25,7 @@ keywords
#Include = "#Include"; #Include = "#Include";
//Monster AI //Monster AI
A_AlertMonsters = "A_AlertMonsters[(float maxrange = 0.0[, int flags = 0])]"; A_AlertMonsters = "A_AlertMonsters[(float maxrange = 0.0[, int flags = 0])]";
A_Burst = "A_Burst(str type)"; A_Burst = "A_Burst(str chunktype)";
A_CentaurDefend = "A_CentaurDefend"; A_CentaurDefend = "A_CentaurDefend";
A_Chase = "A_Chase[(str meleestate = \"Melee\"[, str rangedstate = \"Missile\"[, int flags = 0]])]"; A_Chase = "A_Chase[(str meleestate = \"Melee\"[, str rangedstate = \"Missile\"[, int flags = 0]])]";
A_ClearLastHeard = "A_ClearLastHeard"; A_ClearLastHeard = "A_ClearLastHeard";
@ -37,9 +37,9 @@ keywords
A_DamageSiblings = "A_DamageSiblings(int amount[, str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage."; A_DamageSiblings = "A_DamageSiblings(int amount[, str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage.";
A_DamageTarget = "A_DamageTarget(int amount[, str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage."; A_DamageTarget = "A_DamageTarget(int amount[, str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage.";
A_DamageTracer = "A_DamageTracer(int amount[, str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage."; A_DamageTracer = "A_DamageTracer(int amount[, str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]]])\namount: amount of damage to inflict. Use a negative value to heal.\ndamagetype: the type of damage to inflict.\nflags: DMSS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage.";
A_Die = "A_Die[(str damagetype)]"; A_Die = "A_Die[(str damagetype = \"none\")]";
A_FaceTarget = "A_FaceTarget[(float angle = 0.0[, float pitch = 0.0])]\nA_FaceTarget(float max_turn, float max_pitch, float ang_offset, float pitch_offset, int flags)"; A_FaceTarget = "A_FaceTarget[(float angle = 0.0[, float pitch = 270.0])]\nA_FaceTarget([float max_turn = 0.0[, float max_pitch = 270.0[, float ang_offset = 0.0[, float pitch_offset = 0.0[, int flags = 0[, float z_add = 0.0]]]]]])";
A_FaceMaster = "A_FaceMaster[(float angle = 0.0[, float pitch = 0.0])]\nA_FaceMaster(float max_turn, float max_pitch, float ang_offset, float pitch_offset, int flags)"; A_FaceMaster = "A_FaceMaster[(float angle = 0.0[, float pitch = 270.0])]\nA_FaceMaster([float max_turn = 0.0[, float max_pitch = 270.0[, float ang_offset = 0.0[, float pitch_offset = 0.0[, int flags = 0[, float z_add = 0.0]]]]]])";
A_FastChase = "A_FastChase"; A_FastChase = "A_FastChase";
A_KillChildren = "A_KillChildren[(str damagetype = \"None\"[, int flags = 0[, str filter = \"None\[, str species = \"None\]]])]\ndamagetype: if the actor dies, the actor will enter a death state based on damagetype if present (or pain state if using NODAMAGE).\nflags: KILS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage."; A_KillChildren = "A_KillChildren[(str damagetype = \"None\"[, int flags = 0[, str filter = \"None\[, str species = \"None\]]])]\ndamagetype: if the actor dies, the actor will enter a death state based on damagetype if present (or pain state if using NODAMAGE).\nflags: KILS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage.";
A_KillMaster = "A_KillMaster[(str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]])]\ndamagetype: if the actor dies, the actor will enter a death state based on damagetype if present (or pain state if using NODAMAGE).\nflags: KILS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage."; A_KillMaster = "A_KillMaster[(str damagetype = \"None\"[, int flags = 0[, str filter = \"None\"[, str species = \"None\"]]])]\ndamagetype: if the actor dies, the actor will enter a death state based on damagetype if present (or pain state if using NODAMAGE).\nflags: KILS flags.\nfilter: the actor class to damage.\nspecies: the actor species to damage.";
@ -132,18 +132,18 @@ keywords
A_CheckFlag = "A_CheckFlag(str flagname, state label[, int check_pointer = AAPTR_DEFAULT])"; A_CheckFlag = "A_CheckFlag(str flagname, state label[, int check_pointer = AAPTR_DEFAULT])";
A_CheckLOF = "A_CheckLOF(state jump[, int flags = 0[, float range = 0.0[, float minrange = 0.0[, float angle = 0.0[, float pitch = 0.0[, float offsetheight = 0.0[, float offsetwidth = 0.0[, int ptr_target = AAPTR_DEFAULT]]]]]]]])"; A_CheckLOF = "A_CheckLOF(state jump[, int flags = 0[, float range = 0.0[, float minrange = 0.0[, float angle = 0.0[, float pitch = 0.0[, float offsetheight = 0.0[, float offsetwidth = 0.0[, int ptr_target = AAPTR_DEFAULT]]]]]]]])";
A_CheckProximity = "A_CheckProximity(str jump, str classname, float distance[, int count = 1[, int flags = 0[, int pointer = AAPTR_DEFAULT]]])"; A_CheckProximity = "A_CheckProximity(str jump, str classname, float distance[, int count = 1[, int flags = 0[, int pointer = AAPTR_DEFAULT]]])";
A_CheckRange = "A_CheckRange(float distance, int offset OR str state[, bool 2d_check])"; A_CheckRange = "A_CheckRange(float distance, int offset OR str state[, bool 2d_check = false])";
A_CheckSight = "A_CheckSight(int offset OR str state)"; A_CheckSight = "A_CheckSight(int offset OR str state)";
A_CheckSightOrRange = "A_CheckSightOrRange(float distance, int offset OR str state[, bool 2d_check])"; A_CheckSightOrRange = "A_CheckSightOrRange(float distance, int offset OR str state[, bool 2d_check = false])";
A_CheckSpecies = "A_CheckSpecies(str jump[, str species=\"None\"[, int pointer = AAPTR_DEFAULT]]) "; A_CheckSpecies = "A_CheckSpecies(str jump[, str species=\"None\"[, int pointer = AAPTR_DEFAULT]]) ";
A_Jump = "A_Jump(int chance, int offset OR str state, ...)"; A_Jump = "A_Jump(int chance, int offset OR str state, ...)";
A_JumpIf = "A_JumpIf(expression, int offset OR str state)"; A_JumpIf = "A_JumpIf(expression, int offset OR str state)";
A_JumpIfArmorType = "A_JumpIfArmorType(str armortype, str state[, int minimum])"; A_JumpIfArmorType = "A_JumpIfArmorType(str armortype, str state[, int minimum = 1])";
A_JumpIfCloser = "A_JumpIfCloser(int distance, int offset OR str state[, bool noz = false])"; A_JumpIfCloser = "A_JumpIfCloser(int distance, int offset OR str state[, bool noz = false])";
A_JumpIfHealthLower = "A_JumpIfHealthLower(int health, int offset OR str state[, int pointer = AAPTR_DEFAULT])"; A_JumpIfHealthLower = "A_JumpIfHealthLower(int health, int offset OR str state[, int pointer = AAPTR_DEFAULT])";
A_JumpIfHigherOrLower = "A_JumpIfHigherOrLower(str high, str low[, float offsethigh = 0.0[, float offsetlow = 0.0[, bool includeHeight = true[, int pointer = AAPTR_TARGET]]]])"; A_JumpIfHigherOrLower = "A_JumpIfHigherOrLower(str high, str low[, float offsethigh = 0.0[, float offsetlow = 0.0[, bool includeHeight = true[, int pointer = AAPTR_TARGET]]]])";
A_JumpIfInventory = "A_JumpIfInventory(str inventorytype, int amount, int offset OR str state[, int owner = AAPTR_DEFAULT])"; A_JumpIfInventory = "A_JumpIfInventory(str inventorytype, int amount, int offset OR str state[, int owner = AAPTR_DEFAULT])";
A_JumpIfInTargetInventory = "A_JumpIfInTargetInventory(str item, int count, int offset OR str state[, int forward])"; A_JumpIfInTargetInventory = "A_JumpIfInTargetInventory(str item, int count, int offset OR str state[, int forward = AAPTR_DEFAULT])";
A_JumpIfInTargetLOS = "A_JumpIfInTargetLOS(int offset OR str state[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nflags: JLOSF flags."; A_JumpIfInTargetLOS = "A_JumpIfInTargetLOS(int offset OR str state[, float fov = 0.0[, int flags = 0[, float dist_max = 0.0[, float dist_close = 0.0]]]])\nflags: JLOSF flags.";
A_JumpIfMasterCloser = "A_JumpIfMasterCloser(int distance, int offset OR str state[, bool noz = false])"; A_JumpIfMasterCloser = "A_JumpIfMasterCloser(int distance, int offset OR str state[, bool noz = false])";
A_JumpIfNoAmmo = "A_JumpIfNoAmmo(int offset OR str state)"; A_JumpIfNoAmmo = "A_JumpIfNoAmmo(int offset OR str state)";
@ -153,7 +153,7 @@ keywords
A_JumpIfTracerCloser = "A_JumpIfTracerCloser(int distance, int offset OR str state[, bool noz = false])"; A_JumpIfTracerCloser = "A_JumpIfTracerCloser(int distance, int offset OR str state[, bool noz = false])";
//Status changes //Status changes
A_ActiveAndUnblock = "A_ActiveAndUnblock"; A_ActiveAndUnblock = "A_ActiveAndUnblock";
A_CallSpecial = "A_CallSpecial(int special[, int arg1[, int arg2[, int arg3[, int arg4[, int arg5]]]]])"; A_CallSpecial = "A_CallSpecial(int special[, int arg1 = 0[, int arg2 = 0[, int arg3 = 0[, int arg4 = 0[, int arg5 = 0]]]]])";
A_ChangeFlag = "A_ChangeFlag(str flagname, bool value)"; A_ChangeFlag = "A_ChangeFlag(str flagname, bool value)";
A_ChangeVelocity = "A_ChangeVelocity[(float x = 0.0[, float y = 0.0[, float z = 0.0[, int flags = 0[, int pointer = AAPTR_DEFAULT]]]])]\nflags: CVF flags."; A_ChangeVelocity = "A_ChangeVelocity[(float x = 0.0[, float y = 0.0[, float z = 0.0[, int flags = 0[, int pointer = AAPTR_DEFAULT]]]])]\nflags: CVF flags.";
A_ClearShadow = "A_ClearShadow"; A_ClearShadow = "A_ClearShadow";
@ -216,7 +216,7 @@ keywords
A_SeekerMissile = "A_SeekerMissile(angle threshold, angle maxturnangle[, int flags = 0[, int chance = 50[, int distance = 10]]])\nflags: SMF flags."; A_SeekerMissile = "A_SeekerMissile(angle threshold, angle maxturnangle[, int flags = 0[, int chance = 50[, int distance = 10]]])\nflags: SMF flags.";
A_Tracer = "A_Tracer"; A_Tracer = "A_Tracer";
A_Tracer2 = "A_Tracer2"; A_Tracer2 = "A_Tracer2";
A_FaceTracer = "A_FaceTracer[(float angle = 0.0[, float pitch = 0.0])]\nA_FaceTracer(float max_turn, float max_pitch, float ang_offset, float pitch_offset, int flags)"; A_FaceTracer = "A_FaceTracer[(float angle = 0.0[, float pitch = 270.0])]\nA_FaceTracer([float max_turn = 0.0[, float max_pitch = 270.0[, float ang_offset = 0.0[, float pitch_offset = 0.0[, int flags = 0[, float z_add = 0.0]]]]]])";
A_Fire = "A_Fire[(float height = 0.0)]"; A_Fire = "A_Fire[(float height = 0.0)]";
A_Weave = "A_Weave(int horzspeed, int vertspeed, float horzdist, float vertdist)"; A_Weave = "A_Weave(int horzspeed, int vertspeed, float horzdist, float vertdist)";
A_Warp = "A_Warp(int ptr_destination[, float x-offset = 0[, float y-offset = 0[, float z-offset = 0[, float angle = 0[, int flags = 0[, str success_state = \"\"[, float heightoffset = 0[, float radiusoffset = 0[, float pitch = 0]]]]]]]]])\nflags: WARPF flags."; A_Warp = "A_Warp(int ptr_destination[, float x-offset = 0[, float y-offset = 0[, float z-offset = 0[, float angle = 0[, int flags = 0[, str success_state = \"\"[, float heightoffset = 0[, float radiusoffset = 0[, float pitch = 0]]]]]]]]])\nflags: WARPF flags.";
@ -307,8 +307,8 @@ keywords
A_SpawnSound = "A_SpawnSound"; A_SpawnSound = "A_SpawnSound";
A_BrainScream = "A_BrainScream"; A_BrainScream = "A_BrainScream";
A_BrainExplode = "A_BrainExplode"; A_BrainExplode = "A_BrainExplode";
A_Mushroom = "A_Mushroom[(str spawntype = \"FatShot\"[, int amount[, int flags = MSF_STANDARD[, float vrange = 4.0[, float hrange = 0.5]]]])]"; A_Mushroom = "A_Mushroom[(str spawntype = \"FatShot\"[, int numspawns = 0[, int flags = MSF_STANDARD[, float vrange = 4.0[, float hrange = 0.5]]]])]";
A_M_Saw = "A_M_Saw[(str fullsound = \"weapons/sawfull\"[, str hitsound = \"weapons/sawhit\"[, int damage = 0[, str pufftype = \"BulletPuff\"]]])]"; A_M_Saw = "A_M_Saw[(str fullsound = \"weapons/sawfull\"[, str hitsound = \"weapons/sawhit\"[, int damage = 2[, str pufftype = \"BulletPuff\"]]])]";
A_SentinelRefire = "A_SentinelRefire"; A_SentinelRefire = "A_SentinelRefire";
A_BetaSkullAttack = "A_BetaSkullAttack"; A_BetaSkullAttack = "A_BetaSkullAttack";
//Miscellaneous functions for Doom //Miscellaneous functions for Doom
@ -324,6 +324,7 @@ keywords
//Miscellaneous functions not listed in the "Action functions" wiki article //Miscellaneous functions not listed in the "Action functions" wiki article
A_Bang4Cloud = "A_Bang4Cloud"; A_Bang4Cloud = "A_Bang4Cloud";
A_Blast = "A_Blast[(int flags = 0[, int strength = 255[, int radius = 255[, float speed = 20.0[, str blasteffect = \"BlastEffect\"[, sound blastsound = \"BlastRadius\"]]]]])]"; A_Blast = "A_Blast[(int flags = 0[, int strength = 255[, int radius = 255[, float speed = 20.0[, str blasteffect = \"BlastEffect\"[, sound blastsound = \"BlastRadius\"]]]]])]";
A_BishopMissileWeave = "A_BishopMissileWeave";
A_DropWeaponPieces = "A_DropWeaponPieces(str actorclass1, str actorclass2, str actorclass3)"; A_DropWeaponPieces = "A_DropWeaponPieces(str actorclass1, str actorclass2, str actorclass3)";
A_Feathers = "A_Feathers"; A_Feathers = "A_Feathers";
A_GauntletAttack = "A_GauntletAttack(int power)"; A_GauntletAttack = "A_GauntletAttack(int power)";
@ -1004,6 +1005,7 @@ constants
CBF_SETMASTER; CBF_SETMASTER;
CBF_SETTRACER; CBF_SETTRACER;
CBF_SETONPTR; CBF_SETONPTR;
CBF_DROPOFF;
CHF_DONTMOVE; CHF_DONTMOVE;
CHF_FASTCHASE; CHF_FASTCHASE;
CHF_NIGHTMAREFAST; CHF_NIGHTMAREFAST;
@ -1224,7 +1226,6 @@ constants
FAF_BOTTOM; FAF_BOTTOM;
FAF_MIDDLE; FAF_MIDDLE;
FAF_TOP; FAF_TOP;
FAF_NODISTFACTOR;
//A_QuakeEx flags //A_QuakeEx flags
QF_RELATIVE; QF_RELATIVE;
QF_SCALEDOWN; QF_SCALEDOWN;

View file

@ -38,21 +38,24 @@ namespace CodeImp.DoomBuilder.Config
internal class ScriptConfiguration : IComparable<ScriptConfiguration> internal class ScriptConfiguration : IComparable<ScriptConfiguration>
{ {
#region ================== Constants #region ================== Constants
#endregion private const string WORD_CHARS = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //mxd
#region ================== Variables #endregion
// Compiler settings #region ================== Variables
private readonly CompilerInfo compiler;
// Compiler settings
private readonly CompilerInfo compiler;
private readonly string parameters; private readonly string parameters;
private readonly string resultlump; private readonly string resultlump;
// Editor settings // Editor settings
private readonly string description; private readonly string description;
private readonly int codepage; private readonly int codepage;
private readonly string[] extensions; private readonly string wordchars; //mxd. Characters to be threated as part of a word by Scintilla
private readonly string[] extensions;
private readonly bool casesensitive; private readonly bool casesensitive;
private readonly int insertcase; private readonly int insertcase;
private readonly Lexer lexer; private readonly Lexer lexer;
@ -102,7 +105,8 @@ namespace CodeImp.DoomBuilder.Config
public string ArrayClose { get { return arrayclose; } } //mxd public string ArrayClose { get { return arrayclose; } } //mxd
public string ArgumentDelimiter { get { return argumentdelimiter; } } public string ArgumentDelimiter { get { return argumentdelimiter; } }
public string Terminator { get { return terminator; } } public string Terminator { get { return terminator; } }
public ScriptType ScriptType { get { return scripttype; } } //mxd public string WordCharacters { get { return wordchars; } } //mxd
public ScriptType ScriptType { get { return scripttype; } } //mxd
// Collections // Collections
public ICollection<string> Keywords { get { return keywordkeyssorted; } } public ICollection<string> Keywords { get { return keywordkeyssorted; } }
@ -146,7 +150,8 @@ namespace CodeImp.DoomBuilder.Config
terminator = ""; terminator = "";
description = "Plain text"; description = "Plain text";
scripttype = ScriptType.UNKNOWN; //mxd scripttype = ScriptType.UNKNOWN; //mxd
extensions = new[] { "txt" }; wordchars = WORD_CHARS; //mxd
extensions = new[] { "txt" };
} }
// Constructor // Constructor
@ -181,6 +186,7 @@ namespace CodeImp.DoomBuilder.Config
argumentdelimiter = cfg.ReadSetting("argumentdelimiter", ""); argumentdelimiter = cfg.ReadSetting("argumentdelimiter", "");
terminator = cfg.ReadSetting("terminator", ""); terminator = cfg.ReadSetting("terminator", "");
scripttype = (ScriptType)cfg.ReadSetting("scripttype", (int)ScriptType.UNKNOWN); //mxd scripttype = (ScriptType)cfg.ReadSetting("scripttype", (int)ScriptType.UNKNOWN); //mxd
wordchars = WORD_CHARS + cfg.ReadSetting("extrawordchars", ""); //mxd
//mxd. Make braces array //mxd. Make braces array
if (!string.IsNullOrEmpty(functionopen)) braces.Add(functionopen[0]); if (!string.IsNullOrEmpty(functionopen)) braces.Add(functionopen[0]);

View file

@ -244,6 +244,7 @@ namespace CodeImp.DoomBuilder.Controls
int endline = Math.Min(scriptedit.Lines.Count, Math.Max(linenumber, linenumber + scriptedit.LinesOnScreen - 6)); int endline = Math.Min(scriptedit.Lines.Count, Math.Max(linenumber, linenumber + scriptedit.LinesOnScreen - 6));
// Go to target line // Go to target line
scriptedit.DirectMessage(NativeMethods.SCI_ENSUREVISIBLEENFORCEPOLICY, (IntPtr)startline); // Unfold the whole text block if needed
scriptedit.ShowLines(startline, endline); scriptedit.ShowLines(startline, endline);
// We may want to do some scrolling... // We may want to do some scrolling...
@ -253,6 +254,29 @@ namespace CodeImp.DoomBuilder.Controls
scriptedit.Lines[endline].Goto(); scriptedit.Lines[endline].Goto();
} }
//mxd
private void SelectAndShow(int startpos, int endpos)
{
// Select the result
int startline = scriptedit.LineFromPosition(startpos);
int endline = scriptedit.LineFromPosition(endpos);
// Go to target line
scriptedit.DirectMessage(NativeMethods.SCI_ENSUREVISIBLEENFORCEPOLICY, (IntPtr)startline); // Unfold the whole text block if needed
scriptedit.ShowLines(startline, endline);
scriptedit.GotoPosition(startpos);
// We may want to do some extra scrolling...
if (startline > 1 && scriptedit.FirstVisibleLine >= startline - 1)
scriptedit.Lines[startline - 1].Goto();
else if (endline < scriptedit.Lines.Count - 1 && scriptedit.FirstVisibleLine + scriptedit.LinesOnScreen <= endline + 1)
scriptedit.Lines[endline + 1].Goto();
// Update selection
scriptedit.SelectionStart = startpos;
scriptedit.SelectionEnd = endpos;
}
// This returns the line for a position // This returns the line for a position
public int LineFromPosition(int position) public int LineFromPosition(int position)
{ {
@ -325,6 +349,9 @@ namespace CodeImp.DoomBuilder.Controls
if (!lexercfg.SettingExists(lexername)) throw new InvalidOperationException("Unknown lexer " + scriptconfig.Lexer + " specified in script configuration!"); if (!lexercfg.SettingExists(lexername)) throw new InvalidOperationException("Unknown lexer " + scriptconfig.Lexer + " specified in script configuration!");
scriptedit.Lexer = scriptconfig.Lexer; scriptedit.Lexer = scriptconfig.Lexer;
//mxd. Set word chars
scriptedit.SetWordChars(scriptconfig.WordCharacters);
// Set the default style and settings // Set the default style and settings
scriptedit.Styles[Style.Default].Font = General.Settings.ScriptFontName; scriptedit.Styles[Style.Default].Font = General.Settings.ScriptFontName;
scriptedit.Styles[Style.Default].Size = General.Settings.ScriptFontSize; scriptedit.Styles[Style.Default].Size = General.Settings.ScriptFontSize;
@ -485,7 +512,10 @@ namespace CodeImp.DoomBuilder.Controls
{ {
// Instruct the lexer to calculate folding // Instruct the lexer to calculate folding
scriptedit.SetProperty("fold", "1"); scriptedit.SetProperty("fold", "1");
scriptedit.SetProperty("fold.compact", "1"); scriptedit.SetProperty("fold.compact", "0"); // 1 = folds blank lines
scriptedit.SetProperty("fold.comment", "1"); // Enable block comment folding
scriptedit.SetProperty("fold.preprocessor", "1"); // Enable #region folding
scriptedit.SetFoldFlags(FoldFlags.LineAfterContracted); // Draw line below if not expanded
// Configure a margin to display folding symbols // Configure a margin to display folding symbols
scriptedit.Margins[2].Type = MarginType.Symbol; scriptedit.Margins[2].Type = MarginType.Symbol;
@ -712,32 +742,6 @@ namespace CodeImp.DoomBuilder.Controls
return false; return false;
} }
//mxd
private void SelectAndShow(int startpos, int endpos)
{
// Select the result
int startline = scriptedit.LineFromPosition(startpos);
int endline = scriptedit.LineFromPosition(endpos);
// Go to target line
scriptedit.ShowLines(startline, endline);
scriptedit.GotoPosition(startpos);
// We may want to do some extra scrolling...
if (startline > 1 && scriptedit.FirstVisibleLine >= startline - 1)
{
scriptedit.Lines[startline - 1].Goto();
}
else if (endline < scriptedit.Lines.Count - 1 && scriptedit.FirstVisibleLine + scriptedit.LinesOnScreen <= endline + 1)
{
scriptedit.Lines[endline + 1].Goto();
}
// Update selection
scriptedit.SelectionStart = startpos;
scriptedit.SelectionEnd = endpos;
}
//mxd. (Un)indents selection //mxd. (Un)indents selection
public void IndentSelection(bool indent) public void IndentSelection(bool indent)
{ {