#Stellar Manipulator
stellar_manip_manipulator_enabled = {
    potential = {
        exists = from
        from = {
            has_country_flag = giga_menu_page_03
            NOT = { has_global_flag = stellar_manip_manipulator_disabled }
        }
    }

    allow = {
        always = yes
    }

    effect = {
        custom_tooltip = "giga_menu_disabled"
        set_global_flag = stellar_manip_manipulator_disabled

        # Systemcraft assembler relies on the stellar manipulator
        set_global_flag = stellar_manip_assembler_disabled

        #The SMBH manipulator requires the stellar manipulator
        if = {
            limit = {
                quasarmod_enabled = yes
            }
            set_global_flag = quasarmod_manipulator_disabled
        }
    }
}

stellar_manip_manipulator_disabled = {
    potential = {
        exists = from
        from = {
            has_country_flag = giga_menu_page_03
            has_global_flag = stellar_manip_manipulator_disabled}
    }

    allow = {
        always = yes
    }

    effect = {
        custom_tooltip = "giga_menu_disabled"
        remove_global_flag = stellar_manip_manipulator_disabled
    }
}

#Systemcraft Assembler
celestial_printing_system_x = {
    potential = {
        exists = from
        from = {
            has_country_flag = giga_menu_page_00
            has_global_flag = stellar_manip_assembler_disabled
        }
    }
    allow = {
        custom_tooltip = "must_not_have_started_game"
        hidden_trigger = { NOT = { has_global_flag = giga_game_started } }
    }
    effect = {
        custom_tooltip = "stellar_manip_systemcraft_assmbler_disabled_tt"
        remove_global_flag = stellar_manip_assembler_disabled remove_global_flag = stellar_manip_manipulator_disabled # (This needs manipulators to be enabled)
    }
}

celestial_printing_system_x_disabled = {
    potential = {
        exists = from
        from = {
            has_country_flag = giga_menu_page_00
            NOT = { has_global_flag = stellar_manip_assembler_disabled }
        }

    }
    allow = {
        custom_tooltip = "must_not_have_started_game"
        hidden_trigger = { NOT = { has_global_flag = giga_game_started } }
    }
    effect = {
        custom_tooltip = "stellar_manip_systemcraft_assmbler_enabled_tt"
        set_global_flag = stellar_manip_assembler_disabled
    }
}

# O Class Systemcraft
stellar_manip_o_systemcraft_enabled = {
    potential = {
        exists = from

        from = {
            has_country_flag = giga_menu_page_03
            NOT = { has_global_flag = stellar_manip_o_systemcraft_disabled }
        }

    }

    allow = {
        always = yes
    }

    effect = {
        custom_tooltip = "giga_menu_disabled"
        set_global_flag = stellar_manip_o_systemcraft_disabled
    }
}

stellar_manip_o_systemcraft_disabled = {
    potential = {
        exists = from
        from = {
            has_country_flag = giga_menu_page_03
            has_global_flag = stellar_manip_o_systemcraft_disabled
        }
    }

    allow = {
        always = yes
    }

    effect = {
        custom_tooltip = "giga_menu_disabled"
        remove_global_flag = stellar_manip_o_systemcraft_disabled
        remove_global_flag = systemcraft_disabled
        remove_global_flag = warplanet_disabled
        remove_global_flag = warmoon_disabled
    }
}

# Tooltips
stellar_manip_stellar_manipulator_tt = {
    potential = { exists = from from = { has_country_flag = giga_menu_page_03 } }
    allow = { always = yes }
    effect = { custom_tooltip = stellar_manipulator_0_MEGASTRUCTURE_DETAILS }
}

stellar_manip_o_systemcraft_tt = {
    potential = { exists = from from = { has_country_flag = giga_menu_page_03 } }
    allow = { always = yes }
    effect = { custom_tooltip = giga_menu_o_systemcraft_tooltip }
}
