Jump to content

Texto personalizado en menú de animaciones de freeroam


Recommended Posts

Hola! ¿Cómo puedo colocar un texto personalizado para identificar una animación en el menú freeroam de f1? como el menú de skins que tiene el resource freeroam tiene nombres de identificación.

Por ejemplo: estoy en las animaciones BAR del menú anim de f1, pero te dice los nombres internos de las animaciones y yo quiero un nombre personalizado para activar esa animación.

 

9I41eGy.png

Ahí aparecen los nombres internos. Pero yo quiero colocarles a todas o casi todas las animaciones un nombre personalizado para activar esas animaciones.

Link to comment

Creo que a esto referís :b

Debes modificar el fr_client.lua y reemplazarlo por esto

function applyAnimation(leaf)
	if type(leaf) ~= 'table' then
		leaf = getSelectedGridListLeaf(wndAnim, 'animlist')
		if not leaf then
			return
		end
	end
	server.setPedAnimation(g_Me, leaf.parent.name, leaf.id, true, true)
end

wndAnim = {
	'wnd',
	text = 'Set animation',
	width = 250,
	x = -20,
	y = 0.3,
	controls = {
		{
			'lst',
			id='animlist',
			width=230,
			height=290,
			columns={
				{text='Animation', attr='name'}
			},
			rows={xml='animations.xml', attrs={'name', 'id'}},
			expandlastlevel=false,
			onitemdoubleclick=applyAnimation
		},
		{'btn', id='set', onclick=applyAnimation},
		{'btn', id='stop', onclick=stopAnimation},
		{'btn', id='close', closeswindow=true}
	}
}

Y en el animation.xml debes usarlo así
 

<group name="AIRPORT">
		<anim name="animacion" id="thrw_barl_thrw"/>
</group>

 

Edited by #Dv^
  • Like 1
Link to comment
  Reveal hidden contents

 

Link to comment

En 'animations.xml' todas las animaciones debe tener su id, por eso sale el Warning

  Quote

<anim name="Stepsit_in" id="Stepsit_in" />

Expand  

PD: Sino usa esté código si no quieres que todas tengan una 'nombre' personalizado

function applyAnimation(leaf)
	if type(leaf) ~= 'table' then
		leaf = getSelectedGridListLeaf(wndAnim, 'animlist')
		if not leaf then
			return
		end
	end
	if leaf.id then
		server.setPedAnimation(g_Me, leaf.parent.name, leaf.id, true, true)
	else
		server.setPedAnimation(g_Me, leaf.parent.name, leaf.name, true, true)
	end
end

 

Edited by #Dv^
  • Like 1
Link to comment
 {'lbl', id='name'},  
function toggleFRWindow()
	if isWindowOpen(wndMain) then
		showCursor(false)
		hideAllWindows()
		colorPicker.closeSelect()
	else
		showCursor(true)
		showAllWindows()
		setControlText(wndMain, 'name', getPlayerName(localPlayer))
	end
end

 

Link to comment
function RemoveHEXColorCode( s ) 
    return s:gsub( '#%x%x%x%x%x%x', '' ) or s 
end 

function toggleFRWindow()
	if isWindowOpen(wndMain) then
		showCursor(false)
		hideAllWindows()
		colorPicker.closeSelect()
	else
		showCursor(true)
		showAllWindows()
		setControlText(wndMain, 'name', RemoveHEXColorCode(getPlayerName(localPlayer)))
	end
end

 

  • Like 1
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...