Jump to content

Search the Community

Showing results for tags 'Button'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hot Lava
    • [Hot Lava] - General Discussion
    • [Hot Lava] - Suggestions and Feedback
    • [Hot Lava] - Bug Tracker
    • [Hot Lava] - Strats and Records
    • [Hot Lava] - Developer Log
    • Hot Lava Latest Update
  • Griftlands
    • [Griftlands] - General Discussion
    • [Griftlands] - Suggestions and Feedback
    • [Griftlands] - Mods and Tools
    • [Griftlands] - Localization
    • [Griftlands] - Bug Tracker
    • [Griftlands] - Developer log
  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included: Spaced Out!] - Bug Tracker
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
    • Oxygen Not Included DLC Alpha
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] Beta Branch
    • [Don't Starve Together] PlayStation
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Nintendo Switch
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [DS + DST] Art, Music and Lore
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Don't Starve
    • Don't Starve FAQ
    • [Don't Starve: Pocket Edition] iOS / Android
    • [Don't Starve] General Discussion
    • [Don't Starve] Mods and tools
    • [Don't Starve] Art, Music & Lore
    • [Don't Starve] Suggestions and Feedback
    • [Don't Starve] Videos
    • [Don't Starve] Bug Tracker
    • [Don't Starve] Trading
    • [Don't Starve] Testing Discussion (archive)
  • Klei Entertainment Games
    • Eets Munchies
    • [Invisible, Inc.] General Discussion and Strategies
    • Mark of the Ninja
    • Shank
  • Other Stuff
    • Other Klei Services

Categories

  • Don't Starve
    • Custom Characters
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out!
  • Griftlands
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: Beta Branch
  • [Don't Starve Together] Nintendo Switch
  • [Don't Starve Together] PlayStation
  • Don't Starve Together: Return of Them
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out!
  • Griftlands
  • Hot Lava
  • Don't Starve Together
  • [Nintendo Switch] Don't Starve Together
  • [PlayStation] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Hamlet
  • Don't Starve: Shipwrecked

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Biography


Location


Interests


Occupation


Favorite Game


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together


Oxygen Not Included

Found 4 results

  1. I tried with Image button, and It seemed to be only working with default imagebutton (no parameter).
  2. EDIT: I have solved my problem by using code of the following mod: Pickle It Hello guys, I just started modding and to train up and get to know the environment my first goal was to mod a chest that is self sorting. I am an experienced programmer (even though i only worked with C#/Java/PL-SQL before), but I cant really get the hang of LUA and how the different files work together. So far I have read the pinned guides, but they couldnt help me. Enough chitchat here is my Problem: I have a prefab which is called "sorter". Its basically the same code as in a treasurechest. Now I want to add an button to the chests widget. The button should be called "sort" and call an action that is defined in the modmain.lua. So far so good. I followed this Thread to add an button to my prefab. But i cant get it to work. The mod itself works, the game doesnt crash, but there is no button. no matter what. I've been trying for the last few hours to produce the button, but no matter what i googled and searched in this Forum i wasnt able to find a solution. You can find my source_code in the attached ZIP. For those who are too lazy to download the zip ill add the code as quote below this post. I hope you can help me and that the description of my problem was sufficient. Thank you, Narmor sorter.lua: require "prefabutil" local assets= { Asset("ANIM", "anim/sorter.zip"), } local function onopen(inst) inst.SoundEmitter:PlaySound("dontstarve/wilson/chest_open") inst.AnimState:PlayAnimation("open") end local function onclose(inst) inst.AnimState:PlayAnimation("closed") inst.SoundEmitter:PlaySound("dontstarve/wilson/chest_close") end local function onhammered(inst, worker) inst.components.lootdropper:DropLoot() inst.components.container:DropEverything() inst.SoundEmitter:PlaySound("dontstarve/common/destroy_metal") inst:Remove() end local function onhit(inst, worker) inst.AnimState:PlayAnimation("closed") inst.components.container:DropEverything() inst.components.container:Close() end local function onbuilt(inst) inst.AnimState:PlayAnimation("place") inst.AnimState:PushAnimation("closed") end local function itemtest(inst, item, slot) return true end local function EditContainer(inst) local self if TheWorld.ismastersim then self = inst.components.container else self = inst.replica.container end self:WidgetSetup("sorter") local function sortfn(inst) if TheWorld.ismastersim then BufferedAction(inst.components.container.opener, inst, ACTIONS.SORT):Do() else SendRPCToServer(RPC.DoWidgetButtonAction, ACTIONS.SORT.code, inst, ACTIONS.SORT.mod_name) end end local sort_buttoninfo = { text = "Sort", position = Vector3(0, -195, 0), fn = sortfn, } -- One buttoninfo per button self.widget.sorter_buttons = { sort_buttoninfo, } end local function fn(Sim) local inst = CreateEntity() inst:AddTag("structure") inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() local minimap = inst.entity:AddMiniMapEntity() minimap:SetIcon( "sorter.tex" ) inst.AnimState:SetBank("sorter") inst.AnimState:SetBuild("sorter") inst.AnimState:PlayAnimation("closed", true) inst.entity:SetPristine() if not TheWorld.ismastersim then local _OnEntityReplicated = inst.OnEntityReplicated inst.OnEntityReplicated = function(inst) if _OnEntityReplicated then _OnEntityReplicated(inst) end EditContainer(inst) end return inst end inst:AddComponent("inspectable") inst:AddComponent("container") inst.components.container.itemtestfn = itemtest inst.components.container.onopenfn = onopen inst.components.container.onclosefn = onclose EditContainer(inst) inst:AddComponent("lootdropper") inst:AddComponent("workable") inst.components.workable:SetWorkAction(ACTIONS.HAMMER) inst.components.workable:SetWorkLeft(5) inst.components.workable:SetOnFinishCallback(onhammered) inst.components.workable:SetOnWorkCallback(onhit) return inst end return Prefab( "common/sorter", fn, assets), MakePlacer("common/sorter_placer", "sorter", "sorter", "closed") modmain.lua: local Spot = GetModConfigData("Spot") PrefabFiles = { "sorter", } Assets = { Asset( "IMAGE", "minimap/sorter.tex" ), Asset( "ATLAS", "minimap/sorter.xml" ), Asset("ATLAS", "images/inventoryimages/ui_chest_3x4.xml"), Asset("ATLAS", "images/inventoryimages/sorter.xml"), } AddMinimapAtlas("minimap/sorter.xml") STRINGS = GLOBAL.STRINGS RECIPETABS = GLOBAL.RECIPETABS Recipe = GLOBAL.Recipe Ingredient = GLOBAL.Ingredient TECH = GLOBAL.TECH GLOBAL.STRINGS.NAMES.SORTER = "Chest sorter" STRINGS.RECIPE_DESC.SORTER = "Put in your problems and they will be sorted out" GLOBAL.STRINGS.CHARACTERS.GENERIC.DESCRIBE.SORTER = "I like it" local sorter = GLOBAL.Recipe("sorter",{ Ingredient("cutstone", 1)}, RECIPETABS.TOWN, TECH.NONE, "sorter_placer" ) sorter.atlas = "images/inventoryimages/sorter.xml" ----------------------------------------------------------------------------------------------------------------------------------- -- widgetsetup for my prefab -- Not too shure what it does exactly, found it in another mod and it seems to work fine. local sorter = { widget = { slotpos = {}, animbank = "ui_chest_3x3", animbuild = "ui_chest_3x3", pos = GLOBAL.Vector3(0, 200, 0), side_align_tip = 160, }, type = "chest", } for y = 2, 0, -1 do for x = 0, 2 do table.insert(sorter.widget.slotpos, GLOBAL.Vector3(80 * x - 80 * 2 + 80, 80 * y - 80 * 2 + 80, 0)) end end local containers = GLOBAL.require("containers") containers.MAXITEMSLOTS = math.max(containers.MAXITEMSLOTS, sorter.widget.slotpos ~= nil and #sorter.widget.slotpos or 0) local _widgetsetup = containers.widgetsetup function containers.widgetsetup(container, prefab, data) local pref = prefab or container.inst.prefab if pref == "sorter" then for k, v in pairs(sorter) do container[k] = v end container:SetNumSlots(container.widget.slotpos ~= nil and #container.widget.slotpos or 0) else return _widgetsetup(container, prefab, data) end end ----------------------------------------------------------------------------------------------------------------------------------- -- Method for sorting the Stuff in the Sorter local function SortFn(act) --Methods Stub to be implemented later end AddAction("SORT", "Sort", SortFn) Sorter-Chest.rar
  3. I'm trying to make a button that when pressed allows me to run a function/push an event for my character. I have created and placed the button and It is working up to the point where I can run functions that affect the character. Here is the code I have. function DragonClawPostConstruct(self) local offset = 0 local width = 1 local value = 75 self.DragonClaw = self:AddChild(ImageButton("images/hud/DragonClaw.xml", "DragonClaw.tex"), self.owner) self.DragonClaw:SetScale(1,1,1) self.DragonClaw:SetPosition(-296,190,0) self.DragonClaw:Show() self.DragonClaw:SetClickable(true) width = value/100 offset = 29 - width * 29 self.DragonClaw.DragonClaw_cd = self.DragonClaw:AddChild(Image("images/hud/DragonClaw_cd.xml", "DragonClaw_cd.tex"), self.owner) self.DragonClaw.DragonClaw_cd:SetScale(width,1,1) self.DragonClaw.DragonClaw_cd:SetPosition(offset, 0, 0) self.DragonClaw.DragonClaw_cd:Show() function self.DragonClaw.DragonClaw_cd:SetValue(value) --out of 100 width = value/100 offset = 29 - width * 29 self:SetScale(width,1,1) self:SetPosition(offset, 0, 0) end self.DragonClaw:SetOnClick(function() self.DragonClaw.DragonClaw_cd:SetValue(math.random(100)) self.inst:PushEvent("DragonClawClick") end) endand in my character config I added a listener under the master_postinit inst:ListenForEvent("DragonClawClick", DragonClawClick)and then a simple function local function DragonClawClick(inst) inst.components.talker:Say("You Clicked Me!")endThe "DragonClawClick" event doesn't get recognized by my character though. I can see the value change when I click it but not the message. I eventually want to make this server friendly but first I just want to figure out how to make it work. Any help would be appreciated.
  4. The voodoo decided to create an art thread. Yay. Keep in mind, I am merely limited to pencil and paper, and thus cannot add color, contrast, small details, and other tidbits in art. I also accept requests if one wishes for me to draw a certain picture. Please excuse me for the lack of art on the first page, but I have appeared to misplace my sketchbook, and it is late on my end. Please leave a request after the beep.
×
×
  • Create New...