Project Zomboid

Project Zomboid

Extra Map Symbols
Compatibility with Share Your Map Symbols
ISWorldMapSymbols:extraUI_Refresh()
self.symsCopyBtn:setX(x) self.symsCopyBtn:setY(y) self.symsCopyBtn:setWidth(self:getWidth() - const.ToolX * 2) y = self.symsCopyBtn:getBottom() + const.Pad self.symsPasteBtn:setX(x) self.symsPasteBtn:setY(y) self.symsPasteBtn:setWidth(self:getWidth() - const.ToolX * 2) y = self.symsPasteBtn:getBottom() + const.Pad

The result: https://i.imgur.com/cIHflOh.png

https://steamproxy.com/sharedfiles/filedetails/?id=2744101803
Last edited by NoctisFalco; 6 Feb, 2022 @ 4:35am
< >
Showing 1-3 of 3 comments
Wipe  [developer] 6 Feb, 2022 @ 6:42am 
I think it would be better for both of us to keep that inside your mod, in case you'd want new buttons in future, move them somewhere else, etc.

Tweaking your prerender hook a little will make it work just fine with current and next versions:

local originalPrerender = ISWorldMapSymbols.prerender function ISWorldMapSymbols:prerender() originalPrerender(self) if ExtraMapSymbolsUI and ExtraMapSymbolsUI.CONST then local const = ExtraMapSymbolsUI.CONST local x = self.removeBtn:getX() local y = self.removeBtn:getBottom() + const.Pad self.symsCopyBtn:setX(x) self.symsCopyBtn:setY(y) self.symsCopyBtn:setWidth(self:getWidth() - const.ToolX * 2) y = self.symsCopyBtn:getBottom() + const.Pad self.symsPasteBtn:setX(x) self.symsPasteBtn:setY(y) self.symsPasteBtn:setWidth(self:getWidth() - const.ToolX * 2) y = self.symsPasteBtn:getBottom() + const.Pad * 3 self:setHeight(y) end
Wipe  [developer] 27 Feb, 2022 @ 8:45am 
I changed some things since last post, and so changed compatibility code. As refreshing UI happens very rarely now (mostly on user input), there's no reason to keep updating your elements position all the time.

Working example:

if ActiveMods.getById("currentGame"):isModActive("ExtraMapSymbolsUI") then require "ExtraMapSymbolsUI" function ISWorldMapSymbols:SYMS_ExtraMapSymbolsUI_Refresh(reason) if reason ~= "Init" and reason ~= "Columns" then return end local const = ExtraMapSymbolsUI.CONST local x = self.removeBtn:getX() local y = self.removeBtn:getBottom() + const.Pad self.symsCopyBtn:setX(x) self.symsCopyBtn:setY(y) self.symsCopyBtn:setWidth(self:getWidth() - const.ToolX * 2) y = self.symsCopyBtn:getBottom() + const.Pad self.symsPasteBtn:setX(x) self.symsPasteBtn:setY(y) self.symsPasteBtn:setWidth(self:getWidth() - const.ToolX * 2) y = self.symsPasteBtn:getBottom() + const.Pad * 3 self:setHeight(y) end Events["ExtraMapSymbolsUI.Refresh"].Add(ISWorldMapSymbols.SYMS_ExtraMapSymbolsUI_Refresh) end

Note: i cut slider position tweaking as it comes from yet another mod, which needs update anyway.
Last edited by Wipe; 27 Feb, 2022 @ 9:07am
Princess abby 10 Mar, 2023 @ 9:08pm 
This might be a silly question but would i need to modfie any code to make this work with share maps or is it done for me and i just download and add to it?

I'm not a moder so this is out of my skill range and i would like to try and have this with share maps mod with me and my friend on my local hosted MP server i host :)
< >
Showing 1-3 of 3 comments
Per page: 1530 50