-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLOSAero.txt
65 lines (61 loc) · 1.85 KB
/
LOSAero.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--@name Lanteans OS AppCard (Aero)
--@author Yuri6037
--@class processor
--@model models/props_junk/sawblade001a.mdl
--Initialisation
Entity = ents.self()
Entity:setMaterial("phoenix_storms/black_chrome")
wire.createOutputs({"AppName", "AppCode"}, {"String", "String"})
Ports = wire.ports
--End
--Application
AppName = "aero"
AppCode = [[
local app = {}
function app:Init()
end
OS.DefineApp("aero", app)
local OldDrawWindow = DrawWindow
local OldWAPIConstruct = WINAPI.Construct
local OldWAPIAddComp = WINAPI.AddComponent
function WINAPI:Construct(hdl)
OldWAPIConstruct(self, hdl)
self.Background = COLOR(100, 100, 100)
end
function DrawWindow(app)
--Body
GUI.ANormGradiantRect(app.X, app.Y, app.Width, app.Height, app.Background, 200)
GUI.AInvGradiantRect(app.X, app.Y, app.Width, app.Height, app.Background, 200)
--Title bar
app:DrawTitleBar()
--Draw decorations if required
if (app.DrawDecos) then
--Icon
GUI.Icon(app.X, app.Y + 4, app.Icon.Window)
--Window reduce button
if (GUI.MouseInRect(app.X + app.Width - 38, app.Y + 6, 12, 12)) then
GUI.WindowButton(app.X + app.Width - 32, app.Y + 12, COLOR(0, 0, 255))
GUI.Text("-", app.X + app.Width - 38, app.Y + 6, SmallFont, COLOR(0, 0, 0))
else
GUI.WindowButton(app.X + app.Width - 32, app.Y + 12, COLOR(133, 133, 133))
end
--Window close button
if (GUI.MouseInRect(app.X + app.Width - 22, app.Y + 6, 12, 12)) then
GUI.WindowButton(app.X + app.Width - 16, app.Y + 12, COLOR(255, 0, 0))
GUI.Text("x", app.X + app.Width - 22, app.Y + 6, SmallFont, COLOR(0, 0, 0))
else
GUI.WindowButton(app.X + app.Width - 16, app.Y + 12, COLOR(133, 133, 133))
end
end
end
OS.DefineUninstall("aero", function()
DrawWindow = OldDrawWindow
WINAPI.Construct = OldWAPIConstruct
WINAPI.AddComponent = OldWAPIAddComp
end)
]]
--End
--Saving
Ports["AppName"] = "app_" .. AppName
Ports["AppCode"] = AppCode
--End