Skip to content

Commit

Permalink
Removed ui-specific READMEs...write an if statement in your config if…
Browse files Browse the repository at this point in the history
… you need

 it, but we'll try to have everything support some minimalistic subset of
 HTML instead.
  • Loading branch information
icculus committed Dec 28, 2006
1 parent 380c900 commit 0b6231e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 36 deletions.
15 changes: 3 additions & 12 deletions lua/config.lua
Expand Up @@ -30,29 +30,20 @@ Setup.Package
Setup.Eula
{
description = "My Game License",
ui_stdio = MojoSetup.translate("MyGame_EULA.txt"),
ui_gtkplus = MojoSetup.translate("MyGame_EULA.html"),
ui_macosx = MojoSetup.translate("MyGame_EULA.html"),
ui_generic = MojoSetup.translate("MyGame_EULA.mtf"),
source = MojoSetup.translate("MyGame_EULA.html")
},

Setup.Eula
{
description = "Punkbuster License",
ui_stdio = MojoSetup.translate("PunkBuster_EULA.txt"),
ui_gtkplus = MojoSetup.translate("PunkBuster_EULA.html"),
ui_macosx = MojoSetup.translate("PunkBuster_EULA.html"),
ui_generic = MojoSetup.translate("PunkBuster_EULA.mtf"),
source = MojoSetup.translate("PunkBuster_EULA.html"),
},

-- README file(s) to show and install.
Setup.Readme
{
description = "My Game README",
ui_stdio = MojoSetup.translate("README.txt"),
ui_gtkplus = MojoSetup.translate("README.html"),
ui_macosx = MojoSetup.translate("README.html"),
ui_generic = MojoSetup.translate("README.mtf"),
source = MojoSetup.translate("README.html"),
},

-- Specify media (discs) we may need for this install and how to find them.
Expand Down
12 changes: 10 additions & 2 deletions lua/mojosetup_init.lua
Expand Up @@ -368,11 +368,19 @@ function Setup.Package(tab)
end

function Setup.Eula(tab)
return sanitize("Eula", tab, textfile_schema);
return sanitize("Eula", tab,
{
{ "description", nil, mustExist, mustBeString, cantBeEmpty },
{ "source", nil, mustExist, mustBeString, cantBeEmpty },
})
end

function Setup.Readme(tab)
return sanitize("Readme", tab, textfile_schema);
return sanitize("Readme", tab,
{
{ "description", nil, mustExist, mustBeString, cantBeEmpty },
{ "source", nil, mustExist, mustBeString, cantBeEmpty },
})
end

function Setup.Media(tab)
Expand Down
27 changes: 5 additions & 22 deletions lua/mojosetup_mainline.lua
Expand Up @@ -9,7 +9,6 @@ local _ = MojoSetup.translate
-- so it only spits out crap if debug-level logging is enabled.
MojoSetup.dumptable("MojoSetup.installs", MojoSetup.installs)


local function do_install(install)
-- Build a bunch of functions into a linear array...this lets us move
-- back and forth between stages of the install with customized functions
Expand All @@ -36,15 +35,7 @@ local function do_install(install)
-- of any EULA is considered fatal.
for k,eula in pairs(install.eulas) do
local desc = eula.description;
local fname = eula["ui_" .. MojoSetup.ui]
if fname == nil then
fname = eula.generic
end
-- No EULA we can show. That's fatal, unfortunately.
if fname == nil then
MojoSetup.logerror("No ui-specific or generic EULA for " .. desc)
MojoSetup.fatal(_("Internal error"))
end
local fname = eula.source;

-- (desc) and (fname) become an upvalues in this function.
stages[#stages+1] = function (thisstage, maxstage)
Expand All @@ -62,18 +53,10 @@ local function do_install(install)
-- Next stage: show any READMEs.
for k,readme in pairs(install.readmes) do
local desc = readme.description;
local fname = readme["ui_" .. MojoSetup.ui]
if fname == nil then
fname = readme.generic
end
-- No README we can show. Log it and move on.
if fname == nil then
MojoSetup.logerror("No ui-specific or generic README for " .. desc)
else
-- (desc) and (fname) become upvalues in this function.
stages[#stages+1] = function(thisstage, maxstage)
return MojoSetup.gui.readme(desc, fname, thisstage, maxstage)
end
local fname = readme.source;
-- (desc) and (fname) become upvalues in this function.
stages[#stages+1] = function(thisstage, maxstage)
return MojoSetup.gui.readme(desc, fname, thisstage, maxstage)
end
end

Expand Down

0 comments on commit 0b6231e

Please sign in to comment.