Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed and simplified #9

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Fixed and simplified #9

wants to merge 19 commits into from

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