Compare commits
	
		
			6 Commits
		
	
	
		
			2dc89b43f0
			...
			c15ce57d1b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					c15ce57d1b | ||
| 
						 | 
					a941a2c562 | ||
| 
						 | 
					87049e2782 | ||
| 
						 | 
					f70cb29214 | ||
| 
						 | 
					be05b2a865 | ||
| 
						 | 
					639dab4da5 | 
							
								
								
									
										41
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						@@ -79,7 +79,6 @@ local PNG = {
 | 
			
		||||
	bg = "craftguide_bg.png",
 | 
			
		||||
	bg_full = "craftguide_bg_full.png",
 | 
			
		||||
	search = "craftguide_search_icon.png",
 | 
			
		||||
	clear = "craftguide_clear_icon.png",
 | 
			
		||||
	prev = "craftguide_next_icon.png^\\[transformFX",
 | 
			
		||||
	next = "craftguide_next_icon.png",
 | 
			
		||||
	arrow = "craftguide_arrow.png",
 | 
			
		||||
@@ -87,12 +86,12 @@ local PNG = {
 | 
			
		||||
	fire_anim = "craftguide_fire_anim.png",
 | 
			
		||||
	book = "craftguide_book.png",
 | 
			
		||||
	sign = "craftguide_sign.png",
 | 
			
		||||
	nothing = "craftguide_no.png",
 | 
			
		||||
	cancel = "craftguide_cancel.png",
 | 
			
		||||
	selected = "craftguide_selected.png",
 | 
			
		||||
	furnace_anim = "craftguide_furnace_anim.png",
 | 
			
		||||
 | 
			
		||||
	cancel_hover = "craftguide_cancel.png^\\[brighten",
 | 
			
		||||
	search_hover = "craftguide_search_icon_hover.png",
 | 
			
		||||
	clear_hover = "craftguide_clear_icon_hover.png",
 | 
			
		||||
	prev_hover = "craftguide_next_icon_hover.png^\\[transformFX",
 | 
			
		||||
	next_hover = "craftguide_next_icon_hover.png",
 | 
			
		||||
}
 | 
			
		||||
@@ -120,8 +119,8 @@ local styles = sprintf([[
 | 
			
		||||
		   sound=craftguide_click]
 | 
			
		||||
 | 
			
		||||
	style[filter;border=false]
 | 
			
		||||
	style[cancel;fgimg=%s;fgimg_hovered=%s;fgimg_pressed=%s]
 | 
			
		||||
	style[search;fgimg=%s;fgimg_hovered=%s]
 | 
			
		||||
	style[clear;fgimg=%s;fgimg_hovered=%s]
 | 
			
		||||
	style[prev_page;fgimg=%s;fgimg_hovered=%s;fgimg_pressed=%s]
 | 
			
		||||
	style[next_page;fgimg=%s;fgimg_hovered=%s;fgimg_pressed=%s]
 | 
			
		||||
	style[prev_recipe;fgimg=%s;fgimg_hovered=%s;fgimg_pressed=%s]
 | 
			
		||||
@@ -134,8 +133,8 @@ local styles = sprintf([[
 | 
			
		||||
	      bgimg_pressed=craftguide_btn9_pressed.png;bgimg_middle=4,6]
 | 
			
		||||
]],
 | 
			
		||||
PNG.selected, PNG.selected,
 | 
			
		||||
PNG.cancel, PNG.cancel_hover, PNG.cancel_hover,
 | 
			
		||||
PNG.search, PNG.search_hover,
 | 
			
		||||
PNG.clear, PNG.clear_hover,
 | 
			
		||||
PNG.prev, PNG.prev_hover, PNG.prev_hover,
 | 
			
		||||
PNG.next, PNG.next_hover, PNG.next_hover,
 | 
			
		||||
PNG.prev, PNG.prev_hover, PNG.prev_hover,
 | 
			
		||||
@@ -227,6 +226,13 @@ local group_names = {
 | 
			
		||||
craftguide.model_alias = {
 | 
			
		||||
	["boats:boat"] = {name = "boats:boat", drawtype = "entity"},
 | 
			
		||||
	["carts:cart"] = {name = "carts:cart", drawtype = "entity", frames = "0,0"},
 | 
			
		||||
	["default:chest"] = {name = "default:chest_open"},
 | 
			
		||||
	["default:chest_locked"] = {name = "default:chest_locked_open"},
 | 
			
		||||
	["doors:door_wood"] = {name = "doors:door_wood_a"},
 | 
			
		||||
	["doors:door_glass"] = {name = "doors:door_glass_a"},
 | 
			
		||||
	["doors:door_obsidian_glass"] = {name = "doors:door_obsidian_glass_a"},
 | 
			
		||||
	["doors:door_steel"] = {name = "doors:door_steel_a"},
 | 
			
		||||
	["xpanes:door_steel_bar"] = {name = "xpanes:door_steel_bar_a"},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local function err(str)
 | 
			
		||||
@@ -1340,7 +1346,7 @@ local function get_model_fs(fs, data, def, model_alias)
 | 
			
		||||
 | 
			
		||||
	fs(fmt("model",
 | 
			
		||||
		data.xoffset + 6.6, data.yoffset + 0.05, 1.3, 1.3, "",
 | 
			
		||||
		def.mesh, concat(t, ","), model_alias.frames or ""))
 | 
			
		||||
		def.mesh, concat(t, ","), model_alias and model_alias.frames or ""))
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local function get_title_fs(fs, data)
 | 
			
		||||
@@ -1357,7 +1363,7 @@ local function get_title_fs(fs, data)
 | 
			
		||||
		   sprintf("tooltip[fav;%s]", fav and ES"Unmark this item" or ES"Mark this item"))
 | 
			
		||||
	else
 | 
			
		||||
		fs(sprintf("style[nofav;fgimg=%s;fgimg_hovered=%s;fgimg_pressed=%s]",
 | 
			
		||||
			"craftguide_fav_off.png", PNG.nothing, PNG.nothing),
 | 
			
		||||
			"craftguide_fav_off.png", PNG.cancel, PNG.cancel),
 | 
			
		||||
		   fmt("image_button", star_x, star_y, star_size, star_size, "", "nofav", ""),
 | 
			
		||||
		   sprintf("tooltip[nofav;%s]", ES"Cannot mark this item. Bookmark limit reached."))
 | 
			
		||||
	end
 | 
			
		||||
@@ -1528,13 +1534,16 @@ local function make_fs(data)
 | 
			
		||||
	fs(fmt("bg9", 0, 0, data.xoffset, LINES + 1.7, PNG.bg_full, 10))
 | 
			
		||||
 | 
			
		||||
	fs(sprintf([[
 | 
			
		||||
		box[0.2,0.2;3.5,0.6;#bababa25]
 | 
			
		||||
		box[0.2,0.2;4,0.6;#bababa25]
 | 
			
		||||
		set_focus[filter]
 | 
			
		||||
		field[0.2,0.2;3.5,0.6;filter;;%s]
 | 
			
		||||
		field[0.3,0.2;3.4,0.6;filter;;%s]
 | 
			
		||||
		field_close_on_enter[filter;false]
 | 
			
		||||
	   ]], ESC(data.filter)),
 | 
			
		||||
	   fmt("image_button", 3.75, 0.15, 0.7, 0.7, "", "search", ""),
 | 
			
		||||
	   fmt("image_button", 4.43, 0.15, 0.7, 0.7, "", "clear", ""))
 | 
			
		||||
	   fmt("image_button", 4.25, 0.14, 0.7, 0.7, "", "search", ""))
 | 
			
		||||
 | 
			
		||||
	if data.filter ~= "" then
 | 
			
		||||
		fs(fmt("image_button", 3.75, 0.35, 0.3, 0.3, PNG.cancel, "cancel", ""))
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	fs(fmt("image_button", data.xoffset - 3.2, 0.15, 0.7, 0.7, "", "prev_page", ""),
 | 
			
		||||
	   fmt("image_button", data.xoffset - 0.7, 0.15, 0.7, 0.7, "", "next_page", ""))
 | 
			
		||||
@@ -1851,7 +1860,7 @@ local function fields(player, _f)
 | 
			
		||||
	local data = pdata[name]
 | 
			
		||||
	local sb_rcp, sb_usg = _f.scrbar_rcp, _f.scrbar_usg
 | 
			
		||||
 | 
			
		||||
	if _f.clear then
 | 
			
		||||
	if _f.cancel then
 | 
			
		||||
		reset_data(data)
 | 
			
		||||
 | 
			
		||||
	elseif _f.prev_recipe or _f.next_recipe then
 | 
			
		||||
@@ -1903,8 +1912,16 @@ local function fields(player, _f)
 | 
			
		||||
	elseif _f.export_rcp or _f.export_usg then
 | 
			
		||||
		if _f.export_rcp then
 | 
			
		||||
			data.export_rcp = not data.export_rcp
 | 
			
		||||
 | 
			
		||||
			if not data.export_rcp then
 | 
			
		||||
				data.scrbar_rcp = 1
 | 
			
		||||
			end
 | 
			
		||||
		else
 | 
			
		||||
			data.export_usg = not data.export_usg
 | 
			
		||||
 | 
			
		||||
			if not data.export_usg then
 | 
			
		||||
				data.scrbar_usg = 1
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
	elseif (sb_rcp and sub(sb_rcp, 1, 3) == "CHG") or (sb_usg and sub(sb_usg, 1, 3) == "CHG") then
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								screenshot.png
									
									
									
									
									
								
							
							
						
						| 
		 Before Width: | Height: | Size: 35 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								textures/craftguide_cancel.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.2 KiB  | 
| 
		 Before Width: | Height: | Size: 4.1 KiB  | 
| 
		 Before Width: | Height: | Size: 5.0 KiB  | 
| 
		 Before Width: | Height: | Size: 1.6 KiB  | 
| 
		 Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 13 KiB  | 
| 
		 Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 14 KiB  |