Update built-in mods (#276)
* Update built-in mods * Update nametags.lua
This commit is contained in:
parent
44dbe9cdaa
commit
6e9ead22a9
|
@ -1,19 +1,26 @@
|
||||||
-- name: Nametags
|
-- name: Nametags
|
||||||
-- incompatible: nametags
|
-- incompatible: nametags
|
||||||
-- description: Nametags\nBy \\#ec7731\\Agent X\\#ffffff\\\n\nThis mod adds nametags to sm64ex-coop, this helps to easily identify other players without the player list, nametags can toggled with \\#ffff00\\/nametags [on|off]\\#ffffff\\
|
-- description: Nametags\nBy \\#ec7731\\Agent X\\#dcdcdc\\\n\nThis mod adds nametags to sm64ex-coop, this helps to easily identify other players without the player list, nametags can toggled on and off with \\#ffff00\\/nametag-distance 7000\\#dcdcdc\\ and \\#ffff00\\/nametag-distance 0\\#dcdcdc\\ respectively.
|
||||||
|
|
||||||
MAX_SCALE = 0.32
|
MAX_SCALE = 0.32
|
||||||
|
|
||||||
gGlobalSyncTable.nametags = true
|
|
||||||
gGlobalSyncTable.dist = 7000
|
gGlobalSyncTable.dist = 7000
|
||||||
|
gGlobalSyncTable.health = true
|
||||||
|
|
||||||
|
showSelfTag = false
|
||||||
|
|
||||||
for k, v in pairs(gActiveMods) do
|
for k, v in pairs(gActiveMods) do
|
||||||
local name = v.name:lower()
|
local name = v.name:lower()
|
||||||
if v.enabled and (name:find("hide") or name:find("hns") or name:find("hunt")) then
|
if v.enabled and (name:find("hide") or name:find("hns") or name:find("hunt")) then
|
||||||
gGlobalSyncTable.nametags = false
|
gGlobalSyncTable.dist = 0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function on_or_off(value)
|
||||||
|
if value then return "\\#00ff00\\ON" end
|
||||||
|
return "\\#ff0000\\OFF"
|
||||||
|
end
|
||||||
|
|
||||||
function clamp(x, a, b)
|
function clamp(x, a, b)
|
||||||
if x < a then return a end
|
if x < a then return a end
|
||||||
if x > b then return b end
|
if x > b then return b end
|
||||||
|
@ -55,9 +62,9 @@ function djui_hud_set_adjusted_color(r, g, b, a)
|
||||||
djui_hud_set_color(r * multiplier, g * multiplier, b * multiplier, a)
|
djui_hud_set_color(r * multiplier, g * multiplier, b * multiplier, a)
|
||||||
end
|
end
|
||||||
|
|
||||||
function djui_hud_print_outlined_text(text, x, y, scale, r, g, b, outlineDarkness)
|
function djui_hud_print_outlined_text(text, x, y, scale, r, g, b, a, outlineDarkness)
|
||||||
-- render outline
|
-- render outline
|
||||||
djui_hud_set_adjusted_color(r * outlineDarkness, g * outlineDarkness, b * outlineDarkness, 255)
|
djui_hud_set_adjusted_color(r * outlineDarkness, g * outlineDarkness, b * outlineDarkness, a)
|
||||||
djui_hud_print_text(text, x - (1*(scale*2)), y, scale)
|
djui_hud_print_text(text, x - (1*(scale*2)), y, scale)
|
||||||
djui_hud_print_text(text, x + (1*(scale*2)), y, scale)
|
djui_hud_print_text(text, x + (1*(scale*2)), y, scale)
|
||||||
djui_hud_print_text(text, x, y - (1*(scale*2)), scale)
|
djui_hud_print_text(text, x, y - (1*(scale*2)), scale)
|
||||||
|
@ -68,51 +75,31 @@ function djui_hud_print_outlined_text(text, x, y, scale, r, g, b, outlineDarknes
|
||||||
djui_hud_set_color(255, 255, 255, 255)
|
djui_hud_set_color(255, 255, 255, 255)
|
||||||
end
|
end
|
||||||
|
|
||||||
function name_and_hex(name)
|
function name_without_hex(name)
|
||||||
local nameTable = {}
|
local s = ''
|
||||||
name:gsub(".", function(c) table.insert(nameTable, c) end)
|
local inSlash = false
|
||||||
|
for i = 1, #name do
|
||||||
local removed = false
|
local c = name:sub(i,i)
|
||||||
local color = "000000"
|
if c == '\\' then
|
||||||
for k, v in pairs(nameTable) do
|
inSlash = not inSlash
|
||||||
if v == "\\" and not removed then
|
elseif not inSlash then
|
||||||
removed = true
|
s = s .. c
|
||||||
nameTable[k] = "" -- \
|
|
||||||
nameTable[k + 1] = "" -- #
|
|
||||||
if nameTable[k + 2] ~= nil and nameTable[k + 3] ~= nil and nameTable[k + 4] ~= nil and nameTable[k + 5] ~= nil and nameTable[k + 6] ~= nil and nameTable[k + 7] ~= nil then
|
|
||||||
color = nameTable[k + 2] .. nameTable[k + 3] .. nameTable[k + 4] .. nameTable[k + 5] .. nameTable[k + 6] .. nameTable[k + 7]
|
|
||||||
end
|
|
||||||
nameTable[k + 2] = "" -- f
|
|
||||||
nameTable[k + 3] = "" -- f
|
|
||||||
nameTable[k + 4] = "" -- f
|
|
||||||
nameTable[k + 5] = "" -- f
|
|
||||||
nameTable[k + 6] = "" -- f
|
|
||||||
nameTable[k + 7] = "" -- f
|
|
||||||
nameTable[k + 8] = "" -- \
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return { name = table.concat(nameTable, ""), color = color }
|
return s
|
||||||
end
|
end
|
||||||
|
|
||||||
function hex_to_rgb(hex)
|
|
||||||
local hexTable = {}
|
|
||||||
hex:gsub("..", function(c) table.insert(hexTable, c) end)
|
|
||||||
return { r = tonumber(hexTable[1], 16), g = tonumber(hexTable[2], 16), b = tonumber(hexTable[3], 16) }
|
|
||||||
end
|
|
||||||
|
|
||||||
showSelfTag = false
|
|
||||||
function on_hud_render()
|
function on_hud_render()
|
||||||
if not gGlobalSyncTable.nametags or not gNetworkPlayers[0].currAreaSyncValid or obj_get_first_with_behavior_id(id_bhvActSelector) ~= nil then return end
|
if gGlobalSyncTable.dist == 0 or not gNetworkPlayers[0].currAreaSyncValid or obj_get_first_with_behavior_id(id_bhvActSelector) ~= nil then return end
|
||||||
|
|
||||||
djui_hud_set_resolution(RESOLUTION_N64)
|
djui_hud_set_resolution(RESOLUTION_N64)
|
||||||
djui_hud_set_font(FONT_NORMAL)
|
djui_hud_set_font(FONT_NORMAL)
|
||||||
|
|
||||||
for i = if_then_else(showSelfTag, 0, 1), network_player_connected_count() - 1 do
|
for i = if_then_else(showSelfTag, 0, 1), (MAX_PLAYERS - 1) do
|
||||||
local m = gMarioStates[i]
|
local m = gMarioStates[i]
|
||||||
if active_player(m) ~= 0 then
|
if active_player(m) ~= 0 and m.action ~= ACT_IN_CANNON and (m.playerIndex ~= 0 or (m.playerIndex == 0 and m.action ~= ACT_FIRST_PERSON)) then
|
||||||
if m.playerIndex == 0 and (m.input & INPUT_FIRST_PERSON) ~= 0 then return end
|
|
||||||
local out = { x = 0, y = 0, z = 0 }
|
local out = { x = 0, y = 0, z = 0 }
|
||||||
local pos = { x = m.marioObj.header.gfx.pos.x, y = m.marioBodyState.headPos.y + 120, z = m.marioObj.header.gfx.pos.z }
|
local pos = { x = m.marioObj.header.gfx.pos.x, y = m.pos.y + 210, z = m.marioObj.header.gfx.pos.z }
|
||||||
djui_hud_world_pos_to_screen_pos(pos, out)
|
djui_hud_world_pos_to_screen_pos(pos, out)
|
||||||
|
|
||||||
local scale = MAX_SCALE
|
local scale = MAX_SCALE
|
||||||
|
@ -121,52 +108,49 @@ function on_hud_render()
|
||||||
scale = scale + vec3f_dist(gMarioStates[0].pos, m.pos) / gGlobalSyncTable.dist
|
scale = scale + vec3f_dist(gMarioStates[0].pos, m.pos) / gGlobalSyncTable.dist
|
||||||
scale = clamp(1 - scale, 0, MAX_SCALE)
|
scale = clamp(1 - scale, 0, MAX_SCALE)
|
||||||
end
|
end
|
||||||
local info = name_and_hex(gNetworkPlayers[i].name)
|
local name = name_without_hex(gNetworkPlayers[i].name)
|
||||||
local color = { r = 162, g = 202, b = 234 }
|
local color = { r = 162, g = 202, b = 234 }
|
||||||
network_player_palette_to_color(gNetworkPlayers[i], SHIRT, color)
|
network_player_palette_to_color(gNetworkPlayers[i], SHIRT, color)
|
||||||
local measure = djui_hud_measure_text(info.name) * scale * 0.5
|
local measure = djui_hud_measure_text(name) * scale * 0.5
|
||||||
djui_hud_print_outlined_text(info.name, out.x - measure, out.y, scale, color.r, color.g, color.b, 0.25)
|
local alpha = if_then_else(m.action ~= ACT_CROUCHING and m.action ~= ACT_START_CRAWLING and m.action ~= ACT_CRAWLING and m.action ~= ACT_STOP_CRAWLING, 255, 100)
|
||||||
|
djui_hud_print_outlined_text(name, out.x - measure, out.y, scale, color.r, color.g, color.b, alpha, 0.25)
|
||||||
|
|
||||||
|
if m.playerIndex ~= 0 and gGlobalSyncTable.health then
|
||||||
|
djui_hud_set_adjusted_color(255, 255, 255, alpha)
|
||||||
|
local healthScale = 75 * scale
|
||||||
|
hud_render_power_meter(m.health, out.x - (healthScale * 0.5), out.y - healthScale, healthScale, healthScale)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_nametags_command(msg)
|
|
||||||
if msg == "on" then
|
|
||||||
gGlobalSyncTable.nametags = true
|
|
||||||
djui_chat_message_create("Nametag status: \\#00ff00\\ON")
|
|
||||||
else
|
|
||||||
gGlobalSyncTable.nametags = false
|
|
||||||
djui_chat_message_create("Nametag status: \\#ff0000\\OFF")
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function on_nametag_distance_command(msg)
|
function on_nametag_distance_command(msg)
|
||||||
if tonumber(msg) ~= nil then
|
local dist = tonumber(msg)
|
||||||
djui_chat_message_create("Set distance to " .. msg)
|
if dist ~= nil then
|
||||||
gGlobalSyncTable.dist = tonumber(msg)
|
djui_chat_message_create("Set nametag distance to " .. msg)
|
||||||
else
|
gGlobalSyncTable.dist = dist
|
||||||
djui_chat_message_create("\\#ff0000\\Failed to set distance to " .. msg)
|
return true
|
||||||
end
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_show_health_command()
|
||||||
|
gGlobalSyncTable.health = not gGlobalSyncTable.health
|
||||||
|
djui_chat_message_create("Show health status: " .. on_or_off(gGlobalSyncTable.health))
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function on_show_my_tag_command(msg)
|
function on_show_tag_command()
|
||||||
if msg == "on" then
|
showSelfTag = not showSelfTag
|
||||||
showSelfTag = true
|
djui_chat_message_create("Show my tag status: " .. on_or_off(showSelfTag))
|
||||||
djui_chat_message_create("Show my tag status: \\#00ff00\\ON")
|
|
||||||
else
|
|
||||||
showSelfTag = false
|
|
||||||
djui_chat_message_create("Show my tag status: \\#ff0000\\OFF")
|
|
||||||
end
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
hook_event(HOOK_ON_HUD_RENDER, on_hud_render)
|
hook_event(HOOK_ON_HUD_RENDER, on_hud_render)
|
||||||
|
|
||||||
if network_is_server() then
|
if network_is_server() then
|
||||||
hook_chat_command("nametags", "[on|off] to turn nametags on or off, default is \\#00ff00\\ON", on_nametags_command)
|
hook_chat_command("nametag-distance", "[number] set the distance at which nametags disappear, default is 7000, 0 turns nametags off", on_nametag_distance_command)
|
||||||
hook_chat_command("nametag-distance", "[number] set the distance at which nametags disappear, default is 7000", on_nametag_distance_command)
|
hook_chat_command("show-health", "to toggle showing health above the nametag, default is \\#00ff00\\ON", on_show_health_command)
|
||||||
end
|
end
|
||||||
|
|
||||||
hook_chat_command("show-my-tag", "[on|off] to turn your own nametag on or off, default is \\#ff0000\\OFF", on_show_my_tag_command)
|
hook_chat_command("show-tag", "to toggle your own nametag on or off, default is \\#ff0000\\OFF", on_show_tag_command)
|
|
@ -1,7 +1,7 @@
|
||||||
-- name: Personal Star Counter EX+
|
-- name: Personal Star Counter EX+
|
||||||
-- description: See how many stars you collect!\nIdea by Mr.Needlemouse, created by Sunk\n\nModified by Demnyx.
|
-- description: See how many stars you collect!\nIdea by Mr.Needlemouse, created by Sunk\n\nModified by Demnyx.
|
||||||
if mod_storage_load("StarCounter") == nil then
|
if mod_storage_load("StarCounter") == nil then
|
||||||
mod_storage_save("StarCounter", "0")
|
mod_storage_save("StarCounter", "0")
|
||||||
end
|
end
|
||||||
|
|
||||||
local TotalStarCounter = tonumber(mod_storage_load("StarCounter"))
|
local TotalStarCounter = tonumber(mod_storage_load("StarCounter"))
|
||||||
|
@ -22,8 +22,8 @@ function localStarCounter(m, o, type)
|
||||||
--The hook happens after the star count increments, so this allows the independent counter to increment ONLY when YELLOW star is collected.
|
--The hook happens after the star count increments, so this allows the independent counter to increment ONLY when YELLOW star is collected.
|
||||||
if m.numStars ~= prevNumStars then
|
if m.numStars ~= prevNumStars then
|
||||||
StarCounter = StarCounter + 1
|
StarCounter = StarCounter + 1
|
||||||
TotalStarCounter = TotalStarCounter + 1
|
TotalStarCounter = TotalStarCounter + 1
|
||||||
mod_storage_save("StarCounter", tostring(TotalStarCounter))
|
mod_storage_save("StarCounter", tostring(TotalStarCounter))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -37,114 +37,114 @@ function djui_hud_set_adjusted_color(r, g, b, a)
|
||||||
end
|
end
|
||||||
|
|
||||||
function displayStarCounter()
|
function displayStarCounter()
|
||||||
local m = gMarioStates[0]
|
local m = gMarioStates[0]
|
||||||
if psToggle ~= 1 then return end
|
if psToggle ~= 1 then return end
|
||||||
if obj_get_first_with_behavior_id(id_bhvActSelector) ~= nil
|
if obj_get_first_with_behavior_id(id_bhvActSelector) ~= nil
|
||||||
or (m.action == ACT_END_PEACH_CUTSCENE
|
or (m.action == ACT_END_PEACH_CUTSCENE
|
||||||
or m.action == ACT_CREDITS_CUTSCENE
|
or m.action == ACT_CREDITS_CUTSCENE
|
||||||
or m.action == ACT_END_WAVING_CUTSCENE) then return end
|
or m.action == ACT_END_WAVING_CUTSCENE) then return end
|
||||||
|
|
||||||
djui_hud_set_resolution(RESOLUTION_N64)
|
djui_hud_set_resolution(RESOLUTION_N64)
|
||||||
djui_hud_set_font(FONT_HUD)
|
djui_hud_set_font(FONT_HUD)
|
||||||
|
|
||||||
--I don't want to put this in a seperate function, there's not enough code for it to be worth it.
|
--I don't want to put this in a seperate function, there's not enough code for it to be worth it.
|
||||||
if m.playerIndex == 0 then
|
if m.playerIndex == 0 then
|
||||||
prevNumStars = m.numStars
|
prevNumStars = m.numStars
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
screenHeight = djui_hud_get_screen_height()
|
screenHeight = djui_hud_get_screen_height()
|
||||||
screenWidth = djui_hud_get_screen_width()
|
screenWidth = djui_hud_get_screen_width()
|
||||||
|
|
||||||
if a == nil then
|
if a == nil then
|
||||||
a = 255
|
a = 255
|
||||||
|
end
|
||||||
|
|
||||||
|
if obj_get_first_with_behavior_id(id_bhvActSelector) ~= nil then
|
||||||
|
if a <= 255 and a > 32 then
|
||||||
|
a = a - 40
|
||||||
|
else
|
||||||
|
a = 0
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if a >= 0 and a < 215 then
|
||||||
|
a = a + 16
|
||||||
|
else
|
||||||
|
a = 255
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local timerValFrames = hud_get_value(HUD_DISPLAY_TIMER)
|
||||||
|
local timerX = 0
|
||||||
|
local timerY = 0
|
||||||
|
|
||||||
|
-- Move HUD graphics away from the TIMER HUD
|
||||||
|
if timerValFrames ~= 0 then
|
||||||
|
timerX = 60
|
||||||
|
timerY = 17
|
||||||
|
end
|
||||||
|
|
||||||
|
--Normal personal star counter
|
||||||
|
if StarCounter >= 100 then
|
||||||
|
djui_hud_set_adjusted_color(255, 255, 255, a)
|
||||||
|
djui_hud_print_text(tostring(StarCounter), screenWidth - 61 - timerX, screenHeight - 208 - timerY, 1)
|
||||||
|
djui_hud_set_adjusted_color(232, 17, 35, a)
|
||||||
|
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 208 - timerY, 1, 1)
|
||||||
|
else
|
||||||
|
djui_hud_set_adjusted_color(246, 246, 246, a)
|
||||||
|
djui_hud_print_text(tostring("X"), screenWidth - 61 - timerX, screenHeight - 208 - timerY, 1)
|
||||||
|
djui_hud_set_adjusted_color(255, 255, 255, a)
|
||||||
|
djui_hud_print_text(tostring(StarCounter), screenWidth - 46.8 - timerX, screenHeight - 208 - timerY, 1)
|
||||||
|
djui_hud_set_adjusted_color(232, 17, 35, a)
|
||||||
|
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 208 - timerY, 1, 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
if obj_get_first_with_behavior_id(id_bhvActSelector) ~= nil then
|
--Total star counter
|
||||||
if a <= 255 and a > 32 then
|
if timerValFrames ~= 0 then
|
||||||
a = a - 40
|
timerX = 0
|
||||||
else
|
timerY = -10
|
||||||
a = 0
|
end
|
||||||
end
|
|
||||||
else
|
|
||||||
if a >= 0 and a < 215 then
|
|
||||||
a = a + 16
|
|
||||||
else
|
|
||||||
a = 255
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local timerValFrames = hud_get_value(HUD_DISPLAY_TIMER)
|
local perceived_total_counter = TotalStarCounter
|
||||||
local timerX = 0
|
local milestone_counter = 0
|
||||||
local timerY = 0
|
while perceived_total_counter >= 10000 do
|
||||||
|
perceived_total_counter = perceived_total_counter - 10000
|
||||||
|
milestone_counter = milestone_counter + 1
|
||||||
|
end
|
||||||
|
|
||||||
-- Move HUD graphics away from the TIMER HUD
|
if perceived_total_counter >= 100 then
|
||||||
if timerValFrames ~= 0 then
|
djui_hud_set_adjusted_color(255, 255, 255, a)
|
||||||
timerX = 60
|
djui_hud_print_text(tostring(perceived_total_counter), screenWidth - 61 - timerX, screenHeight - 190 - timerY, 1)
|
||||||
timerY = 17
|
djui_hud_set_adjusted_color(50, 176, 40, a)
|
||||||
|
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 190 - timerY, 1, 1)
|
||||||
|
if milestone_counter ~= 0 then
|
||||||
|
djui_hud_set_adjusted_color(255, 255, 255, a)
|
||||||
|
djui_hud_print_text(string.format("x%d", milestone_counter), screenWidth - 77 - timerX, screenHeight - 174 - timerY, 0.5)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
djui_hud_set_adjusted_color(246, 246, 246, a)
|
||||||
|
djui_hud_print_text(tostring("X"), screenWidth - 61 - timerX, screenHeight - 190 - timerY, 1)
|
||||||
|
djui_hud_set_adjusted_color(255, 255, 255, a)
|
||||||
|
djui_hud_print_text(tostring(perceived_total_counter), screenWidth - 46.8 - timerX, screenHeight - 190 - timerY, 1)
|
||||||
|
djui_hud_set_adjusted_color(50, 176, 40, a)
|
||||||
|
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 190 - timerY, 1, 1)
|
||||||
|
if milestone_counter ~= 0 then
|
||||||
|
djui_hud_set_adjusted_color(255, 255, 255, a)
|
||||||
|
djui_hud_print_text(string.format("x%d", milestone_counter), screenWidth - 77 - timerX, screenHeight - 174 - timerY, 0.5)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
--StarCounter = 120
|
||||||
--Normal personal star counter
|
|
||||||
if StarCounter >= 100 then
|
|
||||||
djui_hud_set_adjusted_color(255, 246, 0, a)
|
|
||||||
djui_hud_print_text(tostring(StarCounter), screenWidth - 61 - timerX, screenHeight - 208 - timerY, 1)
|
|
||||||
djui_hud_set_adjusted_color(232, 17, 35, a)
|
|
||||||
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 208 - timerY, 1, 1)
|
|
||||||
else
|
|
||||||
djui_hud_set_adjusted_color(246, 246, 246, a)
|
|
||||||
djui_hud_print_text(tostring("X"), screenWidth - 61 - timerX, screenHeight - 208 - timerY, 1)
|
|
||||||
djui_hud_set_adjusted_color(255, 246, 0, a)
|
|
||||||
djui_hud_print_text(tostring(StarCounter), screenWidth - 46.8 - timerX, screenHeight - 208 - timerY, 1)
|
|
||||||
djui_hud_set_adjusted_color(232, 17, 35, a)
|
|
||||||
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 208 - timerY, 1, 1)
|
|
||||||
end
|
|
||||||
|
|
||||||
--Total star counter
|
|
||||||
if timerValFrames ~= 0 then
|
|
||||||
timerX = 0
|
|
||||||
timerY = -10
|
|
||||||
end
|
|
||||||
|
|
||||||
local perceived_total_counter = TotalStarCounter
|
|
||||||
local milestone_counter = 0
|
|
||||||
while perceived_total_counter >= 10000 do
|
|
||||||
perceived_total_counter = perceived_total_counter - 10000
|
|
||||||
milestone_counter = milestone_counter + 1
|
|
||||||
end
|
|
||||||
|
|
||||||
if perceived_total_counter >= 100 then
|
|
||||||
djui_hud_set_adjusted_color(255, 246, 0, a)
|
|
||||||
djui_hud_print_text(tostring(perceived_total_counter), screenWidth - 61 - timerX, screenHeight - 190 - timerY, 1)
|
|
||||||
djui_hud_set_adjusted_color(50, 176, 40, a)
|
|
||||||
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 190 - timerY, 1, 1)
|
|
||||||
if milestone_counter > 0 then
|
|
||||||
djui_hud_set_adjusted_color(246, 246, 246, a)
|
|
||||||
djui_hud_print_text(string.format("x%d", milestone_counter), screenWidth - 77 - timerX, screenHeight - 174 - timerY, 0.5)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
djui_hud_set_adjusted_color(246, 246, 246, a)
|
|
||||||
djui_hud_print_text(tostring("X"), screenWidth - 61 - timerX, screenHeight - 190 - timerY, 1)
|
|
||||||
djui_hud_set_adjusted_color(255, 246, 0, a)
|
|
||||||
djui_hud_print_text(tostring(perceived_total_counter), screenWidth - 46.8 - timerX, screenHeight - 190 - timerY, 1)
|
|
||||||
djui_hud_set_adjusted_color(50, 176, 40, a)
|
|
||||||
djui_hud_render_texture(gTextures.star, screenWidth - 77 - timerX, screenHeight - 190 - timerY, 1, 1)
|
|
||||||
if milestone_counter > 0 then
|
|
||||||
djui_hud_set_adjusted_color(246, 246, 246, a)
|
|
||||||
djui_hud_print_text(string.format("x%d", milestone_counter), screenWidth - 77 - timerX, screenHeight - 174 - timerY, 0.5)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
--StarCounter = 120
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function PSToggle(msg)
|
function PSToggle(msg)
|
||||||
if msg == string.lower("On") or msg == "1" then
|
if msg == string.lower("On") or msg == "1" then
|
||||||
psToggle = 1
|
psToggle = 1
|
||||||
return true
|
return true
|
||||||
elseif msg == string.lower("Off") or msg == "0" then
|
elseif msg == string.lower("Off") or msg == "0" then
|
||||||
psToggle = 0
|
psToggle = 0
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
---------
|
---------
|
||||||
|
|
Loading…
Reference in New Issue