Skip to content
Snippets Groups Projects
Commit 8d667925 authored by Grayswandir's avatar Grayswandir
Browse files

Fix variable names.

parent f2517090
No related branches found
No related tags found
No related merge requests found
......@@ -236,8 +236,8 @@ function _M:newGame()
end
local nb_unlocks, max_unlocks = self:countBirthUnlocks()
self.creating_player = true
self.extraBirthOptionDefs = {}
class:triggerHook{"ToME:extraBirthOptions", options = self.extraBirthOptionDefs}
self.extra_birth_option_defs = {}
class:triggerHook{"ToME:extraBirthOptions", options = self.extra_birth_option_defs}
local birth; birth = Birther.new("Character Creation ("..nb_unlocks.."/"..max_unlocks.." unlocked birth options)", self.player, {"base", "world", "difficulty", "permadeath", "race", "subrace", "sex", "class", "subclass" }, function(loaded)
if not loaded then
self.calendar = Calendar.new("/data/calendar_"..(self.player.calendar or "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)
......@@ -247,10 +247,10 @@ function _M:newGame()
self.player:check("class_start_check")
-- Save current state of extra birth options.
self.player.extraBirthOptions = {}
for _, option in ipairs(self.extraBirthOptionDefs) do
self.player.extra_birth_options = {}
for _, option in ipairs(self.extra_birth_option_defs) do
if option.id then
self.player.extraBirthOptions[option.id] = config.settings.tome[option.id]
self.player.extra_birth_options[option.id] = config.settings.tome[option.id]
end
end
......@@ -269,7 +269,7 @@ function _M:newGame()
self:setupPermadeath(self.player)
--self:changeLevel(1, "test")
self:changeLevel(self.player.starting_level or 1, self.player.starting_zone, {force_down=self.player.starting_level_force_down})
print("[PLAYER BIRTH] resolve...")
self.player:resolve()
self.player:resolve(nil, true)
......@@ -439,7 +439,7 @@ function _M:computeAttachementSpots()
setfenv(f, t)
local ok, err = pcall(f)
if not ok then print("Loading tileset attachements error", err) end
end
end
end
for _, file in ipairs(fs.list(Tiles.prefix)) do if file:find("^attachements%-.+.lua$") then
print("Loading tileset attachements from ", Tiles.prefix..file)
......@@ -449,7 +449,7 @@ function _M:computeAttachementSpots()
setfenv(f, t)
local ok, err = pcall(f)
if not ok then print("Loading tileset attachements error", err) end
end
end
end end
self:computeAttachementSpotsFromTable(t)
end
......@@ -483,7 +483,7 @@ function _M:computeFacings()
setfenv(f, t)
local ok, err = pcall(f)
if not ok then print("Loading tileset facings error", err) end
end
end
end
for _, file in ipairs(fs.list(Tiles.prefix)) do if file:find("^facings%-.+.lua$") then
print("Loading tileset facings from ", Tiles.prefix..file)
......@@ -493,7 +493,7 @@ function _M:computeFacings()
setfenv(f, t)
local ok, err = pcall(f)
if not ok then print("Loading tileset facings error", err) end
end
end
end end
self:computeFacingsFromTable(t)
end
......@@ -606,12 +606,12 @@ function _M:createFBOs()
gestures = Shader.new("main_fbo/gestures"),
}
self.posteffects_use = { self.fbo_shader.shad }
if not self.fbo_shader.shad then self.fbo = nil self.fbo_shader = nil end
if not self.fbo_shader.shad then self.fbo = nil self.fbo_shader = nil end
self.fbo2 = core.display.newFBO(Map.viewport.width, Map.viewport.height)
if self.gestures and self.posteffects and self.posteffects.gestures and self.posteffects.gestures.shad then self.gestures.shader = self.posteffects.gestures.shad end
end
if self.player then self.player:updateMainShader() end
self.full_fbo = core.display.newFBO(self.w, self.h)
......@@ -1091,7 +1091,7 @@ function _M:changeLevelReal(lev, zone, params)
end
end
if self.level.data.effects then
for uid, act in pairs(self.level.entities) do
for uid, act in pairs(self.level.entities) do
if act.setEffect then for _, effid in ipairs(self.level.data.effects) do
act:setEffect(effid, 1, {})
end end
......@@ -1295,8 +1295,8 @@ end
-- displayDelayedLogDamage to display the queued combat messages
-- output a message to the log based on the visibility of an actor to the player
function _M.logSeen(e, style, ...)
if e and e.player or (not e.dead and e.x and e.y and game.level and game.level.map.seens(e.x, e.y) and game.player:canSee(e)) then game.log(style, ...) end
function _M.logSeen(e, style, ...)
if e and e.player or (not e.dead and e.x and e.y and game.level and game.level.map.seens(e.x, e.y) and game.player:canSee(e)) then game.log(style, ...) end
end
-- determine whether an action between 2 actors should produce a message in the log and if the player
......@@ -1319,8 +1319,8 @@ function _M:logVisible(source, target)
else -- source should display if it's the player or an actor (or projectile) in a seen tile, or same as target for non-actors
src = source.player or ((source.__is_actor or source.__is_projectile) and game.level.map.seens(source.x, source.y)) or (not source.__is_actor and tgt)
srcSeen = src and game.player:canSee(source) or false
end
end
return src or tgt or false, srcSeen, tgtSeen
end
......@@ -1923,7 +1923,7 @@ do return end
local a = self.level.map(tmx, tmy, Map.ACTOR)
self:registerDialog(require("mod.dialogs.CharacterSheet").new((config.settings.cheat or self.player:canSee(a)) and a or self.player))
end,
SHOW_MESSAGE_LOG = function()
self:registerDialog(require("mod.dialogs.ShowChatLog").new("Message Log", 0.6, self.uiset.logdisplay, profile.chat))
end,
......@@ -2458,7 +2458,7 @@ unlocks_list = {
birth_zigur_sacrifice = "Birth option: Zigur sacrifice",
cosmetic_race_human_redhead = "Cosmetic: Redheads",
cosmetic_race_dwarf_female_beard = "Cosmetic: Female dwarves facial pilosity",
difficulty_insane = "Difficulty: Insane",
difficulty_madness = "Difficulty: Madness",
......@@ -2523,7 +2523,7 @@ function _M:getGenericTextTiles(en)
if not disp then return "" end
if not en.getDisplayString then
if en.display_entity and en.display_entity.getDisplayString then
disp = en.display_entity
disp = en.display_entity
else
return ""
end
......
......@@ -70,7 +70,7 @@ function _M:init(title, actor, order, at_end, quickbirth, w, h)
self.c_options = Button.new{text="Customize", fct=function() self:customizeOptions() end}
self.c_options.hide = true
self.c_extra_options = Button.new{text="Extra Options", fct=function() self:extraOptions() end}
self.c_extra_options.hide = #game.extraBirthOptionDefs == 0
self.c_extra_options.hide = #game.extra_birth_option_defs == 0
self.c_name = Textbox.new{title="Name: ", text=(not config.settings.cheat and game.player_name == "player") and "" or game.player_name, chars=30, max_len=50, fct=function()
if config.settings.cheat then self:makeDefault() end
......@@ -1042,7 +1042,7 @@ end
function _M:resetAttachementSpots()
self.actor.attachement_spots = nil
if self.has_custom_tile then
if self.has_custom_tile then
self.actor.attachement_spots = self.has_custom_tile.f
return
end
......@@ -1410,7 +1410,7 @@ function _M:selectTile()
fs.mkdir("/data/gfx/custom-tiles/")
for file in fs.iterate("/data/gfx/custom-tiles/", function(file) return file:find("%.png") end) do
list[#list+1] = "custom-tiles/"..file
end
end
self:triggerHook{"Birther:donatorTiles", list=list}
local remove = Button.new{text="Use default tile", width=240, fct=function()
......@@ -1475,7 +1475,7 @@ function _M:customizeOptions()
end
function _M:extraOptions()
local options = OptionTree.new(game.extraBirthOptionDefs, 'Birth Options', 600, 550)
local options = OptionTree.new(game.extra_birth_option_defs, 'Birth Options', 600, 550)
options:initialize()
game:registerDialog(options)
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