ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Overlay texture (via AddCustomStatic) not showing in Inventory ?

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  14:00:49  7 November 2014
profilee-mailreply Message URLTo the Top
svartberg
(Novice)
 
On forum: 10/26/2014
 

Message edited by:
svartberg
11/07/2014 14:01:38
Messages: 42
Overlay texture (via AddCustomStatic) not showing in Inventory ?

I'm adding overlay textures for some blood effects ingame
Using get_hud():AddCustomStatic(bla)

Works great, but when i open inventory the overlay textures are gone (and immediately re-appear when inventory is closed)

Is there any way to show overlay textures in Inventory as well ?
  07:27:43  8 November 2014
profilee-mailreply Message URLTo the Top
svartberg
(Novice)
 
On forum: 10/26/2014
 

Message edited by:
svartberg
11/08/2014 12:58:29
Messages: 42
Ok great I was able to get something working with a custom hud window (that's the CUIScriptWnd class)
Basically textures pre-set via xml, then I show/hide them from script

One problem though, for some reason it is drawn over everything in main game (radar, etc) .. but in inventory it works great (under the inventory & radar windows)

I call hud window create function from stalker_generic
How can I set it so it's under the HUD elements in main game ?





bind_stalker.script
function actor_binder:net_spawn(data)

	...

	blood_hud.add_custom_hud()

	return true 
end


main script
class "blood_hud_cui" (CUIScriptWnd)

function blood_hud_cui:__init() super()
  self:InitControls()
end

function blood_hud_cui:__finalize()

end

function blood_hud_cui:InitControls()

	self:SetWndRect(Frect():set(0,0,1024,768))
	  
	local xml = CScriptXmlInit()
	xml:ParseFile("ui_blood_hud.xml")
	
	self.blood_l = {}
	self.blood_v = {}
	
	self.blood_l[0] = 		xml:InitStatic ("blood1", self)
	self.blood_l[1] = 		xml:InitStatic ("blood2", self)
	self.blood_l[2] = 		xml:InitStatic ("blood3", self)
	self.blood_l[3] = 		xml:InitStatic ("blood4", self)
	self.blood_l[4] = 		xml:InitStatic ("blood5", self)	
	self.blood_v[0] = 		xml:InitStatic ("bloodv1", self)
	self.blood_v[1] = 		xml:InitStatic ("bloodv2", self)
	
	self.blood_l[0]:Show (false)
	self.blood_l[1]:Show (false)
	self.blood_l[2]:Show (false)
	self.blood_l[3]:Show (false)
	--self.blood_l[4]:Show (false)
	self.blood_v[0]:Show (false)
	self.blood_v[1]:Show (false)
	  
end

local blood_container = nil
function add_custom_hud()
  if not blood_container then
    blood_container = blood_hud_cui()
    get_hud():AddDialogToRender(blood_container)
  end
end

function remove_custom_hud()
  if blood_container ~= nil then
    get_hud():RemoveDialogToRender(blood_container)
    blood_container = nil
  end
end

  07:07:40  9 November 2014
profilee-mailreply Message URLTo the Top
svartberg
(Novice)
 
On forum: 10/26/2014
 

Message edited by:
svartberg
11/09/2014 7:08:22
Messages: 42
I hacked up having two blood overlays using both methods, and showing/hiding them depending on which menu the player in.

But honestly I think it will be better to just have the blood overlay cuiscriptwnd thing.
Also have it over everything including inventory/scope/trading/dialogue/pda. (game isn't paused in these menues, can still bleed to death)
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2021 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.