Preparing the UI

Post all of your progress here about official assets, and receive feedback from our team.
Post Reply
User avatar
SuperDupont
Dretch
Posts: 46
Joined: Sat Jun 26, 2021 10:21 pm UTC

Preparing the UI

Post by SuperDupont »

Hi!

I started working on a gAWK script, to help create web page from UI to view on web browser.

Actually, the script only search and duplicate with new extension all files with extension .rml and .rcss to make .html and .css respectively.

This script intend to be run in /pkg/unvanquished_src.dpkdir/ui/

Code: Select all

#!/bin/awk
# By SuperDupont
# 2022.02.16
# Work in progress
# Version 0.2
# Licence : Creative Commons Attribution Share Alike 
function namefile(file) {
	sub(".*/", "", file)
	return file
}

function notlastpart(path,delimit) { # This function is used by pathfile and extname
	# init
	split("",tab)
	split(path,tab,delimit)
	path = ""
	#The last part won't be keep
	for (i=1;i<=length(tab)-1;++i){
		path = path tab[i] delimit
	}
	return path
}
function pathfile(file) {
	return notlastpart(file,"/")
}
function extname(file) {
	return notlastpart(file,".")
}
function searchingfile(ext) {
	# init
	split("",listfiles)
	print "Searching files... (*." ext ")"
	cmd = "find . -type f -iname '*." ext "' -printf '%h/%f;'"
	cmd | getline liste ; close("cmd")
	split(liste,lfiles,";")
	for (indexvar in lfiles) {
		realpath = lfiles[indexvar]
		if (realpath != "") {
			print "Preparing file ",indexvar," : ",realpath
			listfiles[indexvar] = realpath
		}
	}
	return
}
function copy2ext(file,ext) {
		filename = namefile(file)
		shortname = extname(filename)
		path = pathfile(file)
		target = path shortname ext
		print "$: cp " file " -> " target
		cmd = "cp " file " " target
		system(cmd)
}
BEGIN{
	#print "Searching files... (*.rml *.rcss)"
	# Les tableaux des fichiers rml et rcss
	# cmd = "find . -type f -iname '*.rml' -printf '%h/%f;'"
	# cmd | getline liste ; close("cmd")
	searchingfile("rml")
	print "Copying files with new extension"
	for (indexvar in listfiles) {
		file = listfiles[indexvar]
		print "file ",indexvar," : ",file
		copy2ext(file,"html")
	}
	

	searchingfile("rcss")
	print "Copying files with new extension"
	for (indexvar in listfiles) {
		file = listfiles[indexvar]
		print "file ",indexvar," : ",file
		copy2ext(file,"css")
	}
	
	
	
	exit
}
#=patern={
#}
END{
}
User avatar
SuperDupont
Dretch
Posts: 46
Joined: Sat Jun 26, 2021 10:21 pm UTC

Re: Preparing the UI

Post by SuperDupont »

User avatar
killing time
Programmer
Posts: 162
Joined: Wed Jul 04, 2012 7:55 am UTC

Re: Preparing the UI

Post by killing time »

I tried it on help_gameplay.rml and it looks like mostly unformatted text, I guess because imports aren't implemented.

The libRocket/RmlUi CSS engines don't adhere very closely to the CSS standard, so unfortunately there are too many differences between them and browsers for working in a browser to be a useful development methodology.
User avatar
SuperDupont
Dretch
Posts: 46
Joined: Sat Jun 26, 2021 10:21 pm UTC

Re: Preparing the UI

Post by SuperDupont »

I wrote there is ever a tool for this :

https://mikke89.github.io/RmlUiDoc/page ... cmake.html
https://mikke89.github.io/RmlUiDoc/index.html

So, I stopped what I started to do. There is ever a tool for this. Isn't it?
Post Reply