Home   Help Search Login Register  

Author Topic: ArmAScript - A notepad++ plugin (ACCEPTED)  (Read 15997 times)

0 Members and 1 Guest are viewing this topic.

Offline i0n0s

  • Moderator
  • *****
ArmAScript - A notepad++ plugin (ACCEPTED)
« on: 14 Jan 2009, 01:43:08 »
Since notepad++ is a useful tool for programming, but sadly it didn't have support for SQF. My problem solves this by adding a lexer for SQF and adds support for folding.

Just take a look at the attached "ArmAScript.png" for details.
Additional function will get highlighted with different colors depending on the effect and the locality of the parameter.

Also a hint with displays should be displayed when hovering about a word.

In the plugin menu, you're able to set folding-settings. Additional you can introduce the private variables either on the hole document or within a selection. Sadly this is limited since it ignores scopes and existing private-statements. Nevertheless it is very useful :)

How to install:
If you are clever and have installed N++ in local mode, you can simple copy the content either of the ansi or the unicode folder into the plugin folder.
If installed globally, the content of the Config folder belongs to $APPDATA\Notepad++\plugins\config. The rest stays the same as when having it installed locally.

Changelog:
1.01:
*Fixed call tips
*Added auto indentation

1.02:
*Strings can float lines
*Styling of global and local variables possible

1.03:
*Removed version warning
*Corrected "introduce private statement"
*Autoindent will get saved over sessions
*Added "hint "variable""
*Added ability to disable call tips

Get ArmA Script Notepad++ plugin v1.03
« Last Edit: 10 Feb 2009, 17:34:35 by Mandoble »

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: ArmAScript - A notepad++ plugin
« Reply #1 on: 14 Jan 2009, 01:53:44 »
awesome I use Notepad ++ testing it out
Xbox Rocks

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: ArmAScript - A notepad++ plugin
« Reply #2 on: 14 Jan 2009, 05:45:28 »
Brilliant Iionos!  Thanks man, Notepad++ is a great tool, and now its Arma-fied!  I just tried it out, and it works great.  :clap:  The coloring is very helpful, and general NotePad smarts of brace pairing etc. is very useful.

Under the Plugins menu, I see ArmaScript with many options (fold, introduce, indentation) etc., but I can't figure out how to use them.  Any hints on this?
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline i0n0s

  • Moderator
  • *****
Re: ArmAScript - A notepad++ plugin
« Reply #3 on: 14 Jan 2009, 12:18:26 »
"Introduce private-statement":
Place the cursor at the line, where you one to have the private statement to be placed. Then press the button.

"Introduce private-statement (selection)":
Select the code in which the local variables should get collected, then click the button. The private statement will get inserted at the beginning of the selection.

"Create intendation": (*sick*, typo :( )
The current active document will get indented automatic (when displayed as SQF).
So
Code: [Select]
_check = true;
{
if (_x select 0 == _display) exitWith {
throw "Display is already registered";
_check = false;
};
} forEach ION_DSM_Displays;
will be converted to:
Code: [Select]
_check = true;
{
if (_x select 0 == _display) exitWith {
throw "Display is already registered";
_check = false;
};
} forEach ION_DSM_Displays;

The settings are for the folding.
When having "fold preprocessor" active, you can fold
Code: [Select]
#ifdef
   Bla
#endif
"fold comment" allows to fold the /* */ comment structure.
"fold arrays" allows to fold arrays ( [ ] ).
"fold compact" will hide blank lines after folded code.
"fold at else" will at a fold point to the else, so you can fold the 'then' part or the 'else' part and are not forced to fold the complete if-statement.

Offline Trexian

  • Members
  • *
Re: ArmAScript - A notepad++ plugin
« Reply #4 on: 14 Jan 2009, 21:46:49 »
Ah!  I found a NP++ plugin a long time ago and have been using it.

http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=71;t=58206

Will certainly give yours a try, too.

Sic semper tyrannosauro.

Offline i0n0s

  • Moderator
  • *****
Re: ArmAScript - A notepad++ plugin
« Reply #5 on: 16 Jan 2009, 12:47:01 »
Updated to 1.01:
The call tips should now work independent which view is used.
I also added a "auto indentation" feature which automatic indent when encountering a '{' and '}'. You can enabled or disabled this feature in the plugin menu.

Offline Xeno

  • Members
  • *
Re: ArmAScript - A notepad++ plugin
« Reply #6 on: 16 Jan 2009, 19:46:52 »
Thanks for finally making it public, iOnOs (am allready using it a little bit longer and it is just great).

Xeno

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: ArmAScript - A notepad++ plugin
« Reply #7 on: 16 Jan 2009, 19:48:34 »
It is very handy. I'll add it up in the ED later this evening.
Xbox Rocks

Offline i0n0s

  • Moderator
  • *****
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #8 on: 22 Jan 2009, 22:43:58 »
Thanks for adding to the ED.

I've got an update:
*Strings now float over lines. So this string will get highlighted correctly:
Code: [Select]
_ctrl ctrlSetEventHandler ["MouseButtonDown", format ["
if (_this select 1 == 0) then {
(ION_DSM_Dialog select %1) set [9, true];
(ION_DSM_Dialog select %1 select 10) set [0, _this select 2];
(ION_DSM_Dialog select %1 select 10) set [1, _this select 3];
};", _element]];
*Added styling possibility for global and local variables.
Use Settings->Styler Configuration to change the color.

Offline Trexian

  • Members
  • *
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #9 on: 23 Jan 2009, 18:22:28 »
VERY nice.  Has now replaced that other version I was using.   :good:

Absolutely LOVE the make-private-selection plugin.   :clap:
Sic semper tyrannosauro.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #10 on: 23 Jan 2009, 18:48:59 »
I've updated the OFPEC Download to version 1.02
Xbox Rocks

Offline Trexian

  • Members
  • *
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #11 on: 24 Jan 2009, 00:23:09 »
Heya i0n0s,

Very pleased with this.  In using it, I had an idea similar to your make-private-list function.  Any way to select a variable then in the line below the one selected, have it create a line:

hint format [" *variable name without the underscore* = %1", *variablename*];
sleep 1;

Or something like that? :)
Sic semper tyrannosauro.

Offline i0n0s

  • Moderator
  • *****
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #12 on: 24 Jan 2009, 01:57:00 »
Would be possible.
So you have the cursor in a variable, then you select the action.
The next step would be that I create a new line, then enters:
Code: [Select]
hint format ["$1 = %1", $1"];where $1 is the variable.
Would be easy to implement. Any more ideas?

Offline Trexian

  • Members
  • *
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #13 on: 24 Jan 2009, 17:27:46 »
Not yet, but I'll try to think of something.... :)

I find it very thorough already.  LOVE the hints. Is there an option to turn them off?  At this point, I wouldn't want to, but someone else might.
Sic semper tyrannosauro.

Offline i0n0s

  • Moderator
  • *****
Re: ArmAScript - A notepad++ plugin (ACCEPTED)
« Reply #14 on: 10 Feb 2009, 16:26:19 »
Updated to 1.03

No, I haven't forgotten lightAttachObject..., Notepad++ 5.2 changed its version number style and therefore the previous version complains about a too old version.

I also changed the "introduce private statement" functions. It didn't catch all local variables, variables with more than one '_' weren't detected. Also the private statement will get the right indentation level.

You can now disable the call tips and I've added Trexians request.