diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b9531a3..9ecd8bc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -5,7 +5,7 @@ on: [push] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) BUILD_TYPE: RelWithDebInfo - FWL_VERSION: 2.8.11 + FWL_VERSION: 2.8.12 jobs: build-lin: diff --git a/FlyWithLua/Documentation/ChangeLog.txt b/FlyWithLua/Documentation/ChangeLog.txt index 15e4fda..7801ac8 100644 --- a/FlyWithLua/Documentation/ChangeLog.txt +++ b/FlyWithLua/Documentation/ChangeLog.txt @@ -93,3 +93,5 @@ v2.8.9 Added support for X-Plane Fmod SDK. v2.8.10 Removed X-Plane LuaJIT alloc because it is not needed and was causing issues with Linux. v2.8.11 Fixed missing Throttle 9 from SaveInitalAssignments.ini Thanks XPJavelin + +v2.8.12 Fixed issue with do_on_mouse_click now is only called once per mouse click Thanks apn diff --git a/FlyWithLua/Scripts (disabled)/imgui_get_lat_lon.lua b/FlyWithLua/Scripts (disabled)/imgui_get_lat_lon.lua new file mode 100644 index 0000000..92e22ef --- /dev/null +++ b/FlyWithLua/Scripts (disabled)/imgui_get_lat_lon.lua @@ -0,0 +1,65 @@ +-- Imugi Get Latitude and Longitude +-- William R. Good 03-27-24 + +if not SUPPORTS_FLOATING_WINDOWS then + -- to make sure the script doesn't stop old FlyWithLua versions + logMsg("imgui not supported by your FlyWithLua version") + return +end + + +local dec_deg_latitude = 0.0 +local dec_deg_longitude = 0.0 + + +function iglal_on_build(iglal_wnd, x, y) + if imgui.Button("Get Location", 100, 50) then + get_location() + end + + imgui.TextUnformatted(string.format("Latitude %f", dec_deg_latitude)) + imgui.TextUnformatted(string.format("Longitude %f", dec_deg_longitude)) + +end + +function get_location() + dec_deg_latitude = LATITUDE + dec_deg_longitude = LONGITUDE +end + +iglal_wnd = nil + +function iglal_show_wnd() + iglal_wnd = float_wnd_create(640, 480, 1, true) + float_wnd_set_title(iglal_wnd, "Imgui Imugi Get Latitude and Longitude") + float_wnd_set_imgui_builder(iglal_wnd, "iglal_on_build") +end + +function iglal_hide_wnd() + if iglal_wnd then + float_wnd_destroy(iglal_wnd) + end +end + +iglal_show_only_once = 0 +iglal_hide_only_once = 0 + +function toggle_imgui_show_hide_window_with_command() + iglal_show_window = not iglal_show_window + if iglal_show_window then + if iglal_show_only_once == 0 then + iglal_show_wnd() + iglal_show_only_once = 1 + iglal_hide_only_once = 0 + end + else + if iglal_hide_only_once == 0 then + iglal_hide_wnd() + iglal_hide_only_once = 1 + iglal_show_only_once = 0 + end + end +end + +add_macro("Imgui Show Hide Imgui Get Latitude and Longitude: open/close", "iglal_show_wnd()", "iglal_hide_wnd()", "deactivate") +create_command("FlyWithLua/imgui-get-latitude-and-longitude-window/show_toggle", "open/close umgui get latitude and longitude window", "toggle_imgui_get_latitude_and_longitude()", "", "") \ No newline at end of file diff --git a/FlyWithLua/Scripts (disabled)/imgui_set_failures.lua b/FlyWithLua/Scripts (disabled)/imgui_set_failures.lua new file mode 100644 index 0000000..3d412fb --- /dev/null +++ b/FlyWithLua/Scripts (disabled)/imgui_set_failures.lua @@ -0,0 +1,132 @@ +-- Imugi Set Failures +-- William R. Good 03-28-24 + +if not SUPPORTS_FLOATING_WINDOWS then + -- to make sure the script doesn't stop old FlyWithLua versions + logMsg("imgui not supported by your FlyWithLua version") + return +end + +dataref("rel_engfai0", "sim/operation/failures/rel_engfai0", "writable") +dataref("rel_vacuum", "sim/operation/failures/rel_vacuum", "writable") +dataref("rel_genera0", "sim/operation/failures/rel_genera0", "writable") + + +function isf_on_build(isf_wnd, x, y) + if imgui.Button("Fail Engine", 200, 25) then + rel_engfai0 = 6 + + end + imgui.SameLine() + imgui.SetCursorPosX(250) + + if imgui.Button("Fix Engine", 200, 25) then + rel_engfai0 = 0 + end + imgui.SameLine() + imgui.SetCursorPosX(500) + + if rel_engfai0 == 0 then + -- The following function changes the color of all widgets until PopStyleColor is called. + -- The format is AABBGGRR where A is alpha and B, G and R are blue, green and red. + -- So if you have an HTML color like #2B65EC (ocean blue), swap the first two and last two hex digits + -- and prefix it with FF to use it: + imgui.PushStyleColor(imgui.constant.Col.Text, 0xFF00FF00) + imgui.TextUnformatted("Working") + -- Restore the previous style, this _must_ be called after each pushed style: + imgui.PopStyleColor() + else + imgui.PushStyleColor(imgui.constant.Col.Text, 0xFF0000FF) + imgui.TextUnformatted("Failed") + imgui.PopStyleColor() + end + + imgui.SetCursorPosY(50) + + if imgui.Button("Fail Vacuum Pump", 200, 25) then + rel_vacuum = 6 + + end + imgui.SameLine() + imgui.SetCursorPosX(250) + + if imgui.Button("Fix Vacuum Pump", 200, 25) then + rel_vacuum = 0 + end + imgui.SameLine() + imgui.SetCursorPosX(500) + + if rel_vacuum == 0 then + imgui.PushStyleColor(imgui.constant.Col.Text, 0xFF00FF00) + imgui.TextUnformatted("Working") + imgui.PopStyleColor() + else + imgui.PushStyleColor(imgui.constant.Col.Text, 0xFF0000FF) + imgui.TextUnformatted("Failed") + imgui.PopStyleColor() + end + + + imgui.SetCursorPosY(95) + + if imgui.Button("Fail Generator", 200, 25) then + rel_genera0 = 6 + + end + imgui.SameLine() + imgui.SetCursorPosX(250) + + if imgui.Button("Fix Generator", 200, 25) then + rel_genera0 = 0 + end + imgui.SameLine() + imgui.SetCursorPosX(500) + + if rel_genera0 == 0 then + imgui.PushStyleColor(imgui.constant.Col.Text, 0xFF00FF00) + imgui.TextUnformatted("Working") + imgui.PopStyleColor() + else + imgui.PushStyleColor(imgui.constant.Col.Text, 0xFF0000FF) + imgui.TextUnformatted("Failed") + imgui.PopStyleColor() + end + +end + +isf_wnd = nil + +function isf_show_wnd() + isf_wnd = float_wnd_create(640, 480, 1, true) + float_wnd_set_title(isf_wnd, "Imgui Set Failures") + float_wnd_set_imgui_builder(isf_wnd, "isf_on_build") +end + +function isf_hide_wnd() + if isf_wnd then + float_wnd_destroy(isf_wnd) + end +end + +isf_show_only_once = 0 +isf_hide_only_once = 0 + +function toggle_imgui_show_hide_window_with_command() + isf_show_window = not isf_show_window + if isf_show_window then + if isf_show_only_once == 0 then + isf_show_wnd() + isf_show_only_once = 1 + isf_hide_only_once = 0 + end + else + if isf_hide_only_once == 0 then + isf_hide_wnd() + isf_hide_only_once = 1 + isf_show_only_once = 0 + end + end +end + +add_macro("Imgui Set Failures: open/close", "isf_show_wnd()", "isf_hide_wnd()", "deactivate") +create_command("FlyWithLua/imgui-set-failures-window/show_toggle", "open/close imgui set failures window", "toggle_imgui_set_failures_window()", "", "") diff --git a/FlyWithLua/lin_x64/FlyWithLua.xpl b/FlyWithLua/lin_x64/FlyWithLua.xpl index 648aca5..3b7c429 100755 Binary files a/FlyWithLua/lin_x64/FlyWithLua.xpl and b/FlyWithLua/lin_x64/FlyWithLua.xpl differ diff --git a/FlyWithLua/mac_x64/FlyWithLua.xpl b/FlyWithLua/mac_x64/FlyWithLua.xpl index 04a2f9c..d5d8f2a 100755 Binary files a/FlyWithLua/mac_x64/FlyWithLua.xpl and b/FlyWithLua/mac_x64/FlyWithLua.xpl differ diff --git a/FlyWithLua/win_x64/FlyWithLua.xpl b/FlyWithLua/win_x64/FlyWithLua.xpl index 21ee093..ec5379a 100755 Binary files a/FlyWithLua/win_x64/FlyWithLua.xpl and b/FlyWithLua/win_x64/FlyWithLua.xpl differ diff --git a/src/FlyWithLua.cpp b/src/FlyWithLua.cpp index 5b26fd6..b3baceb 100644 --- a/src/FlyWithLua.cpp +++ b/src/FlyWithLua.cpp @@ -2,7 +2,7 @@ // FlyWithLua Plugin for X-Plane 12 // ---------------------------------- -#define PLUGIN_VERSION_NO "2.8.11" +#define PLUGIN_VERSION_NO "2.8.12" #define PLUGIN_VERSION_BUILD __DATE__ " " __TIME__ #define PLUGIN_VERSION PLUGIN_VERSION_NO " build " PLUGIN_VERSION_BUILD @@ -168,7 +168,8 @@ * v2.8.8 [added] Added support for the horizontal scrollbar in Imgui windows. * v2.8.9 [changed] Now using the X-Plane Fmod SDK for the com1, interior, ui and the master buses. * v2.8.10 [changed] Removed X-Plane LuaJIT alloc because it is not needed and was causing issues with Linux. - * v2.8.11 [changed] Fixed missing Throttle 9 from SaveInitalAssignments.ini Thanks XPJavelin + * v2.8.11 [changed] Fixed missing Throttle 9 from SaveInitalAssignments.ini Thanks XPJavelin from x-plane.org + * v2.8.12 [changed] Fixed issue with do_on_mouse_click now is only called once per mouse click Thanks apn from x-plane.org * * * Markus (Teddii): @@ -7487,7 +7488,7 @@ PLUGIN_API int XPluginEnable(void) //register the mouse capture window XPLMCreateWindow_t MouseWindowData; - MouseWindowData.structSize = 72; // SDK 2 size to work around XPD-9350 + MouseWindowData.structSize = sizeof(MouseWindowData); MouseWindowData.left = 0; MouseWindowData.bottom = 0; XPLMGetScreenSize(&MouseWindowData.right, &MouseWindowData.top);