add optional colorfx to text brick
This commit is contained in:
		| @@ -31,11 +31,11 @@ datablock fxDTSBrickData(LogicGate_TextBrick2_Data){ | ||||
| lualogic_registergatedefinition("LogicGate_TextBrick2_Data"); | ||||
|  | ||||
| function LogicGate_TextBrick2_Data::LuaLogic_Callback(%data, %brick, %arg) { | ||||
| 	%colorId = getWord(%arg, 0); | ||||
| 	if(%colorId != -1) %brick.setColor(%colorId); | ||||
| 	%colorId = getWord(%arg, 0); if(%colorId != -1) %brick.setColor  (%colorId); | ||||
| 	//%colorFx = getWord(%arg, 3); if(%colorFx != -1) %brick.setColorFx(%colorFx); | ||||
| 	%domain = getWord(%arg, 1); | ||||
| 	%print  = getWord(%arg, 2); | ||||
| 	if(%domain !$= "_" && %print !$= "") %brick.setPrint(lualogic_getprint(%print, %domain)); | ||||
| 	if(%domain !$= "_" && %print !$= "_") %brick.setPrint(lualogic_getprint(%print, %domain)); | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -20,15 +20,17 @@ local function getBit(gate, val) | ||||
| 			local iscolor = math.floor(v/256)==1 -- first bit | ||||
| 			if iscolor then | ||||
| 				local printdomain = (math.floor(v/128)%2)==1 and "terminalInv" or "terminal" -- 8th lowest bit | ||||
| 				local colorfx = (math.floor(v/64)%2)==1 and 3 or 0 -- 7th lowest bit | ||||
| 				local colorid = v % 64 -- last 6 bits | ||||
| 				gatedata.printdomain = printdomain | ||||
| 				gatedata.colorid = colorid | ||||
| 				gatedata.colorfx = colorfx | ||||
| 			else | ||||
| 				local printid     = v % 256 -- last 8 bits | ||||
| 				local printname   = textbrick2_idxToPrint[printid] or "space" | ||||
| 				gatedata.printname = printname | ||||
| 			end | ||||
| 			Gate.cb(gate, (gatedata.colorid or -1).." "..(gatedata.printdomain or "terminal").." "..(gatedata.printname or "_")) | ||||
| 			Gate.cb(gate, (gatedata.colorid or -1).." "..(gatedata.printdomain or "terminal").." "..(gatedata.printname or "_")).." "..(gatedata.colorfx or -1) | ||||
| 		end | ||||
| 		 | ||||
| 		gatedata.listenState = "wait" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Redo
					Redo