Code cleanup

This commit is contained in:
JCash
2020-09-02 16:54:37 +02:00
parent 5de32250c3
commit 26a9ef0143
8 changed files with 242 additions and 136 deletions

View File

@@ -16,7 +16,7 @@ background_color {
nodes {
position {
x: 10.0
y: 1113.0
y: 949.0
z: 0.0
w: 1.0
}
@@ -78,7 +78,7 @@ nodes {
nodes {
position {
x: 214.0
y: 568.0
y: 314.0
z: 0.0
w: 1.0
}
@@ -236,7 +236,7 @@ nodes {
nodes {
position {
x: 320.0
y: 438.0
y: 184.0
z: 0.0
w: 1.0
}
@@ -394,7 +394,7 @@ nodes {
nodes {
position {
x: 320.0
y: 503.0
y: 249.0
z: 0.0
w: 1.0
}
@@ -552,7 +552,7 @@ nodes {
nodes {
position {
x: 429.0
y: 568.0
y: 314.0
z: 0.0
w: 1.0
}
@@ -710,7 +710,7 @@ nodes {
nodes {
position {
x: 320.0
y: 568.0
y: 314.0
z: 0.0
w: 1.0
}

View File

@@ -57,22 +57,14 @@ end
local function websocket_callback(self, conn, data)
if data.event == websocket.EVENT_DISCONNECTED then
log("Disconnected: " .. tostring(conn))
self.connection = nil
update_gui(self)
if data.error then
log("Diconnect error:", data.error)
self.connection = nil
end
elseif data.event == websocket.EVENT_CONNECTED then
if data.error then
log("Connection error:", data.error)
self.connection = nil
end
update_gui(self)
log("Connected: " .. tostring(conn))
elseif data.event == websocket.EVENT_ERROR then
if data.error then
log("Error:", data.error)
end
log("Error: '" .. data.error .. "'")
elseif data.event == websocket.EVENT_MESSAGE then
log("Receiving: '" .. tostring(data.message) .. "'")
end
@@ -84,9 +76,6 @@ local function connect(self, scheme)
self.url = scheme .. URL
log("Connecting to " .. self.url)
self.connection = websocket.connect(self.url, params, websocket_callback)
if self.connection == nil then
print("Failed to connect to " .. self.url .. ": " .. err)
end
end
local function disconnect(self)