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

move

git-svn-id: http://svn.net-core.org/repos/t-engine4@2919 51575b47-30f0-44d4-a5cc-537603b46e54
parent fae1934b
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 51 deletions
......@@ -38,7 +38,7 @@ _M.font_bold = core.display.newFont("/data/font/VeraBd.ttf", 12)
_M.font_bold_h = _M.font_bold:lineSkip()
-- Default UI
_M.ui = "simple"
_M.ui = "stone"
_M.defaultui = "stone"
_M.ui_conf = {
......@@ -104,13 +104,14 @@ function _M:getImage(file, noerror)
end
function _M:getUITexture(file)
if tcache[file] then return tcache[file] end
local i, w, h = self:getImage((self.ui ~= "" and self.ui.."-" or "")..file, true)
local uifile = (self.ui ~= "" and self.ui.."-" or "")..file
if tcache[uifile] then return tcache[uifile] end
local i, w, h = self:getImage(uifile, true)
if not i then i, w, h = self:getImage(self.defaultui.."-"..file) end
if not i then error("bad UI texture: "..file) return end
if not i then error("bad UI texture: "..uifile) return end
local t, tw, th = i:glTexture()
local r = {t=t, w=w, h=h, tw=tw, th=th}
tcache[file] = r
tcache[uifile] = r
return r
end
......
......@@ -80,17 +80,33 @@ function _M:init()
end
function _M:run()
local size, size_mono, font, font_mono
local flysize = ({normal=14, small=12, big=16})[config.settings.tome.fonts.size]
if config.settings.tome.fonts.type == "fantasy" then
size = ({normal=16, small=14, big=18})[config.settings.tome.fonts.size]
size_mono = ({normal=14, small=10, big=16})[config.settings.tome.fonts.size]
font = "/data/font/USENET_.ttf"
font_mono = "/data/font/SVBasicManual.ttf"
else
size = ({normal=12, small=10, big=14})[config.settings.tome.fonts.size]
size_mono = ({normal=12, small=10, big=14})[config.settings.tome.fonts.size]
font = "/data/font/Vera.ttf"
font_mono = "/data/font/VeraMono.ttf"
end
self.delayed_log_damage = {}
self.calendar = Calendar.new("/data/calendar_allied.lua", "Today is the %s %s of the %s year of the Age of Ascendancy of Maj'Eyal.\nThe time is %02d:%02d.", 122, 167, 11)
self.flash = LogFlasher.new(0, 0, self.w, 20, nil, "/data/font/USENET_.ttf", 16, {255,255,255}, {0,0,0})
self.logdisplay = LogDisplay.new(0, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, nil, "/data/font/USENET_.ttf", 15, {255,255,255}, "/data/gfx/ui/message-log.png")
profile.chat:resize(0, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, "/data/font/USENET_.ttf", 15, {255,255,255}, "/data/gfx/ui/message-log.png")
self.player_display = PlayerDisplay.new(0, 230, 200, self.h * 0.8 - 230, {30,30,0})
self.hotkeys_display = HotkeysDisplay.new(nil, self.w * 0.5 + 46, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, "/data/gfx/ui/talents-list.png", "/data/font/SVBasicManual.ttf", 14)
self.npcs_display = ActorsSeenDisplay.new(nil, self.w * 0.5 + 46, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, "/data/gfx/ui/talents-list.png", "/data/font/SVBasicManual.ttf", 14)
self.tooltip = Tooltip.new("/data/font/SVBasicManual.ttf", 16, {255,255,255}, {30,30,30,230})
self.tooltip2 = Tooltip.new("/data/font/SVBasicManual.ttf", 16, {255,255,255}, {30,30,30,230})
self.flyers = FlyingText.new("/data/font/INSULA__.ttf", 14, "/data/font/INSULA__.ttf", 17)
self.player_display = PlayerDisplay.new(0, 230, 200, self.h * 0.8 - 230, {30,30,0}, font_mono, size_mono)
self.flash = LogFlasher.new(0, 0, self.w, 20, nil, font, size, {255,255,255}, {0,0,0})
self.logdisplay = LogDisplay.new(0, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, nil, font, size, {255,255,255}, "/data/gfx/ui/message-log.png")
profile.chat:resize(0, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, font, size, {255,255,255}, "/data/gfx/ui/message-log.png")
self.hotkeys_display = HotkeysDisplay.new(nil, self.w * 0.5 + 46, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, "/data/gfx/ui/talents-list.png", font_mono, size_mono)
self.npcs_display = ActorsSeenDisplay.new(nil, self.w * 0.5 + 46, self.h * 0.8 + 7, self.w * 0.5 - 46, self.h * 0.2 - 7, "/data/gfx/ui/talents-list.png", font_mono, size_mono)
self.tooltip = Tooltip.new(font_mono, size, {255,255,255}, {30,30,30,230})
self.tooltip2 = Tooltip.new(font_mono, size, {255,255,255}, {30,30,30,230})
self.flyers = FlyingText.new("/data/font/INSULA__.ttf", flysize, "/data/font/INSULA__.ttf", flysize + 3)
self:setFlyingText(self.flyers)
self.minimap_bg, self.minimap_bg_w, self.minimap_bg_h = core.display.loadImage("/data/gfx/ui/minimap.png"):glTexture()
self.nicer_tiles = NicerTiles.new()
......
......@@ -23,12 +23,12 @@ local TooltipsData = require "mod.class.interface.TooltipsData"
module(..., package.seeall, class.inherit(TooltipsData))
function _M:init(x, y, w, h, bgcolor)
function _M:init(x, y, w, h, bgcolor, font, size)
self.display_x = x
self.display_y = y
self.w, self.h = w, h
self.bgcolor = bgcolor
self.font = core.display.newFont("/data/font/SVBasicManual.ttf", 16)
self.font = core.display.newFont(font, size)
self.mouse = Mouse.new()
self:resize(x, y, w, h)
end
......
......@@ -32,21 +32,7 @@ function _M:init(l, w, force_height)
self.title_shadow = false
self.color = {r=0x3a, g=0x35, b=0x33}
self.ui = ""
self.frame = {
shadow = {x = 10, y = 10, a = 0.5},
ox1 = -16, ox2 = 16,
oy1 = -16, oy2 = 16,
b7 = "ui/parchment7.png",
b9 = "ui/parchment9.png",
b1 = "ui/parchment1.png",
b3 = "ui/parchment3.png",
b4 = "ui/parchment4.png",
b6 = "ui/parchment6.png",
b8 = "ui/parchment8.png",
b2 = "ui/parchment2.png",
b5 = "ui/parchment5.png",
}
self.ui = "parchment"
if l.bloodstains then
local ovs = {}
for i = 1, l.bloodstains do
......
......@@ -43,8 +43,45 @@ local PlayerLore = require "mod.class.interface.PlayerLore"
local Quest = require "engine.Quest"
local UIBase = require "engine.ui.Base"
-- Init settings
config.settings.tome = config.settings.tome or {}
profile.mod.allow_build = profile.mod.allow_build or {}
if type(config.settings.tome.autosave) == "nil" then config.settings.tome.autosave = true end
if not config.settings.tome.smooth_move then config.settings.tome.smooth_move = 3 end
if not config.settings.tome.gfx then config.settings.tome.gfx = {size="32x32", tiles="mushroom"} end
if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome.weather_effects = true end
if type(config.settings.tome.smooth_fov) == "nil" then config.settings.tome.smooth_fov = true end
if type(config.settings.tome.daynight) == "nil" then config.settings.tome.daynight = true end
if type(config.settings.tome.chat_log) == "nil" then config.settings.tome.chat_log = true end
if not config.settings.tome.fonts then config.settings.tome.fonts = {type="fantasy", size="normal"} end
if not config.settings.tome.ui_theme then config.settings.tome.ui_theme = "stone" end
Map.smooth_scroll = config.settings.tome.smooth_move
-- Dialog UI
UIBase.ui = config.settings.tome.ui_theme
-- Dialogs fonts
if config.settings.tome.fonts.type == "fantasy" then
local size = ({normal=16, small=12, big=18})[config.settings.tome.fonts.size]
UIBase.font = core.display.newFont("/data/font/USENET_.ttf", size)
UIBase.font_bold = core.display.newFont("/data/font/USENET_.ttf", size)
UIBase.font_mono = core.display.newFont("/data/font/SVBasicManual.ttf", size)
UIBase.font_bold:setStyle("bold")
UIBase.font_h = UIBase.font:lineSkip()
UIBase.font_bold_h = UIBase.font_bold:lineSkip()
UIBase.font_mono_w = UIBase.font_mono:size(" ")
UIBase.font_mono_h = UIBase.font_mono:lineSkip()+2
else
local size = ({normal=12, small=10, big=14})[config.settings.tome.fonts.size]
UIBase.font = core.display.newFont("/data/font/Vera.ttf", size)
UIBase.font_mono = core.display.newFont("/data/font/VeraMono.ttf", size)
UIBase.font_bold = core.display.newFont("/data/font/VeraBd.ttf", size)
UIBase.font_h = UIBase.font:lineSkip()
UIBase.font_mono_w = UIBase.font_mono:size(" ")
UIBase.font_mono_h = UIBase.font_mono:lineSkip()
UIBase.font_bold_h = UIBase.font_bold:lineSkip()
end
-- Create some noise textures
local n = core.noise.new(3)
......@@ -54,16 +91,6 @@ _2DNoise = n:makeTexture2D(64, 64)
--local n = core.noise.new(3)
--_2DNoise = n:makeTexture2DStack(64, 64, 64)
-- Dialogs fonts
UIBase.font = core.display.newFont("/data/font/USENET_.ttf", 16)
UIBase.font_bold = core.display.newFont("/data/font/USENET_.ttf", 16)
UIBase.font_mono = core.display.newFont("/data/font/SVBasicManual.ttf", 16)
UIBase.font_bold:setStyle("bold")
UIBase.font_h = UIBase.font:lineSkip()
UIBase.font_bold_h = UIBase.font_bold:lineSkip()
UIBase.font_mono_w = UIBase.font_mono:size(" ")
UIBase.font_mono_h = UIBase.font_mono:lineSkip()+2
-- Achievements
WorldAchievements:loadDefinition("/data/achievements/")
......@@ -192,14 +219,4 @@ for i, t in ipairs(stype_tot) do
end
------------------------------------------------------------------------
-- Init settings
if type(config.settings.tome.autosave) == "nil" then config.settings.tome.autosave = true end
if not config.settings.tome.smooth_move then config.settings.tome.smooth_move = 3 end
if not config.settings.tome.gfx then config.settings.tome.gfx = {size="32x32", tiles="mushroom"} end
if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome.weather_effects = true end
if type(config.settings.tome.smooth_fov) == "nil" then config.settings.tome.smooth_fov = true end
if type(config.settings.tome.daynight) == "nil" then config.settings.tome.daynight = true end
if type(config.settings.tome.chat_log) == "nil" then config.settings.tome.chat_log = true end
Map.smooth_scroll = config.settings.tome.smooth_move
return {require "mod.class.Game", require "mod.class.World"}
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