Skip to content

Fixed and simplified#9

Open
Gurkoel wants to merge 19 commits intomluzarow:masterfrom
Gurkoel:master
Open

Fixed and simplified#9
Gurkoel wants to merge 19 commits intomluzarow:masterfrom
Gurkoel:master

Conversation

@Gurkoel
Copy link
Contributor

@Gurkoel Gurkoel commented Jan 20, 2020

@Gurkoel Gurkoel changed the title Fixed and simplyfied Fixed and simplified Jan 29, 2020
local IngredientCount = 0
local OldIngredientCount = 0

function sendMethMessage(number, id)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clean this up slightly so it has less repetition?

    MessageColor = Color.green;

    if number == 1 then
        Message =  'Ingredient added!';
    elseif number == 2 then
        Message = '[' .. countAddedIngredients(currentRecipeList) .. '/3] [' .. ingredient_dialog[id] .. ']';    
    elseif number == 3 then
        Message = 'Total bags: [' .. totalBags .. ']';
    elseif number == 4 then
        Message = 'No finished dialouge caught, Bag-count is being guessed by now';
        MessageColor = Color.red;
    else
        return;
    end

    if MethHelper._data.silent_toggle == true or MethHelper._data.silent_toggle == 'on' then
            managers.chat:_receive_message(1, '[SilentMethMagic]', Message, MessageColor);
    else
            managers.chat:send_message(1, '[SilentMethMagic]',Message, MessageColor);
    end

(I feel like thats easier to understand)

if id == CookoffFinishedID or id == RatsFinishedID or id == BorderCrystalFinsishedID or id == BorderCrystalFinsishedID2 then
-- If "ingredient added" dialogue is played
if isMethFinished(id) == true then
-- If "BAg finished" dialogue is played
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus capital letter.

Fixed wrong methcounter on border crystals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop working after 8 bag in cook off

2 participants