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

Actual Mod Loader support #143

Closed
wants to merge 3 commits into from
Closed

Actual Mod Loader support #143

wants to merge 3 commits into from

Conversation

MiranDMC
Copy link
Collaborator

@MiranDMC MiranDMC commented Jun 7, 2024

CLEO plugins extension changed to .cleo5. Legacy plugins with old filetype will still be injected and supported in legacy way by ML
Created ModLoader plugin monitoring installed mods and providing useful exports for CLEO.
Changed legacy plugins load order to not overwrite new plugins.
Fixed game hanging on close, due to audio plugin hacks made by ModLoader.

Fixes #62, fixes #141, fixes #186

@MiranDMC MiranDMC force-pushed the modl_loader_updates branch 2 times, most recently from 2d4acea to 9575a5e Compare June 8, 2024 08:53
@MiranDMC MiranDMC linked an issue Jun 8, 2024 that may be closed by this pull request
@MiranDMC MiranDMC requested a review from x87 June 8, 2024 16:16
@MiranDMC MiranDMC marked this pull request as ready for review June 8, 2024 16:16
@MiranDMC MiranDMC force-pushed the modl_loader_updates branch 8 times, most recently from 0e32fb8 to ba4d7bc Compare June 14, 2024 17:18
@MiranDMC MiranDMC force-pushed the modl_loader_updates branch 2 times, most recently from 1434dae to ffb6155 Compare June 17, 2024 07:33
@MiranDMC MiranDMC force-pushed the modl_loader_updates branch 2 times, most recently from a80c2b5 to 00df963 Compare June 28, 2024 14:51
@MiranDMC
Copy link
Collaborator Author

Script for testing:

{$CLEO .cs}
nop

script_name "ml_test"
const dirpath = "cleo\test"
//const filepath = "cleo\ml_test.ini"
const filepath = "cleo\test\ml.ini"

add_text_label 'MLT' "ModLoader Tests:~n~1: file exists?~n~2: write ini~n~3: read ini~n~4: file delete~n~5: dir exists?~n~6: dir create~n~7: dir delete"

int i, j
while true
    wait 0
    
    if
        not is_help_message_being_displayed

    then
        print_help_forever {key} 'MLT'
    end
    
    if
        test_cheat "1"
    then
        if
            does_file_exist {path} filepath
        then
            print_formatted_now {format} "does_file_exist '%s'~n~%s" {time} 100000 {args} filepath "true"
        else
            print_formatted_now {format} "does_file_exist '%s'~n~%s" {time} 100000 {args} filepath "false"
        end
    end
    
    if
        test_cheat "2"
    then
        i = get_game_timer
        if
            write_int_to_ini_file {value} i {path} filepath {section} "section" {key} "key"
        then
            print_formatted_now {format} "write_int_to_ini_file '%s'~n~%s : %d" {time} 100000 {args} filepath "ok" i
        else
            print_formatted_now {format} "write_int_to_ini_file '%s'~n~%s" {time} 100000 {args} filepath "failed"
        end
    end
    
    if
        test_cheat "3"
    then
        if
            i = read_int_from_ini_file {path} filepath {section} "section" {key} "key"
        then
            print_formatted_now {format} "read_int_from_ini_file '%s'~n~%s : %d" {time} 100000 {args} filepath "ok" i
        else
            print_formatted_now {format} "read_int_from_ini_file '%s'~n~%s" {time} 100000 {args} filepath "failed"
        end
    end
    
    if
        test_cheat "4"
    then
        if
            delete_file {fileName} filepath
        then
            print_formatted_now {format} "delete_file '%s'~n~%s" {time} 100000 {args} filepath "ok"
        else
            print_formatted_now {format} "delete_file '%s'~n~%s" {time} 100000 {args} filepath "failed"
        end
    end
    
    if
        test_cheat "5"
    then
        if
            does_directory_exist {path} dirpath
        then
            print_formatted_now {format} "does_directory_exist '%s'~n~%s" {time} 100000 {args} dirpath "true"
        else
            print_formatted_now {format} "does_directory_exist '%s'~n~%s" {time} 100000 {args} dirpath "false"
        end
    end
    
    if
        test_cheat "6"
    then
        if
            create_directory {path} dirpath
        then
            print_formatted_now {format} "create_directory '%s'~n~%s" {time} 100000 {args} dirpath "true"
        else
            print_formatted_now {format} "create_directory '%s'~n~%s" {time} 100000 {args} dirpath "false"
        end
    end
    
    if
        test_cheat "7"
    then
        if
            delete_directory {fileName} dirpath {recursive} true
        then
            print_formatted_now {format} "delete_directory '%s'~n~%s" {time} 100000 {args} dirpath "ok"
        else
            print_formatted_now {format} "delete_directory '%s'~n~%s" {time} 100000 {args} dirpath "failed"
        end
    end
end

terminate_this_custom_script

Script's ResolvePath renamed to not be conffused with CLEO_ResolvePath
@MiranDMC MiranDMC closed this Sep 19, 2024
@MiranDMC MiranDMC deleted the modl_loader_updates branch September 23, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant