Skip to content
Snippets Groups Projects
Commit 5686ca58 authored by dg's avatar dg
Browse files

Two new game options to control the number of rows in the icons toolbar and...

Two new game options to control the number of rows in the icons toolbar and the size of those icons. Yes you can now see all your hotkeys at once if you wish!


git-svn-id: http://svn.net-core.org/repos/t-engine4@4627 51575b47-30f0-44d4-a5cc-537603b46e54
parent 10501aa4
No related branches found
No related tags found
No related merge requests found
......@@ -238,7 +238,7 @@ function _M:onMouse(button, mx, my, click, on_over, on_click)
local drag = game.mouse.dragged.payload
print(table.serialize(drag,nil,true))
if drag.kind == "talent" or drag.kind == "inventory" then
local i = math.floor(mx / self.frames.w) + (self.actor.hotkey_page-1) * 12 + 1
local i = math.floor(mx / self.frames.w) + (self.actor.hotkey_page-1) * 12 + 1 + math.floor(my / self.frames.h) * self.max_cols
local old = self.actor.hotkey[i]
if i <= #page_to_hotkey * 12 then -- Only add this hotkey if we support a valid page for it.
......
......@@ -80,13 +80,17 @@ faction_danger_check = function(self, e) return e.unique end
-- @param fontname font parameters, can be nil
-- @param fontsize font parameters, can be nil
function _M:setViewPort(x, y, w, h, tile_w, tile_h, fontname, fontsize, allow_backcolor)
local otw, oth = self.tile_w, self.tile_h
local ovw, ovh = self.viewport and self.viewport.width, self.viewport and self.viewport.height
self.allow_backcolor = allow_backcolor
self.display_x, self.display_y = math.floor(x), math.floor(y)
self.viewport = {width=math.floor(w), height=math.floor(h), mwidth=math.floor(w/tile_w), mheight=math.floor(h/tile_h)}
self.tile_w, self.tile_h = tile_w, tile_h
self.fontname, self.fontsize = fontname, fontsize
self:resetTiles()
self.zoom = 1
if otw ~= self.tile_w or oth ~= self.tile_h then print("[MAP] Reseting tiles caches") self:resetTiles() end
end
--- Sets zoom level
......
This diff is collapsed.
......@@ -226,6 +226,32 @@ function _M:generateList()
self.c_list:drawItem(item)
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Number of rows to show in the icons hotkeys toolbar.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Icons hotkey toolbar rows#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.hotkey_icons_rows)
end, fct=function(item)
game:registerDialog(GetQuantity.new("Number of icons rows", "From 1 to 4", config.settings.tome.hotkey_icons_rows, 4, function(qty)
qty = util.bound(qty, 1, 4)
game:saveSettings("tome.hotkey_icons_rows", ("tome.hotkey_icons_rows = %d\n"):format(qty))
config.settings.tome.hotkey_icons_rows = qty
game:resizeIconsHotkeysToolbar()
self.c_list:drawItem(item)
end, 1))
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Size of the icons in the hotkeys toolbar.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Icons hotkey toolbar icon size#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.hotkey_icons_size)
end, fct=function(item)
game:registerDialog(GetQuantity.new("Icons size", "From 32 to 64", config.settings.tome.hotkey_icons_size, 64, function(qty)
qty = util.bound(qty, 32, 64)
game:saveSettings("tome.hotkey_icons_size", ("tome.hotkey_icons_size = %d\n"):format(qty))
config.settings.tome.hotkey_icons_size = qty
game:resizeIconsHotkeysToolbar()
self.c_list:drawItem(item)
end, 32))
end,}
local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"New games begin with some talent points auto-assigned.#WHITE#"}
list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Auto-assign talent points at birth#WHITE##{normal}#", status=function(item)
return tostring(config.settings.tome.autoassign_talents_on_birth and "enabled" or "disabled")
......
......@@ -72,6 +72,8 @@ if not config.settings.tome.ui_theme2 then config.settings.tome.ui_theme2 = "met
if not config.settings.tome.log_lines then config.settings.tome.log_lines = 5 end
if not config.settings.tome.log_fade then config.settings.tome.log_fade = 3 end
if not config.settings.tome.scroll_dist then config.settings.tome.scroll_dist = 8 end
if not config.settings.tome.hotkey_icons_rows then config.settings.tome.hotkey_icons_rows = 1 end
if not config.settings.tome.hotkey_icons_size then config.settings.tome.hotkey_icons_size = 48 end
Map.smooth_scroll = config.settings.tome.smooth_move
Map.faction_danger_check = function(self, e) return e.rank > 3 end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment