Skip to content

Commit

Permalink
revert(config): don't use steamodded config for values that i don't k…
Browse files Browse the repository at this point in the history
…now how to modify in game which is all of them.
  • Loading branch information
Aiz0 committed Aug 6, 2024
1 parent 90d657f commit cc0e353
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
3 changes: 1 addition & 2 deletions config.lua → configuration.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
-- TODO: rework this later and do an actual config.
return {
Aiz.config = {
-- jokers not listed here will still be enabled
jokers = {
blåhaj = true,
Expand Down
5 changes: 2 additions & 3 deletions jokers/chess_pawn.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
-- Chess pawn
-- After a few rounds it promotes to a different chess joker
local config = SMODS.current_mod.config
SMODS.Joker({
key = "chess_pawn",
loc_txt = {
Expand Down Expand Up @@ -34,7 +33,7 @@ SMODS.Joker({
-- Remove any jokers that aren't registered
-- Prevents crash from trying to create non existent jokers
local available_jokers = {}
for k, v in pairs(config.pawn.promotion) do
for k, v in pairs(Aiz.config.pawn.promotion) do
for _, center in pairs(G.P_CENTERS) do
if center.set == "Joker" then
if k == center.key then
Expand All @@ -48,7 +47,7 @@ SMODS.Joker({
for key, probability in pairs(available_jokers) do
if #SMODS.find_card(key, true) > 0 then
available_jokers[key] = probability
* config.pawn.duplicate_chance_reduction
* Aiz.config.pawn.duplicate_chance_reduction
end
end

Expand Down
3 changes: 1 addition & 2 deletions jokers/kiki_bouba.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local config = SMODS.current_mod.config
SMODS.Joker({
key = "kiki_bouba",
loc_txt = {
Expand Down Expand Up @@ -32,7 +31,7 @@ SMODS.Joker({
and context.other_joker ~= card
then
local is_kiki =
config.is_kiki[context.other_joker.config.center_key]
Aiz.config.is_kiki[context.other_joker.config.center_key]
local eval, text, color = nil, nil, nil
if is_kiki == nil then
return
Expand Down
4 changes: 2 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
Aiz = {}
local current_mod = SMODS.current_mod
local mod_path = SMODS.current_mod.path
local config = SMODS.current_mod.config

-- contains filenames of modules that can be enabled disabled
local modules = {
Expand Down Expand Up @@ -82,12 +81,13 @@ SMODS.Atlas({

-- load utils
assert(SMODS.load_file("utils.lua"))()
assert(SMODS.load_file("configuration.lua"))()

-- load all enabled jokers
-- only explicitly disabled jokers are disabled
-- jokers not listed are still enabled
for _, joker in ipairs(modules.jokers) do
local enabled = config.jokers[joker] == nil or config.jokers[joker]
local enabled = Aiz.config.jokers[joker] == nil or Aiz.config.jokers[joker]
if enabled then
assert(SMODS.load_file("jokers/" .. joker .. ".lua"))()
end
Expand Down
5 changes: 2 additions & 3 deletions utils.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local config = SMODS.current_mod.config
Aiz.utils = {
create_blocking_card = function(card, position, silent)
G.E_MANAGER:add_event(Event({
Expand Down Expand Up @@ -84,7 +83,7 @@ Aiz.utils = {
---@return boolean
is_suit_type = function(playing_card, suit_type)
-- stylua: ignore
for suit, _ in pairs(config.suits[suit_type]) do
for suit, _ in pairs(Aiz.config.suits[suit_type]) do
if playing_card:is_suit(suit) then
return true
end
Expand All @@ -97,7 +96,7 @@ Aiz.utils = {
return select(
2,
pseudorandom_element(
config.suits[suit_type],
Aiz.config.suits[suit_type],
pseudoseed("random_suit")
)
)
Expand Down

0 comments on commit cc0e353

Please sign in to comment.