Skip to content

Commit 81b4672

Browse files
committed
Fix degree symbol on BizHawk 2.9+
1 parent 6d8beee commit 81b4672

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

ScriptHawk.lua

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22
-- Version Check --
33
-------------------
44

5-
if emu.setislagged == nil then -- 1.11.5 (Feb 2016)
5+
degree_symbol = string.char(0xB0);
6+
7+
-- 1.11.5 (Feb 2016)
8+
if emu.setislagged == nil then
69
print("This version of BizHawk is not supported by ScriptHawk");
710
print("Please upgrade to a newer version of BizHawk");
811
print("http://tasvideos.org/Bizhawk.html");
912
return false;
1013
end
1114

12-
if emu.getluacore == nil then -- 2.2.2 (March 2018)
15+
-- 2.2.2 (March 2018)
16+
if emu.getluacore == nil then
1317
function emu.getluacore()
1418
return "NLua";
1519
end
1620
end
1721

1822
-- 2.9 (April 2023)
1923
if math.atan2 == nil then
24+
degree_symbol = "°";
2025
-- Stop the console spam for deprecated ops
2126
emu.getluacore = client.get_lua_engine;
2227
bit = require "lib.pngLua.numberlua";
@@ -825,10 +830,9 @@ if not ScriptHawk.ui_test then
825830
if type(Game) ~= "table" then
826831
-- If game has not been found, check list of games to see whether the ROM Name matches anything and use that instead
827832
if emu.getsystemid() == "N64" then
828-
rom_id = ""
833+
local rom_id = "";
829834
for i = 0, 3 do
830-
data = memory.read_u8(0x3B + i, "ROM")
831-
rom_id = rom_id..string.char(data)
835+
rom_id = rom_id..string.char(memory.read_u8(0x3B + i, "ROM"));
832836
end
833837
for k, v in pairs(supportedGames) do
834838
if rom_id == v.romIdentifier then
@@ -844,7 +848,7 @@ if not ScriptHawk.ui_test then
844848
if v.selfContained then -- Self contained modules that do not require ScriptHawk's functionality and merely use ScriptHawk.lua as a convenient loader
845849
return true;
846850
end
847-
break
851+
break;
848852
end
849853
end
850854
end
@@ -1176,7 +1180,7 @@ function ScriptHawk.UI:formatRotation(num)
11761180
num = 0;
11771181
end
11781182
if rotation_units == "Degrees" then
1179-
return round(rotation_to_degrees(num), precision)..string.char(0xB0);
1183+
return round(rotation_to_degrees(num), precision)..degree_symbol;
11801184
elseif rotation_units == "Radians" then
11811185
return round(rotation_to_radians(num), precision);
11821186
elseif rotation_units == "Hex" then

0 commit comments

Comments
 (0)