Jump to content

Wyświetlenie zegara na HUD'zie [CoP]


Recommended Posts

NAZWA: Wyświetlenie zegara na HUD'zie [CoP]
AUTOR: Steelrat

 

POTRZEBNE PLIKI:

Spoiler
  • gamedata\configs\ui\ui_custom_msgs.xml
  • gamedata\scripts\bind_stalker.script

 

ZMIANY W PLIKACH:

Spoiler

1. WASZA_NAZWA_SKRYPTU.SCRIPT W FOLDERZE GAMEDATA\SCRIPTS:

Spoiler

Piszemy w pliku:

function show_time()
local hud = get_hud()
local cs = hud:GetCustomStatic("hud_show_time")
if cs == nil then
hud:AddCustomStatic("hud_time_static", true)
hud:AddCustomStatic("hud_show_time", true)
cs = hud:GetCustomStatic("hud_show_time")
end[/color]

[color=green]local time_h = level.get_time_hours()
local time_m = level.get_time_minutes()
local msg
if time_m >= 10 then
msg = string.format(" %02d:%02d\n", time_h, time_m)
else
msg = string.format(" %02d:%02d\n", time_h, time_m)
end

if cs ~= nil then cs:wnd():SetText(msg) end
end

 

 

2. UI_CUSTOM_MSGS.XML:

Spoiler

Piszemy w pliku:

<hud_time_static x="852" y="17" width="156" height="52">
<text complex_mode="0" x="65" y="0" font="letterica16" r="255" g="255" b="255" a="130">Time</text>
<texture>ui_hud_frame_clock</texture>
</hud_time_static>
<hud_show_time x="862" y="38" width="156" height="52">
<text x="0" y="0" font="graffiti19" r="255" g="255" b="255" a="140" align="c"/>
</hud_show_time>

 

 

3. BIND_STALKER.SCRIPT:

Spoiler

Po tym:

function actor_binder:update(delta)
object_binder.update(self, delta)
local time = time_global()
game_stats.update (delta, self.object)

piszemy linijkę:

wasza_nazwa_skryptu.show_time()

 

 

 

ŹRÓDŁO:

https://ap-pro.ru/forums/topic/1584-cop-vyvodim-chasy-na-hud/

  • Important 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.