diff --git a/cache/src/main/java/net/runelite/cache/ItemManager.java b/cache/src/main/java/net/runelite/cache/ItemManager.java index b3449a51a4..bff27593d6 100644 --- a/cache/src/main/java/net/runelite/cache/ItemManager.java +++ b/cache/src/main/java/net/runelite/cache/ItemManager.java @@ -96,20 +96,18 @@ public class ItemManager implements ItemProvider public void java(File java) throws IOException { java.mkdirs(); - try (IDClass ids = IDClass.create(java, "ItemID")) + try (IDClass ids = IDClass.create(java, "ItemID"); + IDClass nulls = IDClass.create(java, "NullItemID")) { - try (IDClass nulls = IDClass.create(java, "NullItemID")) + for (ItemDefinition def : items.values()) { - for (ItemDefinition def : items.values()) + if (def.name.equalsIgnoreCase("NULL")) { - if (def.name.equalsIgnoreCase("NULL")) - { - nulls.add(def.name, def.id); - } - else - { - ids.add(def.name, def.id); - } + nulls.add(def.name, def.id); + } + else + { + ids.add(def.name, def.id); } } } diff --git a/cache/src/main/java/net/runelite/cache/NpcManager.java b/cache/src/main/java/net/runelite/cache/NpcManager.java index 3124eb455f..04849de69f 100644 --- a/cache/src/main/java/net/runelite/cache/NpcManager.java +++ b/cache/src/main/java/net/runelite/cache/NpcManager.java @@ -95,16 +95,19 @@ public class NpcManager public void java(File java) throws IOException { java.mkdirs(); - try (IDClass ids = IDClass.create(java, "NpcID")) + try (IDClass ids = IDClass.create(java, "NpcID"); + IDClass nulls = IDClass.create(java, "NullNpcID")) { for (NpcDefinition def : npcs.values()) { if (def.name.equalsIgnoreCase("NULL")) { - continue; + nulls.add(def.name, def.id); + } + else + { + ids.add(def.name, def.id); } - - ids.add(def.name, def.id); } } } diff --git a/cache/src/main/java/net/runelite/cache/ObjectManager.java b/cache/src/main/java/net/runelite/cache/ObjectManager.java index cb1372ed65..ba39ae9239 100644 --- a/cache/src/main/java/net/runelite/cache/ObjectManager.java +++ b/cache/src/main/java/net/runelite/cache/ObjectManager.java @@ -95,20 +95,18 @@ public class ObjectManager public void java(File java) throws IOException { java.mkdirs(); - try (IDClass ids = IDClass.create(java, "ObjectID")) + try (IDClass ids = IDClass.create(java, "ObjectID"); + IDClass nulls = IDClass.create(java, "NullObjectID")) { - try (IDClass nulls = IDClass.create(java, "NullObjectID")) + for (ObjectDefinition def : objects.values()) { - for (ObjectDefinition def : objects.values()) + if ("null".equals(def.getName())) { - if ("null".equals(def.getName())) - { - nulls.add(def.getName(), def.getId()); - } - else - { - ids.add(def.getName(), def.getId()); - } + nulls.add(def.getName(), def.getId()); + } + else + { + ids.add(def.getName(), def.getId()); } } } diff --git a/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeTrade.java b/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeTrade.java index 3e886b68cb..0ab9260f7f 100644 --- a/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeTrade.java +++ b/http-api/src/main/java/net/runelite/http/api/ge/GrandExchangeTrade.java @@ -38,6 +38,7 @@ public class GrandExchangeTrade private int dqty; private int total; private int spent; + private int dspent; private int offer; private int slot; private WorldType worldType; diff --git a/runelite-api/src/main/java/net/runelite/api/NullNpcID.java b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java new file mode 100644 index 0000000000..49016c1c50 --- /dev/null +++ b/runelite-api/src/main/java/net/runelite/api/NullNpcID.java @@ -0,0 +1,1085 @@ +/* This file is automatically generated. Do not edit. */ +package net.runelite.api; + +public final class NullNpcID +{ + public static final int NULL = 21; + public static final int NULL_24 = 24; + public static final int NULL_25 = 25; + public static final int NULL_119 = 119; + public static final int NULL_222 = 222; + public static final int NULL_224 = 224; + public static final int NULL_226 = 226; + public static final int NULL_228 = 228; + public static final int NULL_230 = 230; + public static final int NULL_317 = 317; + public static final int NULL_324 = 324; + public static final int NULL_384 = 384; + public static final int NULL_424 = 424; + public static final int NULL_471 = 471; + public static final int NULL_490 = 490; + public static final int NULL_536 = 536; + public static final int NULL_638 = 638; + public static final int NULL_716 = 716; + public static final int NULL_740 = 740; + public static final int NULL_743 = 743; + public static final int NULL_744 = 744; + public static final int NULL_745 = 745; + public static final int NULL_746 = 746; + public static final int NULL_747 = 747; + public static final int NULL_748 = 748; + public static final int NULL_749 = 749; + public static final int NULL_761 = 761; + public static final int NULL_816 = 816; + public static final int NULL_818 = 818; + public static final int NULL_843 = 843; + public static final int NULL_889 = 889; + public static final int NULL_890 = 890; + public static final int NULL_913 = 913; + public static final int NULL_914 = 914; + public static final int NULL_915 = 915; + public static final int NULL_916 = 916; + public static final int NULL_919 = 919; + public static final int NULL_1023 = 1023; + public static final int NULL_1033 = 1033; + public static final int NULL_1034 = 1034; + public static final int NULL_1035 = 1035; + public static final int NULL_1036 = 1036; + public static final int NULL_1063 = 1063; + public static final int NULL_1064 = 1064; + public static final int NULL_1114 = 1114; + public static final int NULL_1115 = 1115; + public static final int NULL_1116 = 1116; + public static final int NULL_1117 = 1117; + public static final int NULL_1136 = 1136; + public static final int NULL_1143 = 1143; + public static final int NULL_1148 = 1148; + public static final int NULL_1149 = 1149; + public static final int NULL_1150 = 1150; + public static final int NULL_1151 = 1151; + public static final int NULL_1180 = 1180; + public static final int NULL_1194 = 1194; + public static final int NULL_1196 = 1196; + public static final int NULL_1239 = 1239; + public static final int NULL_1242 = 1242; + public static final int NULL_1245 = 1245; + public static final int NULL_1248 = 1248; + public static final int NULL_1251 = 1251; + public static final int NULL_1254 = 1254; + public static final int NULL_1321 = 1321; + public static final int NULL_1322 = 1322; + public static final int NULL_1328 = 1328; + public static final int NULL_1329 = 1329; + public static final int NULL_1330 = 1330; + public static final int NULL_1331 = 1331; + public static final int NULL_1332 = 1332; + public static final int NULL_1333 = 1333; + public static final int NULL_1334 = 1334; + public static final int NULL_1359 = 1359; + public static final int NULL_1394 = 1394; + public static final int NULL_1423 = 1423; + public static final int NULL_1424 = 1424; + public static final int NULL_1426 = 1426; + public static final int NULL_1427 = 1427; + public static final int NULL_1449 = 1449; + public static final int NULL_1450 = 1450; + public static final int NULL_1451 = 1451; + public static final int NULL_1452 = 1452; + public static final int NULL_1455 = 1455; + public static final int NULL_1456 = 1456; + public static final int NULL_1457 = 1457; + public static final int NULL_1458 = 1458; + public static final int NULL_1459 = 1459; + public static final int NULL_1491 = 1491; + public static final int NULL_1492 = 1492; + public static final int NULL_1493 = 1493; + public static final int NULL_1763 = 1763; + public static final int NULL_1812 = 1812; + public static final int NULL_1819 = 1819; + public static final int NULL_1820 = 1820; + public static final int NULL_1821 = 1821; + public static final int NULL_1822 = 1822; + public static final int NULL_1823 = 1823; + public static final int NULL_1824 = 1824; + public static final int NULL_1836 = 1836; + public static final int NULL_1837 = 1837; + public static final int NULL_1858 = 1858; + public static final int NULL_1859 = 1859; + public static final int NULL_1860 = 1860; + public static final int NULL_1868 = 1868; + public static final int NULL_1946 = 1946; + public static final int NULL_1953 = 1953; + public static final int NULL_1954 = 1954; + public static final int NULL_1955 = 1955; + public static final int NULL_1956 = 1956; + public static final int NULL_1957 = 1957; + public static final int NULL_1958 = 1958; + public static final int NULL_1959 = 1959; + public static final int NULL_1960 = 1960; + public static final int NULL_1961 = 1961; + public static final int NULL_1962 = 1962; + public static final int NULL_1963 = 1963; + public static final int NULL_1964 = 1964; + public static final int NULL_1965 = 1965; + public static final int NULL_1966 = 1966; + public static final int NULL_1967 = 1967; + public static final int NULL_1968 = 1968; + public static final int NULL_1969 = 1969; + public static final int NULL_1970 = 1970; + public static final int NULL_1971 = 1971; + public static final int NULL_1972 = 1972; + public static final int NULL_1973 = 1973; + public static final int NULL_1974 = 1974; + public static final int NULL_1975 = 1975; + public static final int NULL_1976 = 1976; + public static final int NULL_1977 = 1977; + public static final int NULL_1978 = 1978; + public static final int NULL_1979 = 1979; + public static final int NULL_1980 = 1980; + public static final int NULL_1981 = 1981; + public static final int NULL_1982 = 1982; + public static final int NULL_1983 = 1983; + public static final int NULL_1984 = 1984; + public static final int NULL_1985 = 1985; + public static final int NULL_1986 = 1986; + public static final int NULL_1987 = 1987; + public static final int NULL_1988 = 1988; + public static final int NULL_1989 = 1989; + public static final int NULL_1994 = 1994; + public static final int NULL_1995 = 1995; + public static final int NULL_1996 = 1996; + public static final int NULL_2009 = 2009; + public static final int NULL_2010 = 2010; + public static final int NULL_2011 = 2011; + public static final int NULL_2012 = 2012; + public static final int NULL_2013 = 2013; + public static final int NULL_2014 = 2014; + public static final int NULL_2015 = 2015; + public static final int NULL_2016 = 2016; + public static final int NULL_2017 = 2017; + public static final int NULL_2019 = 2019; + public static final int NULL_2020 = 2020; + public static final int NULL_2021 = 2021; + public static final int NULL_2022 = 2022; + public static final int NULL_2023 = 2023; + public static final int NULL_2024 = 2024; + public static final int NULL_2109 = 2109; + public static final int NULL_2124 = 2124; + public static final int NULL_2231 = 2231; + public static final int NULL_2260 = 2260; + public static final int NULL_2432 = 2432; + public static final int NULL_2493 = 2493; + public static final int NULL_2779 = 2779; + public static final int NULL_2780 = 2780; + public static final int NULL_2781 = 2781; + public static final int NULL_2934 = 2934; + public static final int NULL_2935 = 2935; + public static final int NULL_2936 = 2936; + public static final int NULL_2937 = 2937; + public static final int NULL_2938 = 2938; + public static final int NULL_2939 = 2939; + public static final int NULL_2940 = 2940; + public static final int NULL_2941 = 2941; + public static final int NULL_2942 = 2942; + public static final int NULL_2943 = 2943; + public static final int NULL_2944 = 2944; + public static final int NULL_2945 = 2945; + public static final int NULL_2964 = 2964; + public static final int NULL_2965 = 2965; + public static final int NULL_2966 = 2966; + public static final int NULL_2967 = 2967; + public static final int NULL_2968 = 2968; + public static final int NULL_2969 = 2969; + public static final int NULL_2970 = 2970; + public static final int NULL_2971 = 2971; + public static final int NULL_2973 = 2973; + public static final int NULL_2979 = 2979; + public static final int NULL_2990 = 2990; + public static final int NULL_2991 = 2991; + public static final int NULL_3087 = 3087; + public static final int NULL_3104 = 3104; + public static final int NULL_3186 = 3186; + public static final int NULL_3187 = 3187; + public static final int NULL_3188 = 3188; + public static final int NULL_3197 = 3197; + public static final int NULL_3198 = 3198; + public static final int NULL_3206 = 3206; + public static final int NULL_3228 = 3228; + public static final int NULL_3229 = 3229; + public static final int NULL_3230 = 3230; + public static final int NULL_3363 = 3363; + public static final int NULL_3365 = 3365; + public static final int NULL_3366 = 3366; + public static final int NULL_3367 = 3367; + public static final int NULL_3368 = 3368; + public static final int NULL_3399 = 3399; + public static final int NULL_3427 = 3427; + public static final int NULL_3430 = 3430; + public static final int NULL_3431 = 3431; + public static final int NULL_3435 = 3435; + public static final int NULL_3487 = 3487; + public static final int NULL_3488 = 3488; + public static final int NULL_3489 = 3489; + public static final int NULL_3500 = 3500; + public static final int NULL_3567 = 3567; + public static final int NULL_3650 = 3650; + public static final int NULL_3670 = 3670; + public static final int NULL_3773 = 3773; + public static final int NULL_3828 = 3828; + public static final int NULL_3854 = 3854; + public static final int NULL_3857 = 3857; + public static final int NULL_3926 = 3926; + public static final int NULL_3927 = 3927; + public static final int NULL_3983 = 3983; + public static final int NULL_3990 = 3990; + public static final int NULL_3991 = 3991; + public static final int NULL_3992 = 3992; + public static final int NULL_3993 = 3993; + public static final int NULL_4003 = 4003; + public static final int NULL_4006 = 4006; + public static final int NULL_4007 = 4007; + public static final int NULL_4008 = 4008; + public static final int NULL_4009 = 4009; + public static final int NULL_4013 = 4013; + public static final int NULL_4113 = 4113; + public static final int NULL_4211 = 4211; + public static final int NULL_4254 = 4254; + public static final int NULL_4258 = 4258; + public static final int NULL_4259 = 4259; + public static final int NULL_4260 = 4260; + public static final int NULL_4261 = 4261; + public static final int NULL_4262 = 4262; + public static final int NULL_4267 = 4267; + public static final int NULL_4273 = 4273; + public static final int NULL_4297 = 4297; + public static final int NULL_4300 = 4300; + public static final int NULL_4338 = 4338; + public static final int NULL_4339 = 4339; + public static final int NULL_4341 = 4341; + public static final int NULL_4408 = 4408; + public static final int NULL_4410 = 4410; + public static final int NULL_4415 = 4415; + public static final int NULL_4418 = 4418; + public static final int NULL_4479 = 4479; + public static final int NULL_4507 = 4507; + public static final int NULL_4515 = 4515; + public static final int NULL_4528 = 4528; + public static final int NULL_4529 = 4529; + public static final int NULL_4530 = 4530; + public static final int NULL_4531 = 4531; + public static final int NULL_4532 = 4532; + public static final int NULL_4536 = 4536; + public static final int NULL_4537 = 4537; + public static final int NULL_4538 = 4538; + public static final int NULL_4539 = 4539; + public static final int NULL_4540 = 4540; + public static final int NULL_4541 = 4541; + public static final int NULL_4542 = 4542; + public static final int NULL_4544 = 4544; + public static final int NULL_4545 = 4545; + public static final int NULL_4546 = 4546; + public static final int NULL_4547 = 4547; + public static final int NULL_4548 = 4548; + public static final int NULL_4549 = 4549; + public static final int NULL_4550 = 4550; + public static final int NULL_4554 = 4554; + public static final int NULL_4555 = 4555; + public static final int NULL_4556 = 4556; + public static final int NULL_4557 = 4557; + public static final int NULL_4558 = 4558; + public static final int NULL_4559 = 4559; + public static final int NULL_4560 = 4560; + public static final int NULL_4728 = 4728; + public static final int NULL_4729 = 4729; + public static final int NULL_4730 = 4730; + public static final int NULL_4731 = 4731; + public static final int NULL_4732 = 4732; + public static final int NULL_4765 = 4765; + public static final int NULL_4785 = 4785; + public static final int NULL_4786 = 4786; + public static final int NULL_4815 = 4815; + public static final int NULL_4939 = 4939; + public static final int NULL_4940 = 4940; + public static final int NULL_4941 = 4941; + public static final int NULL_4942 = 4942; + public static final int NULL_4943 = 4943; + public static final int NULL_4944 = 4944; + public static final int NULL_4945 = 4945; + public static final int NULL_4946 = 4946; + public static final int NULL_4947 = 4947; + public static final int NULL_4948 = 4948; + public static final int NULL_4949 = 4949; + public static final int NULL_4950 = 4950; + public static final int NULL_4951 = 4951; + public static final int NULL_4952 = 4952; + public static final int NULL_4953 = 4953; + public static final int NULL_4954 = 4954; + public static final int NULL_4955 = 4955; + public static final int NULL_4956 = 4956; + public static final int NULL_4957 = 4957; + public static final int NULL_4971 = 4971; + public static final int NULL_4983 = 4983; + public static final int NULL_4986 = 4986; + public static final int NULL_4988 = 4988; + public static final int NULL_5005 = 5005; + public static final int NULL_5047 = 5047; + public static final int NULL_5049 = 5049; + public static final int NULL_5050 = 5050; + public static final int NULL_5058 = 5058; + public static final int NULL_5059 = 5059; + public static final int NULL_5060 = 5060; + public static final int NULL_5064 = 5064; + public static final int NULL_5065 = 5065; + public static final int NULL_5071 = 5071; + public static final int NULL_5183 = 5183; + public static final int NULL_5227 = 5227; + public static final int NULL_5236 = 5236; + public static final int NULL_5285 = 5285; + public static final int NULL_5286 = 5286; + public static final int NULL_5287 = 5287; + public static final int NULL_5292 = 5292; + public static final int NULL_5298 = 5298; + public static final int NULL_5301 = 5301; + public static final int NULL_5310 = 5310; + public static final int NULL_5311 = 5311; + public static final int NULL_5312 = 5312; + public static final int NULL_5314 = 5314; + public static final int NULL_5324 = 5324; + public static final int NULL_5325 = 5325; + public static final int NULL_5382 = 5382; + public static final int NULL_5411 = 5411; + public static final int NULL_5424 = 5424; + public static final int NULL_5425 = 5425; + public static final int NULL_5446 = 5446; + public static final int NULL_5490 = 5490; + public static final int NULL_5494 = 5494; + public static final int NULL_5495 = 5495; + public static final int NULL_5496 = 5496; + public static final int NULL_5497 = 5497; + public static final int NULL_5498 = 5498; + public static final int NULL_5499 = 5499; + public static final int NULL_5501 = 5501; + public static final int NULL_5516 = 5516; + public static final int NULL_5530 = 5530; + public static final int NULL_5664 = 5664; + public static final int NULL_5733 = 5733; + public static final int NULL_5849 = 5849; + public static final int NULL_5850 = 5850; + public static final int NULL_5851 = 5851; + public static final int NULL_5852 = 5852; + public static final int NULL_5857 = 5857; + public static final int NULL_5858 = 5858; + public static final int NULL_5859 = 5859; + public static final int NULL_5865 = 5865; + public static final int NULL_5885 = 5885; + public static final int NULL_5898 = 5898; + public static final int NULL_5899 = 5899; + public static final int NULL_5900 = 5900; + public static final int NULL_5901 = 5901; + public static final int NULL_5902 = 5902; + public static final int NULL_5903 = 5903; + public static final int NULL_5930 = 5930; + public static final int NULL_5953 = 5953; + public static final int NULL_6093 = 6093; + public static final int NULL_6104 = 6104; + public static final int NULL_6105 = 6105; + public static final int NULL_6106 = 6106; + public static final int NULL_6107 = 6107; + public static final int NULL_6108 = 6108; + public static final int NULL_6109 = 6109; + public static final int NULL_6110 = 6110; + public static final int NULL_6111 = 6111; + public static final int NULL_6112 = 6112; + public static final int NULL_6113 = 6113; + public static final int NULL_6114 = 6114; + public static final int NULL_6115 = 6115; + public static final int NULL_6116 = 6116; + public static final int NULL_6117 = 6117; + public static final int NULL_6122 = 6122; + public static final int NULL_6123 = 6123; + public static final int NULL_6124 = 6124; + public static final int NULL_6125 = 6125; + public static final int NULL_6126 = 6126; + public static final int NULL_6127 = 6127; + public static final int NULL_6128 = 6128; + public static final int NULL_6129 = 6129; + public static final int NULL_6130 = 6130; + public static final int NULL_6131 = 6131; + public static final int NULL_6132 = 6132; + public static final int NULL_6133 = 6133; + public static final int NULL_6134 = 6134; + public static final int NULL_6135 = 6135; + public static final int NULL_6136 = 6136; + public static final int NULL_6137 = 6137; + public static final int NULL_6138 = 6138; + public static final int NULL_6139 = 6139; + public static final int NULL_6140 = 6140; + public static final int NULL_6141 = 6141; + public static final int NULL_6142 = 6142; + public static final int NULL_6143 = 6143; + public static final int NULL_6144 = 6144; + public static final int NULL_6145 = 6145; + public static final int NULL_6146 = 6146; + public static final int NULL_6147 = 6147; + public static final int NULL_6148 = 6148; + public static final int NULL_6149 = 6149; + public static final int NULL_6150 = 6150; + public static final int NULL_6151 = 6151; + public static final int NULL_6152 = 6152; + public static final int NULL_6153 = 6153; + public static final int NULL_6154 = 6154; + public static final int NULL_6155 = 6155; + public static final int NULL_6156 = 6156; + public static final int NULL_6157 = 6157; + public static final int NULL_6158 = 6158; + public static final int NULL_6159 = 6159; + public static final int NULL_6160 = 6160; + public static final int NULL_6161 = 6161; + public static final int NULL_6162 = 6162; + public static final int NULL_6163 = 6163; + public static final int NULL_6164 = 6164; + public static final int NULL_6165 = 6165; + public static final int NULL_6166 = 6166; + public static final int NULL_6167 = 6167; + public static final int NULL_6168 = 6168; + public static final int NULL_6169 = 6169; + public static final int NULL_6170 = 6170; + public static final int NULL_6171 = 6171; + public static final int NULL_6172 = 6172; + public static final int NULL_6173 = 6173; + public static final int NULL_6174 = 6174; + public static final int NULL_6175 = 6175; + public static final int NULL_6176 = 6176; + public static final int NULL_6179 = 6179; + public static final int NULL_6180 = 6180; + public static final int NULL_6181 = 6181; + public static final int NULL_6182 = 6182; + public static final int NULL_6183 = 6183; + public static final int NULL_6184 = 6184; + public static final int NULL_6185 = 6185; + public static final int NULL_6186 = 6186; + public static final int NULL_6187 = 6187; + public static final int NULL_6188 = 6188; + public static final int NULL_6189 = 6189; + public static final int NULL_6190 = 6190; + public static final int NULL_6191 = 6191; + public static final int NULL_6192 = 6192; + public static final int NULL_6193 = 6193; + public static final int NULL_6194 = 6194; + public static final int NULL_6195 = 6195; + public static final int NULL_6196 = 6196; + public static final int NULL_6197 = 6197; + public static final int NULL_6198 = 6198; + public static final int NULL_6199 = 6199; + public static final int NULL_6200 = 6200; + public static final int NULL_6201 = 6201; + public static final int NULL_6202 = 6202; + public static final int NULL_6203 = 6203; + public static final int NULL_6204 = 6204; + public static final int NULL_6205 = 6205; + public static final int NULL_6206 = 6206; + public static final int NULL_6207 = 6207; + public static final int NULL_6208 = 6208; + public static final int NULL_6209 = 6209; + public static final int NULL_6210 = 6210; + public static final int NULL_6211 = 6211; + public static final int NULL_6212 = 6212; + public static final int NULL_6213 = 6213; + public static final int NULL_6214 = 6214; + public static final int NULL_6215 = 6215; + public static final int NULL_6216 = 6216; + public static final int NULL_6217 = 6217; + public static final int NULL_6218 = 6218; + public static final int NULL_6219 = 6219; + public static final int NULL_6220 = 6220; + public static final int NULL_6221 = 6221; + public static final int NULL_6222 = 6222; + public static final int NULL_6223 = 6223; + public static final int NULL_6224 = 6224; + public static final int NULL_6225 = 6225; + public static final int NULL_6226 = 6226; + public static final int NULL_6227 = 6227; + public static final int NULL_6228 = 6228; + public static final int NULL_6229 = 6229; + public static final int NULL_6230 = 6230; + public static final int NULL_6231 = 6231; + public static final int NULL_6232 = 6232; + public static final int NULL_6233 = 6233; + public static final int NULL_6234 = 6234; + public static final int NULL_6235 = 6235; + public static final int NULL_6236 = 6236; + public static final int NULL_6237 = 6237; + public static final int NULL_6238 = 6238; + public static final int NULL_6239 = 6239; + public static final int NULL_6240 = 6240; + public static final int NULL_6241 = 6241; + public static final int NULL_6242 = 6242; + public static final int NULL_6243 = 6243; + public static final int NULL_6244 = 6244; + public static final int NULL_6245 = 6245; + public static final int NULL_6246 = 6246; + public static final int NULL_6247 = 6247; + public static final int NULL_6248 = 6248; + public static final int NULL_6249 = 6249; + public static final int NULL_6250 = 6250; + public static final int NULL_6251 = 6251; + public static final int NULL_6252 = 6252; + public static final int NULL_6253 = 6253; + public static final int NULL_6254 = 6254; + public static final int NULL_6255 = 6255; + public static final int NULL_6256 = 6256; + public static final int NULL_6257 = 6257; + public static final int NULL_6258 = 6258; + public static final int NULL_6259 = 6259; + public static final int NULL_6260 = 6260; + public static final int NULL_6261 = 6261; + public static final int NULL_6262 = 6262; + public static final int NULL_6263 = 6263; + public static final int NULL_6264 = 6264; + public static final int NULL_6265 = 6265; + public static final int NULL_6266 = 6266; + public static final int NULL_6268 = 6268; + public static final int NULL_6269 = 6269; + public static final int NULL_6270 = 6270; + public static final int NULL_6274 = 6274; + public static final int NULL_6275 = 6275; + public static final int NULL_6276 = 6276; + public static final int NULL_6277 = 6277; + public static final int NULL_6278 = 6278; + public static final int NULL_6279 = 6279; + public static final int NULL_6280 = 6280; + public static final int NULL_6281 = 6281; + public static final int NULL_6282 = 6282; + public static final int NULL_6283 = 6283; + public static final int NULL_6284 = 6284; + public static final int NULL_6285 = 6285; + public static final int NULL_6286 = 6286; + public static final int NULL_6287 = 6287; + public static final int NULL_6288 = 6288; + public static final int NULL_6289 = 6289; + public static final int NULL_6290 = 6290; + public static final int NULL_6403 = 6403; + public static final int NULL_6404 = 6404; + public static final int NULL_6405 = 6405; + public static final int NULL_6486 = 6486; + public static final int NULL_6487 = 6487; + public static final int NULL_6489 = 6489; + public static final int NULL_6507 = 6507; + public static final int NULL_6508 = 6508; + public static final int NULL_6511 = 6511; + public static final int NULL_6520 = 6520; + public static final int NULL_6521 = 6521; + public static final int NULL_6522 = 6522; + public static final int NULL_6523 = 6523; + public static final int NULL_6528 = 6528; + public static final int NULL_6534 = 6534; + public static final int NULL_6535 = 6535; + public static final int NULL_6536 = 6536; + public static final int NULL_6537 = 6537; + public static final int NULL_6538 = 6538; + public static final int NULL_6539 = 6539; + public static final int NULL_6540 = 6540; + public static final int NULL_6541 = 6541; + public static final int NULL_6542 = 6542; + public static final int NULL_6543 = 6543; + public static final int NULL_6544 = 6544; + public static final int NULL_6545 = 6545; + public static final int NULL_6546 = 6546; + public static final int NULL_6547 = 6547; + public static final int NULL_6548 = 6548; + public static final int NULL_6549 = 6549; + public static final int NULL_6550 = 6550; + public static final int NULL_6551 = 6551; + public static final int NULL_6552 = 6552; + public static final int NULL_6553 = 6553; + public static final int NULL_6554 = 6554; + public static final int NULL_6555 = 6555; + public static final int NULL_6556 = 6556; + public static final int NULL_6557 = 6557; + public static final int NULL_6558 = 6558; + public static final int NULL_6559 = 6559; + public static final int NULL_6560 = 6560; + public static final int NULL_6563 = 6563; + public static final int NULL_6573 = 6573; + public static final int NULL_6577 = 6577; + public static final int NULL_6578 = 6578; + public static final int NULL_6585 = 6585; + public static final int NULL_6622 = 6622; + public static final int NULL_6623 = 6623; + public static final int NULL_6704 = 6704; + public static final int NULL_6705 = 6705; + public static final int NULL_6706 = 6706; + public static final int NULL_6707 = 6707; + public static final int NULL_6708 = 6708; + public static final int NULL_6709 = 6709; + public static final int NULL_6710 = 6710; + public static final int NULL_6711 = 6711; + public static final int NULL_6712 = 6712; + public static final int NULL_6713 = 6713; + public static final int NULL_6714 = 6714; + public static final int NULL_6760 = 6760; + public static final int NULL_6761 = 6761; + public static final int NULL_6763 = 6763; + public static final int NULL_6764 = 6764; + public static final int NULL_6765 = 6765; + public static final int NULL_6778 = 6778; + public static final int NULL_6782 = 6782; + public static final int NULL_6783 = 6783; + public static final int NULL_6786 = 6786; + public static final int NULL_6787 = 6787; + public static final int NULL_6788 = 6788; + public static final int NULL_6789 = 6789; + public static final int NULL_6790 = 6790; + public static final int NULL_6791 = 6791; + public static final int NULL_6796 = 6796; + public static final int NULL_6807 = 6807; + public static final int NULL_6808 = 6808; + public static final int NULL_6809 = 6809; + public static final int NULL_6810 = 6810; + public static final int NULL_6819 = 6819; + public static final int NULL_6820 = 6820; + public static final int NULL_6821 = 6821; + public static final int NULL_6822 = 6822; + public static final int NULL_7070 = 7070; + public static final int NULL_7175 = 7175; + public static final int NULL_7177 = 7177; + public static final int NULL_7179 = 7179; + public static final int NULL_7180 = 7180; + public static final int NULL_7181 = 7181; + public static final int NULL_7182 = 7182; + public static final int NULL_7183 = 7183; + public static final int NULL_7184 = 7184; + public static final int NULL_7185 = 7185; + public static final int NULL_7186 = 7186; + public static final int NULL_7187 = 7187; + public static final int NULL_7188 = 7188; + public static final int NULL_7189 = 7189; + public static final int NULL_7190 = 7190; + public static final int NULL_7191 = 7191; + public static final int NULL_7192 = 7192; + public static final int NULL_7193 = 7193; + public static final int NULL_7194 = 7194; + public static final int NULL_7195 = 7195; + public static final int NULL_7196 = 7196; + public static final int NULL_7197 = 7197; + public static final int NULL_7198 = 7198; + public static final int NULL_7208 = 7208; + public static final int NULL_7210 = 7210; + public static final int NULL_7211 = 7211; + public static final int NULL_7227 = 7227; + public static final int NULL_7228 = 7228; + public static final int NULL_7229 = 7229; + public static final int NULL_7230 = 7230; + public static final int NULL_7231 = 7231; + public static final int NULL_7313 = 7313; + public static final int NULL_7314 = 7314; + public static final int NULL_7315 = 7315; + public static final int NULL_7318 = 7318; + public static final int NULL_7319 = 7319; + public static final int NULL_7320 = 7320; + public static final int NULL_7322 = 7322; + public static final int NULL_7325 = 7325; + public static final int NULL_7326 = 7326; + public static final int NULL_7373 = 7373; + public static final int NULL_7375 = 7375; + public static final int NULL_7382 = 7382; + public static final int NULL_7428 = 7428; + public static final int NULL_7429 = 7429; + public static final int NULL_7430 = 7430; + public static final int NULL_7431 = 7431; + public static final int NULL_7432 = 7432; + public static final int NULL_7433 = 7433; + public static final int NULL_7434 = 7434; + public static final int NULL_7435 = 7435; + public static final int NULL_7436 = 7436; + public static final int NULL_7457 = 7457; + public static final int NULL_7458 = 7458; + public static final int NULL_7489 = 7489; + public static final int NULL_7492 = 7492; + public static final int NULL_7493 = 7493; + public static final int NULL_7494 = 7494; + public static final int NULL_7495 = 7495; + public static final int NULL_7496 = 7496; + public static final int NULL_7497 = 7497; + public static final int NULL_7498 = 7498; + public static final int NULL_7499 = 7499; + public static final int NULL_7500 = 7500; + public static final int NULL_7501 = 7501; + public static final int NULL_7502 = 7502; + public static final int NULL_7503 = 7503; + public static final int NULL_7504 = 7504; + public static final int NULL_7505 = 7505; + public static final int NULL_7506 = 7506; + public static final int NULL_7507 = 7507; + public static final int NULL_7508 = 7508; + public static final int NULL_7547 = 7547; + public static final int NULL_7556 = 7556; + public static final int NULL_7557 = 7557; + public static final int NULL_7596 = 7596; + public static final int NULL_7617 = 7617; + public static final int NULL_7618 = 7618; + public static final int NULL_7619 = 7619; + public static final int NULL_7634 = 7634; + public static final int NULL_7639 = 7639; + public static final int NULL_7655 = 7655; + public static final int NULL_7735 = 7735; + public static final int NULL_7767 = 7767; + public static final int NULL_7819 = 7819; + public static final int NULL_7820 = 7820; + public static final int NULL_7821 = 7821; + public static final int NULL_7822 = 7822; + public static final int NULL_7823 = 7823; + public static final int NULL_7824 = 7824; + public static final int NULL_7825 = 7825; + public static final int NULL_7826 = 7826; + public static final int NULL_7827 = 7827; + public static final int NULL_7828 = 7828; + public static final int NULL_7829 = 7829; + public static final int NULL_7830 = 7830; + public static final int NULL_7831 = 7831; + public static final int NULL_7832 = 7832; + public static final int NULL_7833 = 7833; + public static final int NULL_7834 = 7834; + public static final int NULL_7835 = 7835; + public static final int NULL_7836 = 7836; + public static final int NULL_7837 = 7837; + public static final int NULL_7838 = 7838; + public static final int NULL_7839 = 7839; + public static final int NULL_7840 = 7840; + public static final int NULL_7841 = 7841; + public static final int NULL_7842 = 7842; + public static final int NULL_7843 = 7843; + public static final int NULL_7844 = 7844; + public static final int NULL_7845 = 7845; + public static final int NULL_7846 = 7846; + public static final int NULL_7847 = 7847; + public static final int NULL_7848 = 7848; + public static final int NULL_7856 = 7856; + public static final int NULL_7857 = 7857; + public static final int NULL_7925 = 7925; + public static final int NULL_7926 = 7926; + public static final int NULL_7927 = 7927; + public static final int NULL_7928 = 7928; + public static final int NULL_7929 = 7929; + public static final int NULL_7930 = 7930; + public static final int NULL_7942 = 7942; + public static final int NULL_7944 = 7944; + public static final int NULL_7945 = 7945; + public static final int NULL_7959 = 7959; + public static final int NULL_7960 = 7960; + public static final int NULL_7962 = 7962; + public static final int NULL_7968 = 7968; + public static final int NULL_7973 = 7973; + public static final int NULL_7974 = 7974; + public static final int NULL_7977 = 7977; + public static final int NULL_7978 = 7978; + public static final int NULL_7980 = 7980; + public static final int NULL_7993 = 7993; + public static final int NULL_7994 = 7994; + public static final int NULL_8014 = 8014; + public static final int NULL_8015 = 8015; + public static final int NULL_8016 = 8016; + public static final int NULL_8017 = 8017; + public static final int NULL_8018 = 8018; + public static final int NULL_8032 = 8032; + public static final int NULL_8109 = 8109; + public static final int NULL_8110 = 8110; + public static final int NULL_8141 = 8141; + public static final int NULL_8190 = 8190; + public static final int NULL_8191 = 8191; + public static final int NULL_8192 = 8192; + public static final int NULL_8234 = 8234; + public static final int NULL_8265 = 8265; + public static final int NULL_8266 = 8266; + public static final int NULL_8272 = 8272; + public static final int NULL_8277 = 8277; + public static final int NULL_8278 = 8278; + public static final int NULL_8279 = 8279; + public static final int NULL_8280 = 8280; + public static final int NULL_8281 = 8281; + public static final int NULL_8282 = 8282; + public static final int NULL_8283 = 8283; + public static final int NULL_8284 = 8284; + public static final int NULL_8285 = 8285; + public static final int NULL_8286 = 8286; + public static final int NULL_8289 = 8289; + public static final int NULL_8290 = 8290; + public static final int NULL_8291 = 8291; + public static final int NULL_8292 = 8292; + public static final int NULL_8293 = 8293; + public static final int NULL_8294 = 8294; + public static final int NULL_8295 = 8295; + public static final int NULL_8296 = 8296; + public static final int NULL_8308 = 8308; + public static final int NULL_8309 = 8309; + public static final int NULL_8310 = 8310; + public static final int NULL_8311 = 8311; + public static final int NULL_8312 = 8312; + public static final int NULL_8313 = 8313; + public static final int NULL_8314 = 8314; + public static final int NULL_8315 = 8315; + public static final int NULL_8316 = 8316; + public static final int NULL_8317 = 8317; + public static final int NULL_8318 = 8318; + public static final int NULL_8319 = 8319; + public static final int NULL_8358 = 8358; + public static final int NULL_8380 = 8380; + public static final int NULL_8386 = 8386; + public static final int NULL_8389 = 8389; + public static final int NULL_8392 = 8392; + public static final int NULL_8393 = 8393; + public static final int NULL_8394 = 8394; + public static final int NULL_8395 = 8395; + public static final int NULL_8396 = 8396; + public static final int NULL_8397 = 8397; + public static final int NULL_8398 = 8398; + public static final int NULL_8399 = 8399; + public static final int NULL_8406 = 8406; + public static final int NULL_8408 = 8408; + public static final int NULL_8412 = 8412; + public static final int NULL_8413 = 8413; + public static final int NULL_8414 = 8414; + public static final int NULL_8415 = 8415; + public static final int NULL_8416 = 8416; + public static final int NULL_8417 = 8417; + public static final int NULL_8418 = 8418; + public static final int NULL_8420 = 8420; + public static final int NULL_8421 = 8421; + public static final int NULL_8423 = 8423; + public static final int NULL_8427 = 8427; + public static final int NULL_8432 = 8432; + public static final int NULL_8433 = 8433; + public static final int NULL_8436 = 8436; + public static final int NULL_8437 = 8437; + public static final int NULL_8441 = 8441; + public static final int NULL_8443 = 8443; + public static final int NULL_8457 = 8457; + public static final int NULL_8458 = 8458; + public static final int NULL_8461 = 8461; + public static final int NULL_8462 = 8462; + public static final int NULL_8465 = 8465; + public static final int NULL_8466 = 8466; + public static final int NULL_8468 = 8468; + public static final int NULL_8469 = 8469; + public static final int NULL_8477 = 8477; + public static final int NULL_8478 = 8478; + public static final int NULL_8486 = 8486; + public static final int NULL_8488 = 8488; + public static final int NULL_8489 = 8489; + public static final int NULL_8490 = 8490; + public static final int NULL_8516 = 8516; + public static final int NULL_8624 = 8624; + public static final int NULL_8625 = 8625; + public static final int NULL_8626 = 8626; + public static final int NULL_8627 = 8627; + public static final int NULL_8628 = 8628; + public static final int NULL_8632 = 8632; + public static final int NULL_8639 = 8639; + public static final int NULL_8640 = 8640; + public static final int NULL_8641 = 8641; + public static final int NULL_8642 = 8642; + public static final int NULL_8643 = 8643; + public static final int NULL_8645 = 8645; + public static final int NULL_8646 = 8646; + public static final int NULL_8647 = 8647; + public static final int NULL_8648 = 8648; + public static final int NULL_8649 = 8649; + public static final int NULL_8650 = 8650; + public static final int NULL_8651 = 8651; + public static final int NULL_8652 = 8652; + public static final int NULL_8653 = 8653; + public static final int NULL_8654 = 8654; + public static final int NULL_8655 = 8655; + public static final int NULL_8656 = 8656; + public static final int NULL_8657 = 8657; + public static final int NULL_8658 = 8658; + public static final int NULL_8659 = 8659; + public static final int NULL_8660 = 8660; + public static final int NULL_8661 = 8661; + public static final int NULL_8662 = 8662; + public static final int NULL_8663 = 8663; + public static final int NULL_8664 = 8664; + public static final int NULL_8668 = 8668; + public static final int NULL_8669 = 8669; + public static final int NULL_8670 = 8670; + public static final int NULL_8671 = 8671; + public static final int NULL_8672 = 8672; + public static final int NULL_8673 = 8673; + public static final int NULL_8674 = 8674; + public static final int NULL_8677 = 8677; + public static final int NULL_8689 = 8689; + public static final int NULL_8695 = 8695; + public static final int NULL_8716 = 8716; + public static final int NULL_8717 = 8717; + public static final int NULL_8718 = 8718; + public static final int NULL_8719 = 8719; + public static final int NULL_8720 = 8720; + public static final int NULL_8734 = 8734; + public static final int NULL_8735 = 8735; + public static final int NULL_8740 = 8740; + public static final int NULL_8785 = 8785; + public static final int NULL_8786 = 8786; + public static final int NULL_8787 = 8787; + public static final int NULL_8788 = 8788; + public static final int NULL_8789 = 8789; + public static final int NULL_8790 = 8790; + public static final int NULL_8796 = 8796; + public static final int NULL_8817 = 8817; + public static final int NULL_8820 = 8820; + public static final int NULL_8824 = 8824; + public static final int NULL_8826 = 8826; + public static final int NULL_8828 = 8828; + public static final int NULL_8896 = 8896; + public static final int NULL_8900 = 8900; + public static final int NULL_8905 = 8905; + public static final int NULL_8909 = 8909; + public static final int NULL_8912 = 8912; + public static final int NULL_8916 = 8916; + public static final int NULL_8977 = 8977; + public static final int NULL_9012 = 9012; + public static final int NULL_9025 = 9025; + public static final int NULL_9039 = 9039; + public static final int NULL_9147 = 9147; + public static final int NULL_9203 = 9203; + public static final int NULL_9204 = 9204; + public static final int NULL_9205 = 9205; + public static final int NULL_9206 = 9206; + public static final int NULL_9207 = 9207; + public static final int NULL_9208 = 9208; + public static final int NULL_9209 = 9209; + public static final int NULL_9210 = 9210; + public static final int NULL_9211 = 9211; + public static final int NULL_9212 = 9212; + public static final int NULL_9213 = 9213; + public static final int NULL_9214 = 9214; + public static final int NULL_9215 = 9215; + public static final int NULL_9216 = 9216; + public static final int NULL_9217 = 9217; + public static final int NULL_9218 = 9218; + public static final int NULL_9219 = 9219; + public static final int NULL_9220 = 9220; + public static final int NULL_9221 = 9221; + public static final int NULL_9222 = 9222; + public static final int NULL_9223 = 9223; + public static final int NULL_9224 = 9224; + public static final int NULL_9225 = 9225; + public static final int NULL_9226 = 9226; + public static final int NULL_9227 = 9227; + public static final int NULL_9228 = 9228; + public static final int NULL_9229 = 9229; + public static final int NULL_9230 = 9230; + public static final int NULL_9231 = 9231; + public static final int NULL_9232 = 9232; + public static final int NULL_9233 = 9233; + public static final int NULL_9234 = 9234; + public static final int NULL_9235 = 9235; + public static final int NULL_9236 = 9236; + public static final int NULL_9237 = 9237; + public static final int NULL_9238 = 9238; + public static final int NULL_9239 = 9239; + public static final int NULL_9240 = 9240; + public static final int NULL_9241 = 9241; + public static final int NULL_9242 = 9242; + public static final int NULL_9243 = 9243; + public static final int NULL_9245 = 9245; + public static final int NULL_9256 = 9256; + public static final int NULL_9269 = 9269; + public static final int NULL_9384 = 9384; + public static final int NULL_9385 = 9385; + public static final int NULL_9386 = 9386; + public static final int NULL_9387 = 9387; + public static final int NULL_9388 = 9388; + public static final int NULL_9389 = 9389; + public static final int NULL_9390 = 9390; + public static final int NULL_9391 = 9391; + public static final int NULL_9392 = 9392; + public static final int NULL_9393 = 9393; + public static final int NULL_9394 = 9394; + public static final int NULL_9395 = 9395; + public static final int NULL_9396 = 9396; + public static final int NULL_9397 = 9397; + public static final int NULL_9411 = 9411; + public static final int NULL_9412 = 9412; + public static final int NULL_9456 = 9456; + public static final int NULL_9457 = 9457; + public static final int NULL_9458 = 9458; + public static final int NULL_9459 = 9459; + public static final int NULL_9473 = 9473; + public static final int NULL_9475 = 9475; + public static final int NULL_9507 = 9507; + public static final int NULL_9508 = 9508; + public static final int NULL_9509 = 9509; + public static final int NULL_9510 = 9510; + public static final int NULL_9515 = 9515; + public static final int NULL_9516 = 9516; + public static final int NULL_9517 = 9517; + public static final int NULL_9518 = 9518; + public static final int NULL_9519 = 9519; + public static final int NULL_9520 = 9520; + public static final int NULL_9618 = 9618; + public static final int NULL_9620 = 9620; + public static final int NULL_9626 = 9626; + public static final int NULL_9628 = 9628; + public static final int NULL_9630 = 9630; + public static final int NULL_9647 = 9647; + public static final int NULL_9649 = 9649; + public static final int NULL_9651 = 9651; + public static final int NULL_9653 = 9653; + public static final int NULL_9655 = 9655; + public static final int NULL_9669 = 9669; + public static final int NULL_9670 = 9670; + public static final int NULL_9671 = 9671; + public static final int NULL_9672 = 9672; + public static final int NULL_9673 = 9673; + public static final int NULL_9674 = 9674; + public static final int NULL_9747 = 9747; + public static final int NULL_9748 = 9748; + public static final int NULL_9803 = 9803; + public static final int NULL_9804 = 9804; + public static final int NULL_9805 = 9805; + public static final int NULL_9806 = 9806; + public static final int NULL_9807 = 9807; + public static final int NULL_9808 = 9808; + public static final int NULL_9809 = 9809; + public static final int NULL_9810 = 9810; + public static final int NULL_9811 = 9811; + public static final int NULL_9812 = 9812; + public static final int NULL_9813 = 9813; + public static final int NULL_9814 = 9814; + public static final int NULL_9815 = 9815; + public static final int NULL_9816 = 9816; + public static final int NULL_9817 = 9817; + public static final int NULL_9818 = 9818; + public static final int NULL_9819 = 9819; + public static final int NULL_9820 = 9820; + public static final int NULL_9821 = 9821; + public static final int NULL_9822 = 9822; + public static final int NULL_9823 = 9823; + public static final int NULL_9824 = 9824; + public static final int NULL_9825 = 9825; + public static final int NULL_9826 = 9826; + public static final int NULL_9827 = 9827; + public static final int NULL_9828 = 9828; + public static final int NULL_9829 = 9829; + public static final int NULL_9830 = 9830; + public static final int NULL_9831 = 9831; + public static final int NULL_9832 = 9832; + public static final int NULL_9833 = 9833; + public static final int NULL_9834 = 9834; + public static final int NULL_9835 = 9835; + public static final int NULL_9836 = 9836; + public static final int NULL_9837 = 9837; + public static final int NULL_9838 = 9838; + public static final int NULL_9839 = 9839; + public static final int NULL_9840 = 9840; + public static final int NULL_9841 = 9841; + public static final int NULL_9842 = 9842; + public static final int NULL_9843 = 9843; + public static final int NULL_9844 = 9844; + public static final int NULL_9845 = 9845; + public static final int NULL_9846 = 9846; + public static final int NULL_9847 = 9847; + public static final int NULL_9848 = 9848; + public static final int NULL_9849 = 9849; + /* This file is automatically generated. Do not edit. */ +} diff --git a/runelite-api/src/main/java/net/runelite/api/TileItem.java b/runelite-api/src/main/java/net/runelite/api/TileItem.java index 61180ad3d1..8184835f20 100644 --- a/runelite-api/src/main/java/net/runelite/api/TileItem.java +++ b/runelite-api/src/main/java/net/runelite/api/TileItem.java @@ -36,4 +36,10 @@ public interface TileItem extends Entity int getId(); int getQuantity(); + + /** + * Time in game ticks when the item spawned (relative to us) + * @return + */ + int getSpawnTime(); } diff --git a/runelite-api/src/main/java/net/runelite/api/util/Text.java b/runelite-api/src/main/java/net/runelite/api/util/Text.java index 955175f1a3..f837b4b918 100644 --- a/runelite-api/src/main/java/net/runelite/api/util/Text.java +++ b/runelite-api/src/main/java/net/runelite/api/util/Text.java @@ -31,6 +31,8 @@ import com.google.common.base.Joiner; import com.google.common.base.Splitter; import java.util.Collection; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.WordUtils; import org.apache.commons.text.similarity.JaroWinklerDistance; @@ -38,6 +40,7 @@ import org.apache.commons.text.similarity.JaroWinklerDistance; public class Text { private static final StringBuilder SB = new StringBuilder(64); + private static final Pattern TAG_REGEXP = Pattern.compile("<[^>]*>"); public static final JaroWinklerDistance DISTANCE = new JaroWinklerDistance(); public static final Splitter COMMA_SPLITTER = Splitter .on(",") @@ -150,6 +153,32 @@ public class Text return removeTags(str, false); } + /** + * Remove tags from the given string, except for <lt> and <gt> + * + * @param str The string to remove formatting tags from. + * @return The given string with all formatting tags removed from it. + */ + public static String removeFormattingTags(String str) + { + StringBuilder stringBuilder = new StringBuilder(); + Matcher matcher = TAG_REGEXP.matcher(str); + while (matcher.find()) + { + matcher.appendReplacement(stringBuilder, ""); + String match = matcher.group(0); + switch (match) + { + case "": + case "": + stringBuilder.append(match); + break; + } + } + matcher.appendTail(stringBuilder); + return stringBuilder.toString(); + } + /** * In addition to removing all tags, replaces nbsp with space, trims string and lowercases it diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java index bbc5cfcaec..caee96c3b0 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java @@ -250,6 +250,16 @@ public interface Widget */ int getSpriteId(); + /** + * Gets if sprites are repeated or stretched + */ + boolean getSpriteTiling(); + + /** + * Sets if sprites are repeated or stretched + */ + void setSpriteTiling(boolean tiling); + /** * Sets the sprite ID displayed in the widget. * @@ -288,18 +298,18 @@ public interface Widget int getIndex(); /** - * Gets the model ID displayed in the widget. + * Gets the Model/NPC/Item ID displayed in the widget. * - * @return the model ID + * @see WidgetModelType */ int getModelId(); /** - * Sets the model ID displayed in the widget + * Sets the Model/NPC/Item ID displayed in the widget. * - * @param modelId the new model ID + * @see WidgetModelType */ - void setModelId(int modelId); + void setModelId(int id); /** * Gets the model type of the widget. @@ -316,6 +326,20 @@ public interface Widget */ void setModelType(int type); + /** + * Gets the sequence ID used to animate the model in the widget + * + * @see net.runelite.api.AnimationID + */ + int getAnimationId(); + + /** + * Sets the sequence ID used to animate the model in the widget + * + * @see net.runelite.api.AnimationID + */ + void setAnimationId(int animationId); + /** * Gets the x rotation of the model displayed in the widget * diff --git a/runelite-api/src/test/java/net/runelite/api/util/TextTest.java b/runelite-api/src/test/java/net/runelite/api/util/TextTest.java index b6ab3bbc7f..f7f53f3e9f 100644 --- a/runelite-api/src/test/java/net/runelite/api/util/TextTest.java +++ b/runelite-api/src/test/java/net/runelite/api/util/TextTest.java @@ -49,4 +49,18 @@ public class TextTest { assertEquals("Whoever This Is Lmao", Text.toJagexName("-__- - \u00A0\u00A0 Whoever\uABCD\uABCD\u00A0T\uABBBhis Is-Lmao")); } + + @Test + public void removeFormattingTags() + { + assertEquals("Test", Text.removeFormattingTags("Test")); + assertEquals("Test", Text.removeFormattingTags("Test")); + assertEquals("Zezima (level-126)", Text.removeFormattingTags("Zezima (level-126)")); + assertEquals("", Text.removeFormattingTags("")); + assertEquals("Not so much.", Text.removeFormattingTags("Not so much.")); + assertEquals("Use Item -> Man", Text.removeFormattingTags("Use Item -> Man")); + assertEquals("a < b", Text.removeFormattingTags("a < b")); + assertEquals("a b", Text.removeFormattingTags("a b")); + assertEquals("Remove no tags", Text.removeFormattingTags("Remove no tags")); + } } diff --git a/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java b/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java index e57be2942b..b93695f5c3 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/ChatColorConfig.java @@ -30,19 +30,43 @@ import net.runelite.client.ui.JagexColors; @ConfigGroup("textrecolor") public interface ChatColorConfig extends Config { + @ConfigTitleSection( + keyName = "opaqueTitle", + name = "Opaque", + description = "", + position = 1 + ) + default Title opaqueTitle() + { + return new Title(); + } + + @ConfigTitleSection( + keyName = "transparentTitle", + name = "Transparent", + description = "", + position = 1 + ) + default Title transparentTitle() + { + return new Title(); + } + @ConfigItem( - position = 31, + position = 1, keyName = "opaquePublicChat", name = "Public chat", - description = "Color of Public chat" + description = "Color of Public chat", + titleSection = "opaqueTitle" ) Color opaquePublicChat(); @ConfigItem( - position = 32, + position = 2, keyName = "opaquePublicChatHighlight", name = "Public chat highlight", - description = "Color of highlights in Public chat" + description = "Color of highlights in Public chat", + titleSection = "opaqueTitle" ) default Color opaquePublicChatHighlight() { @@ -50,18 +74,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 33, + position = 3, keyName = "opaquePrivateMessageSent", name = "Sent private messages", - description = "Color of Private messages you've sent" + description = "Color of Private messages you've sent", + titleSection = "opaqueTitle" ) Color opaquePrivateMessageSent(); @ConfigItem( - position = 34, + position = 4, keyName = "opaquePrivateMessageSentHighlight", name = "Sent private messages highlight", - description = "Color of highlights in Private messages you've sent" + description = "Color of highlights in Private messages you've sent", + titleSection = "opaqueTitle" ) default Color opaquePrivateMessageSentHighlight() { @@ -69,18 +95,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 35, + position = 5, keyName = "opaquePrivateMessageReceived", name = "Received private messages", - description = "Color of Private messages you've received" + description = "Color of Private messages you've received", + titleSection = "opaqueTitle" ) Color opaquePrivateMessageReceived(); @ConfigItem( - position = 36, + position = 6, keyName = "opaquePrivateMessageReceivedHighlight", name = "Received private messages highlight", - description = "Color of highlights in Private messages you've received" + description = "Color of highlights in Private messages you've received", + titleSection = "opaqueTitle" ) default Color opaquePrivateMessageReceivedHighlight() { @@ -88,10 +116,11 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 37, + position = 7, keyName = "opaqueClanChatInfo", name = "Clan chat info", - description = "Clan Chat Information (eg. when joining a channel)" + description = "Clan Chat Information (eg. when joining a channel)", + titleSection = "opaqueTitle" ) default Color opaqueClanChatInfo() { @@ -99,10 +128,11 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 38, + position = 8, keyName = "opaqueClanChatInfoHighlight", name = "Clan chat info highlight", - description = "Clan Chat Information highlight (used for the Raids plugin)" + description = "Clan Chat Information highlight (used for the Raids plugin)", + titleSection = "opaqueTitle" ) default Color opaqueClanChatInfoHighlight() { @@ -110,18 +140,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 39, + position = 9, keyName = "opaqueClanChatMessage", name = "Clan chat message", - description = "Color of Clan Chat Messages" + description = "Color of Clan Chat Messages", + titleSection = "opaqueTitle" ) Color opaqueClanChatMessage(); @ConfigItem( - position = 40, + position = 10, keyName = "opaqueClanChatMessageHighlight", name = "Clan chat message highlight", - description = "Color of highlights in Clan Chat Messages" + description = "Color of highlights in Clan Chat Messages", + titleSection = "opaqueTitle" ) default Color opaqueClanChatMessageHighlight() { @@ -129,66 +161,74 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 41, + position = 11, keyName = "opaqueAutochatMessage", name = "Autochat", - description = "Color of Autochat messages" + description = "Color of Autochat messages", + titleSection = "opaqueTitle" ) Color opaqueAutochatMessage(); @ConfigItem( - position = 42, + position = 12, keyName = "opaqueAutochatMessageHighlight", name = "Autochat highlight", - description = "Color of highlights in Autochat messages" + description = "Color of highlights in Autochat messages", + titleSection = "opaqueTitle" ) Color opaqueAutochatMessageHighlight(); @ConfigItem( - position = 43, + position = 13, keyName = "opaqueTradeChatMessage", name = "Trade chat", - description = "Color of Trade Chat Messages" + description = "Color of Trade Chat Messages", + titleSection = "opaqueTitle" ) Color opaqueTradeChatMessage(); @ConfigItem( - position = 44, + position = 14, keyName = "opaqueTradeChatMessageHighlight", name = "Trade chat highlight", - description = "Color of highlights in Trade Chat Messages" + description = "Color of highlights in Trade Chat Messages", + titleSection = "opaqueTitle" ) Color opaqueTradeChatMessageHighlight(); @ConfigItem( - position = 45, + position = 15, keyName = "opaqueServerMessage", name = "Server message", - description = "Color of Server Messages (eg. 'Welcome to RuneScape')" + description = "Color of Server Messages (eg. 'Welcome to RuneScape')", + titleSection = "opaqueTitle" ) Color opaqueServerMessage(); @ConfigItem( - position = 46, + position = 16, keyName = "opaqueServerMessageHighlight", name = "Server message highlight", - description = "Color of highlights in Server Messages" + description = "Color of highlights in Server Messages", + titleSection = "opaqueTitle" ) Color opaqueServerMessageHighlight(); @ConfigItem( - position = 47, + position = 17, keyName = "opaqueGameMessage", name = "Game message", - description = "Color of Game Messages" + description = "Color of Game Messages", + titleSection = "opaqueTitle" ) Color opaqueGameMessage(); @ConfigItem( - position = 48, + position = 18, keyName = "opaqueGameMessageHighlight", name = "Game message highlight", - description = "Color of highlights in Game Messages" + description = "Color of highlights in Game Messages", + titleSection = "opaqueTitle" ) default Color opaqueGameMessageHighlight() { @@ -196,18 +236,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 49, + position = 19, keyName = "opaqueExamine", name = "Examine", - description = "Color of Examine Text" + description = "Color of Examine Text", + titleSection = "opaqueTitle" ) Color opaqueExamine(); @ConfigItem( - position = 50, + position = 20, keyName = "opaqueExamineHighlight", name = "Examine highlight", - description = "Color of highlights in Examine Text" + description = "Color of highlights in Examine Text", + titleSection = "opaqueTitle" ) default Color opaqueExamineHighlight() { @@ -215,74 +257,83 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 51, + position = 21, keyName = "opaqueFiltered", name = "Filtered", - description = "Color of Filtered Text (messages that aren't shown when Game messages are filtered)" + description = "Color of Filtered Text (messages that aren't shown when Game messages are filtered)", + titleSection = "opaqueTitle" ) Color opaqueFiltered(); @ConfigItem( - position = 52, + position = 22, keyName = "opaqueFilteredHighlight", name = "Filtered highlight", - description = "Color of highlights in Filtered Text" + description = "Color of highlights in Filtered Text", + titleSection = "opaqueTitle" ) Color opaqueFilteredHighlight(); @ConfigItem( - position = 53, + position = 23, keyName = "opaqueUsername", name = "Usernames", - description = "Color of Usernames" + description = "Color of Usernames", + titleSection = "opaqueTitle" ) Color opaqueUsername(); @ConfigItem( - position = 54, + position = 24, keyName = "opaquePrivateUsernames", name = "Private chat usernames", - description = "Color of Usernames in Private Chat" + description = "Color of Usernames in Private Chat", + titleSection = "opaqueTitle" ) Color opaquePrivateUsernames(); @ConfigItem( - position = 55, + position = 25, keyName = "opaqueClanChannelName", name = "Clan channel name", - description = "Color of Clan Channel Name" + description = "Color of Clan Channel Name", + titleSection = "opaqueTitle" ) Color opaqueClanChannelName(); @ConfigItem( - position = 56, + position = 26, keyName = "opaqueClanUsernames", name = "Clan usernames", - description = "Color of Usernames in Clan Chat" + description = "Color of Usernames in Clan Chat", + titleSection = "opaqueTitle" ) Color opaqueClanUsernames(); @ConfigItem( - position = 57, + position = 27, keyName = "opaquePublicFriendUsernames", name = "Public friend usernames", - description = "Color of Friend Usernames in Public Chat" + description = "Color of Friend Usernames in Public Chat", + titleSection = "opaqueTitle" ) Color opaquePublicFriendUsernames(); @ConfigItem( - position = 61, + position = 51, keyName = "transparentPublicChat", name = "Public chat (transparent)", - description = "Color of Public chat (transparent)" + description = "Color of Public chat (transparent)", + titleSection = "transparentTitle" ) Color transparentPublicChat(); @ConfigItem( - position = 62, + position = 52, keyName = "transparentPublicChatHighlight", name = "Public chat highlight (transparent)", - description = "Color of highlights in Public chat (transparent)" + description = "Color of highlights in Public chat (transparent)", + titleSection = "transparentTitle" ) default Color transparentPublicChatHighlight() { @@ -290,18 +341,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 63, + position = 53, keyName = "transparentPrivateMessageSent", name = "Sent private messages (transparent)", - description = "Color of Private messages you've sent (transparent)" + description = "Color of Private messages you've sent (transparent)", + titleSection = "transparentTitle" ) Color transparentPrivateMessageSent(); @ConfigItem( - position = 64, + position = 54, keyName = "transparentPrivateMessageSentHighlight", name = "Sent private messages highlight (transparent)", - description = "Color of highlights in Private messages you've sent (transparent)" + description = "Color of highlights in Private messages you've sent (transparent)", + titleSection = "transparentTitle" ) default Color transparentPrivateMessageSentHighlight() { @@ -309,18 +362,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 65, + position = 55, keyName = "transparentPrivateMessageReceived", name = "Received private messages (transparent)", - description = "Color of Private messages you've received (transparent)" + description = "Color of Private messages you've received (transparent)", + titleSection = "transparentTitle" ) Color transparentPrivateMessageReceived(); @ConfigItem( - position = 66, + position = 56, keyName = "transparentPrivateMessageReceivedHighlight", name = "Received private messages highlight (transparent)", - description = "Color of highlights in Private messages you've received (transparent)" + description = "Color of highlights in Private messages you've received (transparent)", + titleSection = "transparentTitle" ) default Color transparentPrivateMessageReceivedHighlight() { @@ -328,10 +383,11 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 67, + position = 57, keyName = "transparentClanChatInfo", name = "Clan chat info (transparent)", - description = "Clan Chat Information (eg. when joining a channel) (transparent)" + description = "Clan Chat Information (eg. when joining a channel) (transparent)", + titleSection = "transparentTitle" ) default Color transparentClanChatInfo() { @@ -339,10 +395,11 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 68, + position = 58, keyName = "transparentClanChatInfoHighlight", name = "Clan chat info highlight (transparent)", - description = "Clan Chat Information highlight (used for the Raids plugin) (transparent)" + description = "Clan Chat Information highlight (used for the Raids plugin) (transparent)", + titleSection = "transparentTitle" ) default Color transparentClanChatInfoHighlight() { @@ -350,18 +407,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 69, + position = 59, keyName = "transparentClanChatMessage", name = "Clan chat message (transparent)", - description = "Color of Clan Chat Messages (transparent)" + description = "Color of Clan Chat Messages (transparent)", + titleSection = "transparentTitle" ) Color transparentClanChatMessage(); @ConfigItem( - position = 70, + position = 60, keyName = "transparentClanChatMessageHighlight", name = "Clan chat message highlight (transparent)", - description = "Color of highlights in Clan Chat Messages (transparent)" + description = "Color of highlights in Clan Chat Messages (transparent)", + titleSection = "transparentTitle" ) default Color transparentClanChatMessageHighlight() { @@ -369,66 +428,74 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 71, + position = 61, keyName = "transparentAutochatMessage", name = "Autochat (transparent)", - description = "Color of Autochat messages (transparent)" + description = "Color of Autochat messages (transparent)", + titleSection = "transparentTitle" ) Color transparentAutochatMessage(); @ConfigItem( - position = 72, + position = 62, keyName = "transparentAutochatMessageHighlight", name = "Autochat highlight (transparent)", - description = "Color of highlights in Autochat messages (transparent)" + description = "Color of highlights in Autochat messages (transparent)", + titleSection = "transparentTitle" ) Color transparentAutochatMessageHighlight(); @ConfigItem( - position = 73, + position = 63, keyName = "transparentTradeChatMessage", name = "Trade chat (transparent)", - description = "Color of Trade Chat Messages (transparent)" + description = "Color of Trade Chat Messages (transparent)", + titleSection = "transparentTitle" ) Color transparentTradeChatMessage(); @ConfigItem( - position = 74, + position = 64, keyName = "transparentTradeChatMessageHighlight", name = "Trade chat highlight (transparent)", - description = "Color of highlights in Trade Chat Messages (transparent)" + description = "Color of highlights in Trade Chat Messages (transparent)", + titleSection = "transparentTitle" ) Color transparentTradeChatMessageHighlight(); @ConfigItem( - position = 75, + position = 65, keyName = "transparentServerMessage", name = "Server message (transparent)", - description = "Color of Server Messages (eg. 'Welcome to RuneScape') (transparent)" + description = "Color of Server Messages (eg. 'Welcome to RuneScape') (transparent)", + titleSection = "transparentTitle" ) Color transparentServerMessage(); @ConfigItem( - position = 76, + position = 66, keyName = "transparentServerMessageHighlight", name = "Server message highlight (transparent)", - description = "Color of highlights in Server Messages (transparent)" + description = "Color of highlights in Server Messages (transparent)", + titleSection = "transparentTitle" ) Color transparentServerMessageHighlight(); @ConfigItem( - position = 77, + position = 67, keyName = "transparentGameMessage", name = "Game message (transparent)", - description = "Color of Game Messages (transparent)" + description = "Color of Game Messages (transparent)", + titleSection = "transparentTitle" ) Color transparentGameMessage(); @ConfigItem( - position = 78, + position = 68, keyName = "transparentGameMessageHighlight", name = "Game message highlight (transparent)", - description = "Color of highlights in Game Messages (transparent)" + description = "Color of highlights in Game Messages (transparent)", + titleSection = "transparentTitle" ) default Color transparentGameMessageHighlight() { @@ -436,18 +503,20 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 79, + position = 69, keyName = "transparentExamine", name = "Examine (transparent)", - description = "Color of Examine Text (transparent)" + description = "Color of Examine Text (transparent)", + titleSection = "transparentTitle" ) Color transparentExamine(); @ConfigItem( - position = 80, + position = 70, keyName = "transparentExamineHighlight", name = "Examine highlight (transparent)", - description = "Color of highlights in Examine Text (transparent)" + description = "Color of highlights in Examine Text (transparent)", + titleSection = "transparentTitle" ) default Color transparentExamineHighlight() { @@ -455,58 +524,65 @@ public interface ChatColorConfig extends Config } @ConfigItem( - position = 81, + position = 71, keyName = "transparentFiltered", name = "Filtered (transparent)", - description = "Color of Filtered Text (messages that aren't shown when Game messages are filtered) (transparent)" + description = "Color of Filtered Text (messages that aren't shown when Game messages are filtered) (transparent)", + titleSection = "transparentTitle" ) Color transparentFiltered(); @ConfigItem( - position = 82, + position = 72, keyName = "transparentFilteredHighlight", name = "Filtered highlight (transparent)", - description = "Color of highlights in Filtered Text (transparent)" + description = "Color of highlights in Filtered Text (transparent)", + titleSection = "transparentTitle" ) Color transparentFilteredHighlight(); @ConfigItem( - position = 83, + position = 73, keyName = "transparentUsername", name = "Usernames (transparent)", - description = "Color of Usernames (transparent)" + description = "Color of Usernames (transparent)", + titleSection = "transparentTitle" ) Color transparentUsername(); @ConfigItem( - position = 84, + position = 74, keyName = "transparentPrivateUsernames", name = "Private chat usernames (transparent)", - description = "Color of Usernames in Private Chat (transparent)" + description = "Color of Usernames in Private Chat (transparent)", + titleSection = "transparentTitle" ) Color transparentPrivateUsernames(); @ConfigItem( - position = 85, + position = 75, keyName = "transparentClanChannelName", name = "Clan channel name (transparent)", - description = "Color of Clan Channel Name (transparent)" + description = "Color of Clan Channel Name (transparent)", + titleSection = "transparentTitle" ) Color transparentClanChannelName(); @ConfigItem( - position = 86, + position = 76, keyName = "transparentClanUsernames", name = "Clan usernames (transparent)", - description = "Color of Usernames in Clan Chat (transparent)" + description = "Color of Usernames in Clan Chat (transparent)", + titleSection = "transparentTitle" ) Color transparentClanUsernames(); @ConfigItem( - position = 87, + position = 77, keyName = "transparentPublicFriendUsernames", name = "Public friend usernames (transparent)", - description = "Color of Friend Usernames in Public Chat (transparent)" + description = "Color of Friend Usernames in Public Chat (transparent)", + titleSection = "transparentTitle" ) Color transparentPublicFriendUsernames(); } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/DragAndDropReorderPane.java b/runelite-client/src/main/java/net/runelite/client/ui/components/DragAndDropReorderPane.java index 13cdf27fe8..b4c0803a33 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/DragAndDropReorderPane.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/DragAndDropReorderPane.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Shingyx + * Copyright (c) 2020, Shingyx * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,24 +31,20 @@ import java.awt.Point; import java.awt.dnd.DragSource; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.HashMap; -import java.util.Map; import javax.swing.BoxLayout; import javax.swing.JLayeredPane; +import javax.swing.SwingUtilities; /** * Pane which allows reordering its components via drag and drop. - *

- * For child components' popup menus, implement the PopupMenuOwner interface in the child components. */ public class DragAndDropReorderPane extends JLayeredPane { private Point dragStartPoint; private Component draggingComponent; + private int dragYOffset = 0; private int dragIndex = -1; - private final Map popupMenuCandidates = new HashMap<>(); // keyed by mouse button - public DragAndDropReorderPane() { super(); @@ -76,6 +72,7 @@ public class DragAndDropReorderPane extends JLayeredPane dragStartPoint = null; return; } + dragYOffset = SwingUtilities.convertPoint(this, dragStartPoint, draggingComponent).y; dragIndex = getPosition(draggingComponent); setLayer(draggingComponent, DRAG_LAYER); moveDraggingComponent(point); @@ -85,7 +82,13 @@ public class DragAndDropReorderPane extends JLayeredPane { moveDraggingComponent(point); - Component component = getDefaultLayerComponentAt(point); + // reorder components overlapping with the dragging components mid-point + Point draggingComponentMidPoint = SwingUtilities.convertPoint( + draggingComponent, + new Point(draggingComponent.getWidth() / 2, draggingComponent.getHeight() / 2), + this + ); + Component component = getDefaultLayerComponentAt(draggingComponentMidPoint); if (component != null) { int index = getPosition(component); @@ -99,17 +102,18 @@ public class DragAndDropReorderPane extends JLayeredPane if (draggingComponent != null) { setLayer(draggingComponent, DEFAULT_LAYER, dragIndex); + draggingComponent = null; + dragYOffset = 0; + dragIndex = -1; revalidate(); } dragStartPoint = null; - draggingComponent = null; - dragIndex = -1; } private void moveDraggingComponent(Point point) { - // place the center of the dragging component onto the mouse cursor - int y = point.y - draggingComponent.getHeight() / 2; + // shift the dragging component to match it's earlier y offset with the mouse + int y = point.y - dragYOffset; // clamp the height to stay within the pane y = Math.max(y, 0); y = Math.min(y, getHeight() - draggingComponent.getHeight()); @@ -160,88 +164,36 @@ public class DragAndDropReorderPane extends JLayeredPane @Override public void mousePressed(MouseEvent e) { - Point point = e.getPoint(); - int mouseButton = e.getButton(); - - if (mouseButton == MouseEvent.BUTTON1) + if (SwingUtilities.isLeftMouseButton(e) && getComponentCount() > 1) { - // candidate for dragging - if (popupMenuCandidates.isEmpty() && getComponentCount() > 1) - { - dragStartPoint = point; - } - } - else - { - if (dragStartPoint != null) - { - finishDragging(); - } - else - { - // candidate for child popup menu - Component component = getDefaultLayerComponentAt(point); - if (component instanceof PopupMenuOwner) - { - PopupMenuOwner popupMenuCandidate = (PopupMenuOwner) component; - if (e.isPopupTrigger()) - { - popupMenuCandidate.getPopupMenu().show(DragAndDropReorderPane.this, point.x, point.y); - } - else - { - popupMenuCandidates.put(mouseButton, popupMenuCandidate); - } - } - } + dragStartPoint = e.getPoint(); } } @Override public void mouseDragged(MouseEvent e) { - if (dragStartPoint == null) + if (SwingUtilities.isLeftMouseButton(e) && dragStartPoint != null) { - return; - } - Point point = e.getPoint(); - if (contains(point)) - { - if (draggingComponent == null) - { - if (point.distance(dragStartPoint) > DragSource.getDragThreshold()) - { - startDragging(point); - } - } - else + Point point = e.getPoint(); + if (draggingComponent != null) { drag(point); } - } - else - { - finishDragging(); + else if (point.distance(dragStartPoint) > DragSource.getDragThreshold()) + { + startDragging(point); + } } } @Override public void mouseReleased(MouseEvent e) { - Point point = e.getPoint(); - int mouseButton = e.getButton(); - if (mouseButton == MouseEvent.BUTTON1) + if (SwingUtilities.isLeftMouseButton(e)) { finishDragging(); } - else - { - PopupMenuOwner popupMenuCandidate = popupMenuCandidates.remove(mouseButton); - if (popupMenuCandidate != null && e.isPopupTrigger()) - { - popupMenuCandidate.getPopupMenu().show(DragAndDropReorderPane.this, point.x, point.y); - } - } } } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java index 0266caa450..cb317b8afd 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java @@ -29,7 +29,6 @@ package net.runelite.client.ui.components; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; @@ -38,6 +37,8 @@ import java.awt.event.KeyListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.List; import java.util.function.Consumer; import javax.swing.DefaultListModel; import javax.swing.ImageIcon; @@ -77,6 +78,8 @@ public class IconTextField extends JPanel @Getter private final DefaultListModel suggestionListModel; + private final List clearListeners = new ArrayList<>(); + public IconTextField() { setLayout(new BorderLayout()); @@ -124,7 +127,15 @@ public class IconTextField extends JPanel clearButton = createRHSButton(ColorScheme.PROGRESS_ERROR_COLOR, Color.PINK); clearButton.setText("×"); - clearButton.addActionListener(evt -> setText(null)); + clearButton.addActionListener(evt -> + { + setText(null); + + for (Runnable l : clearListeners) + { + l.run(); + } + }); suggestionListModel = new DefaultListModel<>(); suggestionListModel.addListDataListener(new ListDataListener() @@ -318,9 +329,9 @@ public class IconTextField extends JPanel textField.addKeyListener(keyListener); } - public void addClearListener(Consumer actionEventConsumer) + public void addClearListener(Runnable clearListener) { - clearButton.addActionListener(actionEventConsumer::accept); + clearListeners.add(clearListener); } public void addKeyListener(Consumer keyEventConsumer) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/MouseDragEventForwarder.java b/runelite-client/src/main/java/net/runelite/client/ui/components/MouseDragEventForwarder.java new file mode 100644 index 0000000000..2e97f66d01 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/MouseDragEventForwarder.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020, Shingyx + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.ui.components; + +import java.awt.Component; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.SwingUtilities; + +/** + * Forwards left mouse button drag events to the target Component. + */ +public class MouseDragEventForwarder extends MouseAdapter +{ + private final Component target; + + public MouseDragEventForwarder(Component target) + { + this.target = target; + } + + @Override + public void mousePressed(MouseEvent e) + { + processEvent(e); + } + + @Override + public void mouseDragged(MouseEvent e) + { + processEvent(e); + } + + @Override + public void mouseReleased(MouseEvent e) + { + processEvent(e); + } + + private void processEvent(MouseEvent e) + { + if (SwingUtilities.isLeftMouseButton(e)) + { + MouseEvent eventForTarget = SwingUtilities.convertMouseEvent((Component) e.getSource(), e, target); + target.dispatchEvent(eventForTarget); + } + } +} diff --git a/runelite-client/src/main/scripts/ClanSendKick.rs2asm b/runelite-client/src/main/scripts/ClanSendKick.rs2asm index f26f49c73a..1da495029f 100644 --- a/runelite-client/src/main/scripts/ClanSendKick.rs2asm +++ b/runelite-client/src/main/scripts/ClanSendKick.rs2asm @@ -6,9 +6,6 @@ ; callback "confirmClanKick" ; Used by the ClanChat plugin to show a chatbox panel confirming the requested kick ; Also requires the "confirmKicks" option of ClanChatConfig to be enabled -; callback "sendKickName" -; Used by the ClanChat plugin to modify the kick message to include player name -; Also requires the "kickWithName" option of ClanChatConfig to be enabled invoke 1942 iconst 1 if_icmpeq LABEL4 @@ -19,10 +16,6 @@ LABEL4: return LABEL7: sconst "-Attempting to kick player from friends chat..." - sload 0 ; Username we are kicking - sconst "sendKickName" - runelite_callback - pop_string ; Username we are kicking iconst 2 invoke 96 sload 0