mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
fonts {
|
||||
name: "text_regular"
|
||||
font: "/druid/fonts/text_regular.font"
|
||||
name: "druid_text_regular"
|
||||
font: "/druid/fonts/druid_text_regular.font"
|
||||
}
|
||||
fonts {
|
||||
name: "text_bold"
|
||||
font: "/druid/fonts/text_bold.font"
|
||||
name: "druid_text_bold"
|
||||
font: "/druid/fonts/druid_text_bold.font"
|
||||
}
|
||||
textures {
|
||||
name: "druid"
|
||||
@@ -104,7 +104,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "120.23 KB"
|
||||
font: "text_regular"
|
||||
font: "druid_text_regular"
|
||||
id: "text_max_value"
|
||||
pivot: PIVOT_W
|
||||
outline {
|
||||
@@ -142,7 +142,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "120 KB/s"
|
||||
font: "text_regular"
|
||||
font: "druid_text_regular"
|
||||
id: "text_per_second"
|
||||
pivot: PIVOT_E
|
||||
outline {
|
||||
@@ -221,7 +221,7 @@ nodes {
|
||||
}
|
||||
type: TYPE_TEXT
|
||||
text: "120 KB"
|
||||
font: "text_bold"
|
||||
font: "druid_text_bold"
|
||||
id: "text_memory"
|
||||
outline {
|
||||
x: 1.0
|
||||
|
@@ -51,14 +51,14 @@ function M:push_next_value()
|
||||
self.mini_graph:set_max_value(max_value)
|
||||
|
||||
local max_memory = math.ceil(self.mini_graph:get_highest_value())
|
||||
self.max_value:set_to(max_memory .. " KB")
|
||||
self.max_value:set_text(max_memory .. " KB")
|
||||
|
||||
local last_second = 0
|
||||
local last_second_samples = math.ceil(1 / self.delta_time)
|
||||
for index = #self.memory_samples - last_second_samples + 1, #self.memory_samples do
|
||||
last_second = last_second + (self.memory_samples[index] or 0)
|
||||
end
|
||||
self.text_per_second:set_to(math.ceil(last_second) .. " KB/s")
|
||||
self.text_per_second:set_text(math.ceil(last_second) .. " KB/s")
|
||||
end
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@ function M:update_text_memory()
|
||||
local memory = math.ceil(collectgarbage("count")) -- in KB
|
||||
if memory > 1024 then
|
||||
memory = memory / 1024
|
||||
self.text_memory:set_to(string.format("%.2f", memory) .. " MB")
|
||||
self.text_memory:set_text(string.format("%.2f", memory) .. " MB")
|
||||
else
|
||||
self.text_memory:set_to(memory .. " KB")
|
||||
self.text_memory:set_text(memory .. " KB")
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user