Jump to content

Deceptive Pastry

Member
  • Posts

    6
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Deceptive Pastry's Achievements

  1. I did a lot of file searching. Turns out this function: function ISEmoteRadialMenu:new(character) local o = ISBaseObject.new(self) o.character = character o.playerNum = character:getPlayerNum() ISUIEmoteConfig:readFile(); return o end Links to another file, ISUIEmoteConfig, which contains the ISEmoteRadialMenu:init();.
  2. I've found that if I add self.init() to the beginning of ISFirearmRadialMenu:fillMenu and run pairs, it fills out the table and everything works properly. So now I'm even more confused, how is ISEmoteRadialMenu:fillmenu accessing the tables within :init without accessing :init?
  3. I'm trying to set up some extra FirearmRadialMenu functions just like the emote menu does. ISEmoteRadialMenu sets up its menu as shown below. If I set it up exactly like this for the firearm radial .lua but replace everything with ISFirearmRadialMenu, it doesn't work. It DOES work (In that it fills out the menu and the buttons work properly) if I put all the ISFirearmRadialMenu.x lines inside ISFirearmRadialMenu:fillmenu, but that also executes some commands stored in the variables upon opening the menu which I don't want. But if I put ISFirearmRadialMenu.x inside a separate function as in the emote code, :init, then :fillmenu pairs can't find the tables. I thought not using "local x" would make it accessible to the whole file (or just make them global) rather than just the function, but seemingly not, or is there something else I'm missing? I don't see anything else in the ISEmoteRadialMenu code indicating a reason why it should be working differently. I don't understand how ISEmoteRadialMenu:fillmenu is accessing the table set up in :init. function ISEmoteRadialMenu:init() ISEmoteRadialMenu.defaultMenu = {}; ISEmoteRadialMenu.defaultMenu["friendly"] = {}; ISEmoteRadialMenu.defaultMenu["friendly"].name = getText("IGUI_Emote_Friendly"); ISEmoteRadialMenu.defaultMenu["friendly"].subMenu = {}; ISEmoteRadialMenu.variants = {}; ISEmoteRadialMenu.variants["wavehi"] = {"wavehi", "wavehi02", "wavebye"}; ISEmoteRadialMenu.icons = {}; ISEmoteRadialMenu.icons["friendly"] = getTexture("media/ui/emotes/thumbsup.png"); ISEmoteRadialMenu.menu = ISEmoteRadialMenu.defaultMenu; end function ISEmoteRadialMenu:fillMenu(submenu) local menu = getPlayerRadialMenu(self.playerNum) menu:clear() local icon = nil; if not submenu then -- base menu with all categories for i,v in pairs(ISEmoteRadialMenu.menu) do icon = nil; if ISEmoteRadialMenu.icons[i] then icon = ISEmoteRadialMenu.icons[i]; end if v.subMenu then -- stuff with submenu menu:addSlice(v.name, icon, self.fillMenu, self, i) else -- stuff for rapid access menu:addSlice(v.name, icon, self.emote, self, i) end end else for i,v in pairs(ISEmoteRadialMenu.menu[submenu].subMenu) do icon = nil; if ISEmoteRadialMenu.icons[i] then icon = ISEmoteRadialMenu.icons[i]; end menu:addSlice(v, icon, self.emote, self, i) end menu:addSlice(getText("IGUI_Emote_Back"), ISEmoteRadialMenu.icons["back"], self.fillMenu, self) end self:display() end
  4. Just a little QoL option, I'd like to be able to set in the options how long you have to hold a button to show radial menu. Default for the firearms radial is 500ms, emote radial is 450ms. Maybe have a minimum like 50-100ms, but I would love to be able to halve the amount of time it takes for the radial to show up.
  5. The table has a character field, the vanilla firearms radial uses it in various functions, but then at the end dealing with key presses it uses getSpecificPlayer(0). It seems like it's fine to continue doing it the way they originally did with self.character, I just wonder what the purpose is of defining and using self.character if getSpecificPlayer(0) can also be used and is used in the same table to do getPrimaryHandItem on the player. It looks like when they define character they just use getPlayerNum(). Maybe it has to do with split-screen and having a second local player.
  6. I'm working on adding on to the Firearm Radial Menu. For the purpose of getPrimaryHandItem() for getting currently held weapon info, what is the functional difference between self.character vs getSpecificPlayer(0) and which should I be using if I'm, say, checking if the currently held gun has access to alternate magazine types from a mod and only displaying the options to switch to them on the radial if the gun can use them. In some places such as checking for magazines, timed actions, and fillMenu, FirearmRadialMenu.lua uses self.character:getPrimaryHandItem(), yet later for key presses and such it uses getSpecificPlayer(0):getPrimaryHandItem(). Looking at other mods, Gunfighter uses getSpecificPlayer(0) to check primary hand item for its functions.
×
×
  • Create New...