From 4989fa773f08b89ee190ede8e7fa978129ebdc8a Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Tue, 17 Aug 2010 23:36:37 +0000 Subject: [PATCH] update git-svn-id: http://svn.net-core.org/repos/t-engine4@1028 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/PlayerProfile.lua | 2 +- game/engine/Tooltip.lua | 2 +- game/special/mainmenu/class/Game.lua | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/game/engine/PlayerProfile.lua b/game/engine/PlayerProfile.lua index fb52e694e2..c10a53b15f 100644 --- a/game/engine/PlayerProfile.lua +++ b/game/engine/PlayerProfile.lua @@ -221,7 +221,7 @@ function _M:getNews() print("[ONLINE PROFILE] get news") local data = self:rpc{action="GetNews"} if not data then print("[ONLINE PROFILE] no news") return end - print("[ONLINE PROFILE] news ", data[1] and data[1].title) + print("[ONLINE PROFILE] news ", data.title) return data end diff --git a/game/engine/Tooltip.lua b/game/engine/Tooltip.lua index cf562ad293..a4a4aaaa8d 100644 --- a/game/engine/Tooltip.lua +++ b/game/engine/Tooltip.lua @@ -45,7 +45,7 @@ function _M:set(str, ...) if w > self.w then self.w = w end self.h = self.h + self.font_h end - self.w = self.w + 8 + self.w = math.min(self.w, self.max) + 8 self.h = self.h + 8 self.changed = true end diff --git a/game/special/mainmenu/class/Game.lua b/game/special/mainmenu/class/Game.lua index ee3b7a6ae0..1156fbb946 100644 --- a/game/special/mainmenu/class/Game.lua +++ b/game/special/mainmenu/class/Game.lua @@ -217,19 +217,25 @@ function _M:selectStepMain() core.game.exit_engine() end, }, - }, 400, self.h * 0.2, self.w * 0.4, self.h * 0.3) + }, 400 + 8 + 10, self.h * 0.2, self.w * 0.4, self.h * 0.3) if not self.news then self.news = profile:getNews() - if not self.news or not self.news[1] then - self.nesw = { + if not self.news then + self.news = { title = 'Welcome to T-Engine and the Tales of Middle-earth', text = [[From this interface you can create new characters for the game modules you want to play. -T-Engine comes by default with the "Tales of Middle-earth" module, you can also install more by selecting "Install a game module" or by going to http://te4.org/ -]] + +#GOLD#"Tales of Middle-earth"#WHITE# is the default game module, you can also install more by selecting "Install a game module" or by going to http://te4.org/ + +When inside a module remember you can press Escape to bring up a menu to change keybindings, resolution and other module specific options. + +Remember that in most roguelikes death is usualy permanent so be careful! + +Now go and have some fun!]] } end - self.tooltip:set("%s\n---\n%s", self.news[1].title, self.news[1].text) + self.tooltip:set("#AQUAMARINE#%s#WHITE#\n---\n%s", self.news.title, self.news.text) end self.step.do_tooltip = true -- GitLab