mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-31 04:40:55 +00:00
Added, Script Editor, ACC: block comments and #region / #endregion blocks are now foldable.
Fixed, Script Editor, ACC: auto completion for keywords starting with "#" char was not handled properly. Fixed, Script Editor: replaced the native Scintilla library with the one supplied with SciTE 3.6.2. The Script Editor should now work on Windows XP. Changed, Script Editor, search: all fold blocks are now unfolded when search result is inside a folded block. Updated ZDoom_ACS.cfg. Updated ZDoom_DECORATE.cfg. Updated ZDoom ACC to git rev. 6bb023d.
This commit is contained in:
parent
139c297161
commit
a1f8507167
7 changed files with 56 additions and 40 deletions
Binary file not shown.
|
@ -964,6 +964,7 @@
|
|||
#define SECF_DMGTERRAINFX 128
|
||||
#define SECF_DMGENDGODMODE 256
|
||||
#define SECF_DMGENDLEVEL 512
|
||||
#define SECF_DMGHAZARD 1024
|
||||
|
||||
#define BLOCKF_CREATURES 1
|
||||
#define BLOCKF_MONSTERS 2
|
||||
|
|
Binary file not shown.
|
@ -22,6 +22,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";
|
||||
snippetsdir = "acs";
|
||||
scripttype = 1; //0 = unknown script, 1 = acc, 2 = modeldef, 3 = decorate
|
||||
|
@ -37,6 +38,8 @@ keywords
|
|||
#NoCompact = "#NoCompact";
|
||||
#NoWadAuthor = "#NoWadAuthor";
|
||||
#WadAuthor = "#WadAuthor";
|
||||
#region = "#region block";
|
||||
#endregion = "end of #region block";
|
||||
ACS_Execute = "ACS_Execute(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)";
|
||||
|
@ -961,6 +964,7 @@ constants
|
|||
SDF_PERMANENT;
|
||||
SECF_DMGENDGODMODE;
|
||||
SECF_DMGENDLEVEL;
|
||||
SECF_DMGHAZARD;
|
||||
SECF_DMGTERRAINFX;
|
||||
SECF_FLOORDROP;
|
||||
SECF_FRICTION;
|
||||
|
|
|
@ -25,7 +25,7 @@ keywords
|
|||
#Include = "#Include";
|
||||
//Monster AI
|
||||
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_Chase = "A_Chase[(str meleestate = \"Melee\"[, str rangedstate = \"Missile\"[, int flags = 0]])]";
|
||||
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_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_Die = "A_Die[(str damagetype)]";
|
||||
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_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_Die = "A_Die[(str damagetype = \"none\")]";
|
||||
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 = 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_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.";
|
||||
|
@ -132,18 +132,18 @@ keywords
|
|||
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_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_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_Jump = "A_Jump(int chance, 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_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_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_JumpIfMasterCloser = "A_JumpIfMasterCloser(int distance, int offset OR str state[, bool noz = false])";
|
||||
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])";
|
||||
//Status changes
|
||||
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_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";
|
||||
|
@ -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_Tracer = "A_Tracer";
|
||||
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_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.";
|
||||
|
@ -307,8 +307,8 @@ keywords
|
|||
A_SpawnSound = "A_SpawnSound";
|
||||
A_BrainScream = "A_BrainScream";
|
||||
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_M_Saw = "A_M_Saw[(str fullsound = \"weapons/sawfull\"[, str hitsound = \"weapons/sawhit\"[, int damage = 0[, str pufftype = \"BulletPuff\"]]])]";
|
||||
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 = 2[, str pufftype = \"BulletPuff\"]]])]";
|
||||
A_SentinelRefire = "A_SentinelRefire";
|
||||
A_BetaSkullAttack = "A_BetaSkullAttack";
|
||||
//Miscellaneous functions for Doom
|
||||
|
@ -324,6 +324,7 @@ keywords
|
|||
//Miscellaneous functions not listed in the "Action functions" wiki article
|
||||
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_BishopMissileWeave = "A_BishopMissileWeave";
|
||||
A_DropWeaponPieces = "A_DropWeaponPieces(str actorclass1, str actorclass2, str actorclass3)";
|
||||
A_Feathers = "A_Feathers";
|
||||
A_GauntletAttack = "A_GauntletAttack(int power)";
|
||||
|
@ -1004,6 +1005,7 @@ constants
|
|||
CBF_SETMASTER;
|
||||
CBF_SETTRACER;
|
||||
CBF_SETONPTR;
|
||||
CBF_DROPOFF;
|
||||
CHF_DONTMOVE;
|
||||
CHF_FASTCHASE;
|
||||
CHF_NIGHTMAREFAST;
|
||||
|
@ -1224,7 +1226,6 @@ constants
|
|||
FAF_BOTTOM;
|
||||
FAF_MIDDLE;
|
||||
FAF_TOP;
|
||||
FAF_NODISTFACTOR;
|
||||
//A_QuakeEx flags
|
||||
QF_RELATIVE;
|
||||
QF_SCALEDOWN;
|
||||
|
|
|
@ -40,6 +40,8 @@ namespace CodeImp.DoomBuilder.Config
|
|||
{
|
||||
#region ================== Constants
|
||||
|
||||
private const string WORD_CHARS = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; //mxd
|
||||
|
||||
#endregion
|
||||
|
||||
#region ================== Variables
|
||||
|
@ -52,6 +54,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
// Editor settings
|
||||
private readonly string description;
|
||||
private readonly int codepage;
|
||||
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 int insertcase;
|
||||
|
@ -102,6 +105,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
public string ArrayClose { get { return arrayclose; } } //mxd
|
||||
public string ArgumentDelimiter { get { return argumentdelimiter; } }
|
||||
public string Terminator { get { return terminator; } }
|
||||
public string WordCharacters { get { return wordchars; } } //mxd
|
||||
public ScriptType ScriptType { get { return scripttype; } } //mxd
|
||||
|
||||
// Collections
|
||||
|
@ -146,6 +150,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
terminator = "";
|
||||
description = "Plain text";
|
||||
scripttype = ScriptType.UNKNOWN; //mxd
|
||||
wordchars = WORD_CHARS; //mxd
|
||||
extensions = new[] { "txt" };
|
||||
}
|
||||
|
||||
|
@ -182,6 +187,7 @@ namespace CodeImp.DoomBuilder.Config
|
|||
argumentdelimiter = cfg.ReadSetting("argumentdelimiter", "");
|
||||
terminator = cfg.ReadSetting("terminator", "");
|
||||
scripttype = (ScriptType)cfg.ReadSetting("scripttype", (int)ScriptType.UNKNOWN); //mxd
|
||||
wordchars = WORD_CHARS + cfg.ReadSetting("extrawordchars", ""); //mxd
|
||||
|
||||
//mxd. Make braces array
|
||||
if(!string.IsNullOrEmpty(functionopen)) braces.Add(functionopen[0]);
|
||||
|
|
|
@ -244,6 +244,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
int endline = Math.Min(scriptedit.Lines.Count, Math.Max(linenumber, linenumber + scriptedit.LinesOnScreen - 6));
|
||||
|
||||
// Go to target line
|
||||
scriptedit.DirectMessage(NativeMethods.SCI_ENSUREVISIBLEENFORCEPOLICY, (IntPtr)startline); // Unfold the whole text block if needed
|
||||
scriptedit.ShowLines(startline, endline);
|
||||
|
||||
// We may want to do some scrolling...
|
||||
|
@ -253,6 +254,29 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
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
|
||||
public int LineFromPosition(int position)
|
||||
{
|
||||
|
@ -324,6 +348,9 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
string lexername = "lexer" + (int)scriptconfig.Lexer;
|
||||
if(!lexercfg.SettingExists(lexername)) throw new InvalidOperationException("Unknown lexer " + scriptconfig.Lexer + " specified in script configuration!");
|
||||
scriptedit.Lexer = scriptconfig.Lexer;
|
||||
|
||||
//mxd. Set word chars
|
||||
scriptedit.SetWordChars(scriptconfig.WordCharacters);
|
||||
|
||||
// Set the default style and settings
|
||||
scriptedit.Styles[Style.Default].Font = General.Settings.ScriptFontName;
|
||||
|
@ -485,7 +512,10 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
// Instruct the lexer to calculate folding
|
||||
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
|
||||
scriptedit.Margins[2].Type = MarginType.Symbol;
|
||||
|
@ -712,32 +742,6 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
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
|
||||
public void IndentSelection(bool indent)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue