PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : LUA Syntax Highlighting



LoC
17.04.2008, 17:18
Schon tausendmal gefordert gibt es in diesem Forum nun endlich die Möglichkeit, LUA-Code farblich hervorzuheben, wie es Editoren wie Notepad++ tun.

BBCODE:

Husky
17.04.2008, 17:20
Schon tausendmal gefordert gibt es in diesem Forum nun endlich die Möglichkeit, LUA-Code farblich hervorzuheben, wie es Editoren wie Notepad++ tun.

BBCODE:


Test:

Test Test
Test Test
Hallo Hallo

Ahh, sehr gut. Dan hört das unordentliche Durcheinander der Vergangenheit an. ;)
Hoffentlich.

UGC-K3nny
17.04.2008, 17:20
da freuen sich die coder bestimmt :D

LoC
17.04.2008, 17:22
Auf jeden Fall wurde es in den letzten 2,5 Jahren konstant alle paar Wochen erfragt. ;)

raZor
17.04.2008, 17:27
Dann wurde es ja langsam Zeit.
Aber sicherling Nützlich.

Pac_187
17.04.2008, 17:32
Jo cool, nette Sache.


Könnte man es noch so machen das wenn z.B. dort eine Funktion ist


function test()
if wee then
blubb
else
blubberwasser
end
end


man diese wie in Notepadd++
mit + und - auf/zuklappen kann?

Husky
17.04.2008, 18:05
Jo cool, nette Sache.


Könnte man es noch so machen das wenn z.B. dort eine Funktion ist


function test()
if wee then
blubb
else
blubberwasser
end
end


man diese wie in Notepadd++
mit + und - auf/zuklappen kann?

Meinst du so ähnlich wie beim Spoiler? (Nur halt wie du gesagt hast mit + und -.)

Pac_187
17.04.2008, 18:11
Ja genau, nur halt für die einzelnen Funktionen und if's etc. ;)

A.I.
17.04.2008, 18:48
Trotzdem sieht der PHP-Tag übersichticher (farbiger :D) aus:




if ( SERVER ) then

AddCSLuaFile( "shared.lua" )

SWEP.HoldType = "pistol"

end

if ( CLIENT ) then

SWEP.PrintName = "Test"
SWEP.Author = ""
SWEP.Category = "Sasha-Sexyfur"
SWEP.Slot = 0
SWEP.SlotPos = 1
SWEP.DrawAmmo =true
SWEP.DrawCrosshair =false
SWEP.IconLetter = "f"
SWEP.ViewModelFOV = 65

killicon.AddFont( "weapon_deagle", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )

end


function getFiresUnderwater()
return true;
end


SWEP.Base = "weapon_cs_base"

SWEP.Spawnable = false
SWEP.AdminSpawnable = true

SWEP.ViewModel = "models/weapons/v_pist_fiveseven.mdl"
SWEP.WorldModel = "models/weapons/w_pist_fiveseven.mdl"

SWEP.Weight = 2.5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false

SWEP.Primary.Sound = Sound( "Weapon_fiveseven.Single" )
SWEP.Primary.Recoil = 0
SWEP.Primary.Damage = 14
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0
SWEP.Primary.ClipSize = 7
SWEP.Primary.Delay = 0.7
SWEP.Primary.DefaultClip = 7
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "pistol"



function SWEP:PrimaryAttack()
local trace = self.Owner:GetEyeTrace()
local ex = ents.Create ("env_explosion")
ex:SetOwner(self.Owner)
ex:SetPhysicsAttacker(self.Owner)
ex:SetPos (trace.HitPos)
ex:SetKeyValue ("iMagnitude", 14)
ex:SetKeyValue ("iRadiusOverride", 14)
ex:Fire ("explode", 0)
ex:Fire ("kill", 5)
end


function SWEP:GetViewModelPosition( vec, pos )
local myvec = vec
local mypos = pos

end





if ( SERVER ) then

AddCSLuaFile( "shared.lua" )

SWEP.HoldType = "pistol"

end

if ( CLIENT ) then

SWEP.PrintName = "Test"
SWEP.Author = ""
SWEP.Category = "Sasha-Sexyfur"
SWEP.Slot = 0
SWEP.SlotPos = 1
SWEP.DrawAmmo =true
SWEP.DrawCrosshair =false
SWEP.IconLetter = "f"
SWEP.ViewModelFOV = 65

killicon.AddFont( "weapon_deagle", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )

end


function getFiresUnderwater()
return true;
end


SWEP.Base = "weapon_cs_base"

SWEP.Spawnable = false
SWEP.AdminSpawnable = true

SWEP.ViewModel = "models/weapons/v_pist_fiveseven.mdl"
SWEP.WorldModel = "models/weapons/w_pist_fiveseven.mdl"

SWEP.Weight = 2.5
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false

SWEP.Primary.Sound = Sound( "Weapon_fiveseven.Single" )
SWEP.Primary.Recoil = 0
SWEP.Primary.Damage = 14
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0
SWEP.Primary.ClipSize = 7
SWEP.Primary.Delay = 0.7
SWEP.Primary.DefaultClip = 7
SWEP.Primary.Automatic = false
SWEP.Primary.Ammo = "pistol"



function SWEP:PrimaryAttack()
local trace = self.Owner:GetEyeTrace()
local ex = ents.Create ("env_explosion")
ex:SetOwner(self.Owner)
ex:SetPhysicsAttacker(self.Owner)
ex:SetPos (trace.HitPos)
ex:SetKeyValue ("iMagnitude", 14)
ex:SetKeyValue ("iRadiusOverride", 14)
ex:Fire ("explode", 0)
ex:Fire ("kill", 5)
end


function SWEP:GetViewModelPosition( vec, pos )
local myvec = vec
local mypos = pos

end

Vielleicht kennen ja einige den Gmod10 Lua Plugin für Notepad++:
https://sourceforge.net/project/showfiles.php?group_id=189927&package_id=265782
http://forums.facepunchstudios.com/showthread.php?p=8625735

Ist wirklich nützlich.

Könnte man die Farben so einstellen, wie es der Plugin macht?

Specter123
18.04.2008, 12:35
Schon tausendmal gefordert gibt es in diesem Forum nun endlich die Möglichkeit, LUA-Code farblich hervorzuheben, wie es Editoren wie Notepad++ tun.

BBCODE:


Ui Nice :D gefällt mir, sehr gut gemacht LoC! :up: