<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://te4.org/w/index.php?action=history&amp;feed=atom&amp;title=T4_Modules_Howto_Guide%2FCharacter_Sheet_Dialogs</id>
		<title>T4 Modules Howto Guide/Character Sheet Dialogs - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://te4.org/w/index.php?action=history&amp;feed=atom&amp;title=T4_Modules_Howto_Guide%2FCharacter_Sheet_Dialogs"/>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;action=history"/>
		<updated>2026-04-12T09:21:52Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=6165&amp;oldid=prev</id>
		<title>BDota at 14:58, 29 September 2013</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=6165&amp;oldid=prev"/>
				<updated>2013-09-29T14:58:32Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:58, 29 September 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l407&quot; &gt;Line 407:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 407:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Go back to [[T4 Modules Howto Guide]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Go back to [[T4 Modules Howto Guide]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Module Guides}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BDota</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=5905&amp;oldid=prev</id>
		<title>Ibanix: Ibanix moved page Character Sheet Dialogs to T4 Modules Howto Guide/Character Sheet Dialogs: namespace collision prevention</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=5905&amp;oldid=prev"/>
				<updated>2013-07-08T18:39:44Z</updated>
		
		<summary type="html">&lt;p&gt;Ibanix moved page &lt;a href=&quot;/wiki/Character_Sheet_Dialogs&quot; class=&quot;mw-redirect&quot; title=&quot;Character Sheet Dialogs&quot;&gt;Character Sheet Dialogs&lt;/a&gt; to &lt;a href=&quot;/wiki/T4_Modules_Howto_Guide/Character_Sheet_Dialogs&quot; title=&quot;T4 Modules Howto Guide/Character Sheet Dialogs&quot;&gt;T4 Modules Howto Guide/Character Sheet Dialogs&lt;/a&gt;: namespace collision prevention&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 18:39, 8 July 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Ibanix</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=5797&amp;oldid=prev</id>
		<title>Ibanix at 21:12, 6 July 2013</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=5797&amp;oldid=prev"/>
				<updated>2013-07-06T21:12:40Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 21:12, 6 July 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l406&quot; &gt;Line 406:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 406:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Go back to [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;T4modules-module-howto-guides&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Go back to [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;T4 Modules Howto Guide&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ibanix</name></author>	</entry>

	<entry>
		<id>https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=3262&amp;oldid=prev</id>
		<title>66.225.111.10: Created page with &quot;&lt;h1 id=&quot;toc0&quot;&gt;Character Sheet&lt;/h1&gt;  &lt;h2 id=&quot;toc1&quot;&gt;Player Display&lt;/h2&gt; &lt;p&gt;A Player Display is the sidebar usually on the left that gives you a quick summary of your stats and s...&quot;</title>
		<link rel="alternate" type="text/html" href="https://te4.org/w/index.php?title=T4_Modules_Howto_Guide/Character_Sheet_Dialogs&amp;diff=3262&amp;oldid=prev"/>
				<updated>2013-05-29T00:07:27Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Character Sheet&amp;lt;/h1&amp;gt;  &amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Player Display&amp;lt;/h2&amp;gt; &amp;lt;p&amp;gt;A Player Display is the sidebar usually on the left that gives you a quick summary of your stats and s...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;h1 id=&amp;quot;toc0&amp;quot;&amp;gt;Character Sheet&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc1&amp;quot;&amp;gt;Player Display&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;A Player Display is the sidebar usually on the left that gives you a quick summary of your stats and status.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;In order to create your own Player Display, create and copy the following code into your module's /class/PlayerDisplay.lua file.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.make)&lt;br /&gt;
&lt;br /&gt;
function _M:init(x, y, w, h, bgcolor, font, size)&lt;br /&gt;
    self.display_x = x&lt;br /&gt;
    self.display_y = y&lt;br /&gt;
    self.w, self.h = w, h&lt;br /&gt;
    self.bgcolor = bgcolor&lt;br /&gt;
    self.font = core.display.newFont(font, size)&lt;br /&gt;
    self:resize(x, y, w, h)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- Resize the display area&lt;br /&gt;
function _M:resize(x, y, w, h)&lt;br /&gt;
    self.display_x, self.display_y = x, y&lt;br /&gt;
    self.w, self.h = w, h&lt;br /&gt;
    self.font_h = self.font:lineSkip()&lt;br /&gt;
    self.font_w = self.font:size(&amp;amp;quot; &amp;amp;quot;)&lt;br /&gt;
    self.bars_x = self.font_w * 9&lt;br /&gt;
    self.bars_w = self.w - self.bars_x - 5&lt;br /&gt;
    self.surface = core.display.newSurface(w, h)&lt;br /&gt;
    self.surface_line = core.display.newSurface(w, self.font_h)&lt;br /&gt;
    self.texture = self.surface:glTexture()&lt;br /&gt;
&lt;br /&gt;
    self.items = {}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:makeTexture(text, x, y, r, g, b, max_w)&lt;br /&gt;
    local s = self.surface_line&lt;br /&gt;
    s:erase(0, 0, 0, 0)&lt;br /&gt;
    s:drawColorStringBlended(self.font, text, 0, 0, r, g, b, true, max_w)&lt;br /&gt;
&lt;br /&gt;
    local item = { s:glTexture() }&lt;br /&gt;
    item.x = x&lt;br /&gt;
    item.y = y&lt;br /&gt;
    item.w = self.w&lt;br /&gt;
    item.h = self.font_h&lt;br /&gt;
    self.items[#self.items+1] = item&lt;br /&gt;
&lt;br /&gt;
    return item.w, item.h, item.x, item.y&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:makeTextureBar(text, nfmt, val, max, reg, x, y, r, g, b, bar_col, bar_bgcol)&lt;br /&gt;
    local s = self.surface_line&lt;br /&gt;
    s:erase(0, 0, 0, 0)&lt;br /&gt;
    s:erase(bar_bgcol.r, bar_bgcol.g, bar_bgcol.b, 255, self.bars_x, h, self.bars_w, self.font_h)&lt;br /&gt;
    s:erase(bar_col.r, bar_col.g, bar_col.b, 255, self.bars_x, h, self.bars_w * val / max, self.font_h)&lt;br /&gt;
&lt;br /&gt;
    s:drawColorStringBlended(self.font, text, 0, 0, r, g, b, true)&lt;br /&gt;
    s:drawColorStringBlended(self.font, (nfmt or &amp;amp;quot;%d/%d&amp;amp;quot;):format(val, max), self.bars_x + 5, 0, r, g, b)&lt;br /&gt;
    if reg and reg ~= 0 then&lt;br /&gt;
        local reg_txt = (&amp;amp;quot; (%s%.2f)&amp;amp;quot;):format((reg &amp;amp;gt; 0 and &amp;amp;quot;+&amp;amp;quot;) or &amp;amp;quot;&amp;amp;quot;,reg)&lt;br /&gt;
        local reg_txt_w = self.font:size(reg_txt)&lt;br /&gt;
        s:drawColorStringBlended(self.font, reg_txt, self.bars_x + self.bars_w - reg_txt_w - 3, 0, r, g, b)&lt;br /&gt;
    end&lt;br /&gt;
    local item = { s:glTexture() }&lt;br /&gt;
    item.x = x&lt;br /&gt;
    item.y = y&lt;br /&gt;
    item.w = self.w&lt;br /&gt;
    item.h = self.font_h&lt;br /&gt;
    self.items[#self.items+1] = item&lt;br /&gt;
&lt;br /&gt;
    return item.w, item.h, item.x, item.y&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Displays the stats&lt;br /&gt;
function _M:display()&lt;br /&gt;
    local player = game.player&lt;br /&gt;
    if not player or not player.changed or not game.level then return end&lt;br /&gt;
&lt;br /&gt;
    self.items = {}&lt;br /&gt;
&lt;br /&gt;
    local h = 6&lt;br /&gt;
    local x = 2&lt;br /&gt;
    &lt;br /&gt;
    self.font:setStyle(&amp;amp;quot;bold&amp;amp;quot;)&lt;br /&gt;
    self:makeTexture((&amp;amp;quot;%s#{normal}#&amp;amp;quot;):format(player.name), 0, h, colors.GOLD.r, colors.GOLD.g, colors.GOLD.b, self.w) h = h + self.font_h&lt;br /&gt;
    self.font:setStyle(&amp;amp;quot;normal&amp;amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    self:makeTexture((&amp;amp;quot;Str/Dex/Con: #00ff00#%3d/%3d/%3d&amp;amp;quot;):format(player:getStr(), player:getDex(), player:getCon()), x, h, 255, 255, 255) h = h + self.font_h&lt;br /&gt;
    &lt;br /&gt;
    h = h + self.font_h&lt;br /&gt;
&lt;br /&gt;
    self:makeTextureBar(&amp;amp;quot;#c00000#Life:&amp;amp;quot;, nil, player.life, player.max_life, player.life_regen * util.bound((player.healing_factor or 1), 0, 2.5), x, h, 255, 255, 255, colors.DARK_RED, colors.VERY_DARK_RED) h = h + self.font_h&lt;br /&gt;
&lt;br /&gt;
    self:makeTextureBar(&amp;amp;quot;#ffcc80#Power:&amp;amp;quot;, nil, player:getPower(), player.max_power, player.power_regen, x, h, 255, 255, 255, colors.DARK_BLUE, {r=colors.DARK_BLUE.r/2, g=colors.DARK_BLUE.g/2, b=colors.DARK_BLUE.b/2}) h = h + self.font_h&lt;br /&gt;
&lt;br /&gt;
    if savefile_pipe.saving then&lt;br /&gt;
        h = h + self.font_h&lt;br /&gt;
        self:makeTextureBar(&amp;amp;quot;Saving:&amp;amp;quot;, &amp;amp;quot;%d%%&amp;amp;quot;, 100 * savefile_pipe.current_nb / savefile_pipe.total_nb, 100, nil, x, h, colors.YELLOW.r, colors.YELLOW.g, colors.YELLOW.b, &lt;br /&gt;
        {r=49, g=54,b=42},{r=17, g=19, b=0})&lt;br /&gt;
&lt;br /&gt;
        h = h + self.font_h&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:toScreen(nb_keyframes)&lt;br /&gt;
    self:display()&lt;br /&gt;
    &lt;br /&gt;
    core.display.drawQuad(self.display_x, self.display_y, self.w, self.h, 100,100,100, 200)&lt;br /&gt;
    &lt;br /&gt;
    for i = 1, #self.items do&lt;br /&gt;
        local item = self.items[i]&lt;br /&gt;
        if type(item) == &amp;amp;quot;table&amp;amp;quot; then&lt;br /&gt;
            if item.glow then&lt;br /&gt;
                local glow = (1+math.sin(core.game.getTime() / 500)) / 2 * 100 + 120&lt;br /&gt;
                item[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, item.w, item.h, item[2], item[3], 1, 1, 1, glow / 255)&lt;br /&gt;
            else&lt;br /&gt;
                item[1]:toScreenFull(self.display_x + item.x, self.display_y + item.y, item.w, item.h, item[2], item[3])&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            item(self.display_x, self.display_y)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The class is now defined, but your game still has to be told to display it.  Add the following near to the top of your Game.lua file:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; local PlayerDisplay = require &amp;amp;quot;mod.class.PlayerDisplay&amp;amp;quot; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Then in the run function add&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self.player_display = PlayerDisplay.new(0, 0, 200, self.h, {30,30,0}, &amp;amp;quot;/data/font/VeraMono.ttf&amp;amp;quot;, 12) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Also modify the LogFlasher's x position so it does not render underneath the PlayerDisplay. Change it as following:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self.flash = LogFlasher.new(208, 0, self.w, 20, nil, nil, nil, {255,255,255}, {0,0,0}) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;And finally find the display method and insert the following line:&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; self.player_display:toScreen(nb_keyframe) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;And you are done, you should now have a working PlayerDisplay that you can modify to suit your needs.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h2 id=&amp;quot;toc2&amp;quot;&amp;gt;Character Sheet&amp;lt;/h2&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;In the example module, you may notice that pressing 'C' causes an exception to occur due to a missing /dialogs/CharacterSheet.lua&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Following is two example CharacterSheet Dialogs you can use in your own module. Simply paste one of these into your /dialogs/CharacterSheet.lua, start the game and press 'C' to see how it looks.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc3&amp;quot;&amp;gt;Simple example&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This example is a very basic bare-bones Character sheet that can be customized any way necessarily. Simply update the drawDialog method with the information you wish to display of your own module.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
local Dialog = require &amp;amp;quot;engine.ui.Dialog&amp;amp;quot;&lt;br /&gt;
local Talents = require &amp;amp;quot;engine.interface.ActorTalents&amp;amp;quot;&lt;br /&gt;
local SurfaceZone = require &amp;amp;quot;engine.ui.SurfaceZone&amp;amp;quot;&lt;br /&gt;
local Stats = require &amp;amp;quot;engine.interface.ActorStats&amp;amp;quot;&lt;br /&gt;
local Textzone = require &amp;amp;quot;engine.ui.Textzone&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.inherit(Dialog))&lt;br /&gt;
&lt;br /&gt;
function _M:init(actor)&lt;br /&gt;
    self.actor = actor&lt;br /&gt;
    &lt;br /&gt;
    self.font = core.display.newFont(&amp;amp;quot;/data/font/VeraMono.ttf&amp;amp;quot;, 12)&lt;br /&gt;
    Dialog.init(self, &amp;amp;quot;Character Sheet: &amp;amp;quot;..self.actor.name, math.max(game.w * 0.7, 950), 500, nil, nil, font)&lt;br /&gt;
    &lt;br /&gt;
    self.c_desc = SurfaceZone.new{width=self.iw, height=self.ih,alpha=0}&lt;br /&gt;
&lt;br /&gt;
    self:loadUI{&lt;br /&gt;
        {left=0, top=0, ui=self.c_desc},&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    self:setupUI()&lt;br /&gt;
    &lt;br /&gt;
    self:drawDialog()&lt;br /&gt;
    &lt;br /&gt;
    self.key:addBind(&amp;amp;quot;EXIT&amp;amp;quot;, function() cs_player_dup = game.player:clone() game:unregisterDialog(self) end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:drawDialog()&lt;br /&gt;
    local player = self.actor&lt;br /&gt;
    local s = self.c_desc.s&lt;br /&gt;
&lt;br /&gt;
    s:erase(0,0,0,0)&lt;br /&gt;
&lt;br /&gt;
    local h = 0&lt;br /&gt;
    local w = 0&lt;br /&gt;
&lt;br /&gt;
    h = 0&lt;br /&gt;
    w = 0&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;Name : &amp;amp;quot;..(player.name or &amp;amp;quot;Unnamed&amp;amp;quot;), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;Role : &amp;amp;quot;..(player.descriptor.role or player.type:capitalize()), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
    h = h + self.font_h -- Adds an empty row&lt;br /&gt;
    &lt;br /&gt;
    h = 0&lt;br /&gt;
    w = self.w * 0.25 &lt;br /&gt;
    -- start on second column&lt;br /&gt;
        &lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;STR : &amp;amp;quot;..(player:getStr()), w, h, 0, 255, 255, true) h = h + self.font_h&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;DEX : &amp;amp;quot;..(player:getDex()), w, h, 255, 0, 255, true) h = h + self.font_h&lt;br /&gt;
    s:drawStringBlended(self.font, &amp;amp;quot;CON : &amp;amp;quot;..(player:getCon()), w, h, 255, 255, 0, true) h = h + self.font_h&lt;br /&gt;
    &lt;br /&gt;
    self.c_desc:generate()&lt;br /&gt;
    self.changed = false&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h3 id=&amp;quot;toc4&amp;quot;&amp;gt;Complex example&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;This example is a cut down version of the character sheet used in ToME. It includes tabs, tooltips and the ability to dump your character to a text file. Simply update the drawDialog method with the information you wish to display of your own module.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;To see how the ToME character sheet performs some of its more advanced functions, refer to its source code.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; require &amp;amp;quot;engine.class&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
local Dialog = require &amp;amp;quot;engine.ui.Dialog&amp;amp;quot;&lt;br /&gt;
local Talents = require &amp;amp;quot;engine.interface.ActorTalents&amp;amp;quot;&lt;br /&gt;
local Tab = require &amp;amp;quot;engine.ui.Tab&amp;amp;quot;&lt;br /&gt;
local SurfaceZone = require &amp;amp;quot;engine.ui.SurfaceZone&amp;amp;quot;&lt;br /&gt;
local Separator = require &amp;amp;quot;engine.ui.Separator&amp;amp;quot;&lt;br /&gt;
local Stats = require &amp;amp;quot;engine.interface.ActorStats&amp;amp;quot;&lt;br /&gt;
local Textzone = require &amp;amp;quot;engine.ui.Textzone&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
module(..., package.seeall, class.inherit(Dialog))&lt;br /&gt;
&lt;br /&gt;
function _M:init(actor)&lt;br /&gt;
    self.actor = actor&lt;br /&gt;
    Dialog.init(self, &amp;amp;quot;Character Sheet: &amp;amp;quot;..self.actor.name, math.max(game.w * 0.7, 950), 500)&lt;br /&gt;
&lt;br /&gt;
    self.font = core.display.newFont(&amp;amp;quot;/data/font/VeraMono.ttf&amp;amp;quot;, 12)&lt;br /&gt;
    self.font_h = self.font:lineSkip()&lt;br /&gt;
&lt;br /&gt;
    self.c_general = Tab.new{title=&amp;amp;quot;General&amp;amp;quot;, default=true, fct=function() end, on_change=function(s) if s then self:switchTo(&amp;amp;quot;general&amp;amp;quot;) end end}&lt;br /&gt;
    self.c_attack = Tab.new{title=&amp;amp;quot;Attack&amp;amp;quot;, default=false, fct=function() end, on_change=function(s) if s then self:switchTo(&amp;amp;quot;attack&amp;amp;quot;) end end}&lt;br /&gt;
    self.c_defence = Tab.new{title=&amp;amp;quot;Defense&amp;amp;quot;, default=false, fct=function() end, on_change=function(s) if s then self:switchTo(&amp;amp;quot;defence&amp;amp;quot;) end end}&lt;br /&gt;
&lt;br /&gt;
    local tw, th = self.font_bold:size(self.title)&lt;br /&gt;
&lt;br /&gt;
    self.vs = Separator.new{dir=&amp;amp;quot;vertical&amp;amp;quot;, size=self.iw}&lt;br /&gt;
&lt;br /&gt;
    self.c_tut = Textzone.new{width=self.iw * 0.6, auto_height=true, no_color_bleed=true, font = self.font, text=[[&lt;br /&gt;
Keyboard: #00FF00#'d'#LAST# to save character dump. #00FF00#TAB key#LAST# to switch between tabs.&lt;br /&gt;
Mouse: Hover over stat for info&lt;br /&gt;
]]}&lt;br /&gt;
&lt;br /&gt;
    self.c_desc = SurfaceZone.new{width=self.iw, height=self.ih - self.c_general.h - self.vs.h - self.c_tut.h,alpha=0}&lt;br /&gt;
&lt;br /&gt;
    self.hoffset = 17 + self.c_tut.h + self.vs.h + self.c_general.h&lt;br /&gt;
&lt;br /&gt;
    self:loadUI{&lt;br /&gt;
        {left=0, top=0, ui=self.c_tut},&lt;br /&gt;
        {left=15, top=self.c_tut.h, ui=self.c_general},&lt;br /&gt;
        {left=15+self.c_general.w, top=self.c_tut.h, ui=self.c_attack},&lt;br /&gt;
        {left=15+self.c_general.w+self.c_attack.w, top=self.c_tut.h, ui=self.c_defence},&lt;br /&gt;
        {left=0, top=self.c_tut.h + self.c_general.h, ui=self.vs},&lt;br /&gt;
&lt;br /&gt;
        {left=0, top=self.c_tut.h + self.c_general.h + 5 + self.vs.h, ui=self.c_desc},&lt;br /&gt;
    }&lt;br /&gt;
    self:setFocus(self.c_general)&lt;br /&gt;
    self:setupUI()&lt;br /&gt;
&lt;br /&gt;
    self:switchTo(&amp;amp;quot;general&amp;amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    self:updateKeys()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:switchTo(kind)&lt;br /&gt;
    self:drawDialog(kind, cs_player_dup)&lt;br /&gt;
    if kind == &amp;amp;quot;general&amp;amp;quot; then self.c_attack.selected = false self.c_defence.selected = false&lt;br /&gt;
    elseif kind == &amp;amp;quot;attack&amp;amp;quot; then self.c_general.selected = false self.c_defence.selected = false&lt;br /&gt;
    elseif kind == &amp;amp;quot;defence&amp;amp;quot; then self.c_attack.selected = false self.c_general.selected = false&lt;br /&gt;
    end&lt;br /&gt;
    self:updateKeys()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:updateKeys()&lt;br /&gt;
    self.key:addCommands{&lt;br /&gt;
    _TAB = function() self:tabTabs() end,&lt;br /&gt;
    __TEXTINPUT = function(c)&lt;br /&gt;
        if c == 'd' or c == 'D' then&lt;br /&gt;
            self:dump()&lt;br /&gt;
        end&lt;br /&gt;
    end,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    self.key:addBinds{&lt;br /&gt;
        EXIT = function() cs_player_dup = game.player:clone() game:unregisterDialog(self) end,&lt;br /&gt;
    }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:tabTabs()&lt;br /&gt;
    if self.c_general.selected == true then self.c_attack:select() elseif&lt;br /&gt;
    self.c_attack.selected == true then self.c_defence:select() elseif&lt;br /&gt;
    self.c_defence.selected == true then self.c_general:select() end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:mouseTooltip(text, _, _, _, w, h, x, y)&lt;br /&gt;
    self:mouseZones({&lt;br /&gt;
        { x=x, y=y+self.hoffset, w=w, h=h, fct=function(button) game.tooltip_x, game.tooltip_y = 1, 1; game.tooltip:displayAtMap(nil, nil, game.w, game.h, text) end},&lt;br /&gt;
    }, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:mouseZones(t, no_new)&lt;br /&gt;
    -- Offset the x and y with the window position and window title&lt;br /&gt;
    if not t.norestrict then&lt;br /&gt;
        for i, z in ipairs(t) do&lt;br /&gt;
            if not z.norestrict then&lt;br /&gt;
                z.x = z.x + self.display_x + 5&lt;br /&gt;
                z.y = z.y + self.display_y + 20 + 3&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if not no_new then self.mouse = engine.Mouse.new() end&lt;br /&gt;
    self.mouse:registerZones(t)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:drawDialog(kind)&lt;br /&gt;
    self.mouse:reset()&lt;br /&gt;
&lt;br /&gt;
    self:setupUI()&lt;br /&gt;
&lt;br /&gt;
    local player = self.actor&lt;br /&gt;
    local s = self.c_desc.s&lt;br /&gt;
&lt;br /&gt;
    s:erase(0,0,0,0)&lt;br /&gt;
&lt;br /&gt;
    local h = 0&lt;br /&gt;
    local w = 0&lt;br /&gt;
&lt;br /&gt;
    if kind == &amp;amp;quot;general&amp;amp;quot; then&lt;br /&gt;
        h = 0&lt;br /&gt;
        w = 0&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;Name : &amp;amp;quot;..(player.name or &amp;amp;quot;Unnamed&amp;amp;quot;), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;Role : &amp;amp;quot;..(player.descriptor.role or player.type:capitalize()), w, h, 255, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
        h = h + self.font_h -- Adds an empty row&lt;br /&gt;
        &lt;br /&gt;
        -- Draw some text with an attatched tooltip&lt;br /&gt;
        self:mouseTooltip([[#GOLD#A Tooltip!!#LAST#]], s:drawColorStringBlended(self.font, (&amp;amp;quot;#c00000#Life: #00ff00#%d/%d&amp;amp;quot;):format(player.life, player.max_life), w, h, 255, 255, 255, true)) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
        h = 0&lt;br /&gt;
        w = self.w * 0.25 &lt;br /&gt;
        -- start on second column&lt;br /&gt;
        &lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;STR : &amp;amp;quot;..(player:getStr()), w, h, 0, 255, 255, true) h = h + self.font_h&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;DEX : &amp;amp;quot;..(player:getDex()), w, h, 255, 0, 255, true) h = h + self.font_h&lt;br /&gt;
        s:drawStringBlended(self.font, &amp;amp;quot;CON : &amp;amp;quot;..(player:getCon()), w, h, 255, 255, 0, true) h = h + self.font_h&lt;br /&gt;
        &lt;br /&gt;
    elseif kind==&amp;amp;quot;attack&amp;amp;quot; then&lt;br /&gt;
        h = 0&lt;br /&gt;
        w = 0&lt;br /&gt;
        &lt;br /&gt;
        -- draw the attack tab here&lt;br /&gt;
&lt;br /&gt;
    elseif kind==&amp;amp;quot;defence&amp;amp;quot; then&lt;br /&gt;
        h = 0&lt;br /&gt;
        w = 0&lt;br /&gt;
        &lt;br /&gt;
        -- draw the defence tab here&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    self.c_desc:generate()&lt;br /&gt;
    self.changed = false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function _M:dump()&lt;br /&gt;
    local player = self.actor&lt;br /&gt;
&lt;br /&gt;
    fs.mkdir(&amp;amp;quot;/character-dumps&amp;amp;quot;)&lt;br /&gt;
    local file = &amp;amp;quot;/character-dumps/&amp;amp;quot;..(player.name:gsub(&amp;amp;quot;[^a-zA-Z0-9_-.]&amp;amp;quot;, &amp;amp;quot;_&amp;amp;quot;))..&amp;amp;quot;-&amp;amp;quot;..os.date(&amp;amp;quot;%Y%m%d-%H%M%S&amp;amp;quot;)..&amp;amp;quot;.txt&amp;amp;quot;&lt;br /&gt;
    local fff = fs.open(file, &amp;amp;quot;w&amp;amp;quot;)&lt;br /&gt;
    local labelwidth = 17&lt;br /&gt;
    local w1 = function(s) s = s or &amp;amp;quot;&amp;amp;quot; fff:write(s:removeColorCodes()) fff:write(&amp;amp;quot;\n&amp;amp;quot;) end&lt;br /&gt;
    --prepare label and value&lt;br /&gt;
    local makelabel = function(s,r) while s:len() &amp;amp;lt; labelwidth do s = s..&amp;amp;quot; &amp;amp;quot; end return (&amp;amp;quot;%s: %s&amp;amp;quot;):format(s, r) end&lt;br /&gt;
&lt;br /&gt;
    w1(&amp;amp;quot;  [MyModule Character Dump]&amp;amp;quot;)&lt;br /&gt;
    w1()&lt;br /&gt;
    &lt;br /&gt;
    w1((&amp;amp;quot;%-32s&amp;amp;quot;):format(makelabel(&amp;amp;quot;Name&amp;amp;quot;, player.name)))&lt;br /&gt;
    w1((&amp;amp;quot;%-32s&amp;amp;quot;):format(makelabel(&amp;amp;quot;Role&amp;amp;quot;, player.descriptor.role or player.type:capitalize())))&lt;br /&gt;
    &lt;br /&gt;
    w1((&amp;amp;quot;STR:  %d&amp;amp;quot;):format(player:getStr()))&lt;br /&gt;
    &lt;br /&gt;
    w1((&amp;amp;quot;DEX:  %d&amp;amp;quot;):format(player:getDex()))&lt;br /&gt;
&lt;br /&gt;
    w1((&amp;amp;quot;CON:  %d&amp;amp;quot;):format(player:getCon()))&lt;br /&gt;
&lt;br /&gt;
    fff:close()&lt;br /&gt;
&lt;br /&gt;
    Dialog:simplePopup(&amp;amp;quot;Character dump complete&amp;amp;quot;, &amp;amp;quot;File: &amp;amp;quot;..fs.getRealPath(file))&lt;br /&gt;
end &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Go back to [[T4modules-module-howto-guides]]&lt;/div&gt;</summary>
		<author><name>66.225.111.10</name></author>	</entry>

	</feed>