[Mod] Vote Block [vote]

Post Reply
JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

[Mod] Vote Block [vote]

by JoshMars » Post

Ten minutes of googling got me nothing, so I stitched this nice little mod together. This mod adds a vote block. It can be configured to have 5 options, and one question. After submitting, anyone can vote (including the owner) howbeit only once.

Edit: Options left empty are removed when the form is submitted for voting.

Depends: None.
GitHub: https://github.com/joshuamars/minetest-mod-vote
Download: https://github.com/joshuamars/minetest- ... master.zip
Last edited by JoshMars on Fri Mar 10, 2017 21:25, edited 3 times in total.

User avatar
rubenwardy
Moderator
Posts: 6079
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [mod] Vote Block [vote]

by rubenwardy » Post

A mod with this mod name already exists - please rename to voteblock

viewtopic.php?t=12829

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [mod] Vote Block [vote]

by JoshMars » Post

Lol ok

User avatar
Tmanyo
Member
Posts: 196
Joined: Mon Sep 29, 2014 01:20
GitHub: Tmanyo
IRC: Tmanyo
In-game: tmanyo
Location: United States
Contact:

Re: [Mod] Vote Block [vote]

by Tmanyo » Post

I made something like this for a server I host around election time.
Tmanyo
http://www.rrhmsservers.ml
Servers I Host:
Tmanyo-Realism
Mods of mine that I don't totally hate:
Bank Accounts
T-Rating
Tmusic Player

User avatar
rubenwardy
Moderator
Posts: 6079
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Vote Block [vote]

by rubenwardy » Post

It appears you changed the name back

User avatar
Peppy
Member
Posts: 34
Joined: Sun Nov 06, 2016 07:34
IRC: Peppy
In-game: Peppy
Location: France

Re: [Mod] Vote Block [vote]

by Peppy » Post

Hi,
Very interesting mod !

A few few suggestions :
- Calling this mod "Poll" or "Simple Poll", would avoid confusion.
- Unused answers in the poll (blank or left to default) should not appear in the list when voting.
- intllib support (I already did this localy, i might help...)
- Maybe an expiry time.

Thanks.

BBmine
Member
Posts: 3475
Joined: Sun Jul 12, 2015 22:51
GitHub: BBmine
IRC: BBmine
In-game: Baggins
Location: USA

Re: [Mod] Vote Block [vote]

by BBmine » Post

Nice mod for my birthday :D (My BD is on Feb 14)

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

Updated: empty options are removed on poll submit.

User avatar
Peppy
Member
Posts: 34
Joined: Sun Nov 06, 2016 07:34
IRC: Peppy
In-game: Peppy
Location: France

Re: [Mod] Vote Block [vote]

by Peppy » Post

This mod seems to be broken now :(
I can fill the form but I can't vote, black form is shown.

luacheck utility throws more errors than previous version, complaining about unused variables.
I'll try to give more information later.

Anyway, I made replacement images for the poll and wield image (Licence CC BY).
It needs this code to display properly :

Code: Select all

node_box = {type="fixed",fixed={-0.5,-0.5,0.5,0.5,0.5,0.45}},
Attachments
vote_wi.png
(1.54 KiB) Not downloaded yet
vote_front_a.png
(1.2 KiB) Not downloaded yet
Last edited by Peppy on Sat Mar 11, 2017 15:36, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6079
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Vote Block [vote]

by rubenwardy » Post

You still need to rename this mod

Using the same name breaks the dependency system - no longer does depending on "vote" mean your depending on the API provided by my mod.
It also leads to user confusion, by having two mods that work drastically differently called the same thing. For example, a user may look in depends.txt and then install the wrong mod.
It also leads to potentially confusing conflicts, for example one of our mods overriding the other in load order eg: if one is in the subgame, and the other is in the mod folder.

To change your mod's name, change [vote] to something else such as [voteblock], then replace all instances of vote in your mod to the new name. This includes node names and variable names.

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

lol too much work. Do it yourself and Ill pull it.

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

Fixed the blank dropdown issue

User avatar
Peppy
Member
Posts: 34
Joined: Sun Nov 06, 2016 07:34
IRC: Peppy
In-game: Peppy
Location: France

Re: [Mod] Vote Block [vote]

by Peppy » Post

The Options won't accept comas anymore, this is a problem for me.

Need mod name change too...

Thanks.

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

I need a function to escape out characters like that.

bell07
Member
Posts: 587
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Vote Block [vote]

by bell07 » Post

Code: Select all

minetest.formspec_escape(text)

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

Wow lol. I rlly should read that methods page on the wiki

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

Added minetest.formspec_escape -- thanks bell07

User avatar
Wuzzy
Member
Posts: 3925
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Vote Block [vote]

by Wuzzy » Post

@rubenwardy: We definitely should make it a requirement for mods to have an unique name before they are allowed to be moved to Mod Releases, unless there is a VERY good reason for using a duplicate name.
Ignorant modders refusing to use an unique name should not be rewarded by moving their mods to Mod Releases.
Ten minutes of googling got me nothing
Google is useless for finding Minetest mods. Use this search engine instead:
http://krock-works.16mb.com/MTstuff/modSearch.php
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

lol wuzzy that search engine is useless too. I actually try that first.

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

Ooh, btw, rubenwardy should change his mod name to [votekick], because it is misleading.

User avatar
Wuzzy
Member
Posts: 3925
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Vote Block [vote]

by Wuzzy » Post

JoshMars wrote:lol wuzzy that search engine is useless too. I actually try that first.
What are you talking about? Typing in “vote” yields the correct result:

http://krock-works.16mb.com/MTstuff/mod ... t=0&q=vote

Both rubenwardy's and your mod appear.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Peppy
Member
Posts: 34
Joined: Sun Nov 06, 2016 07:34
IRC: Peppy
In-game: Peppy
Location: France

Re: [Mod] Vote Block [vote]

by Peppy » Post

JoshMars wrote:Ooh, btw, rubenwardy should change his mod name to [votekick], because it is misleading.
Rubenwardy's mod thread title says :
[Mod] Vote (with Kick voting) [0.1] [vote] - an API

What is misleading ?

User avatar
rubenwardy
Moderator
Posts: 6079
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Vote Block [vote]

by rubenwardy » Post

JoshMars wrote:Ooh, btw, rubenwardy should change his mod name to [votekick], because it is misleading.
Kick is an example, the main part of the mod is the vote api
Like how awards provides default awards

JoshMars
Member
Posts: 108
Joined: Sat May 17, 2014 23:24
In-game: rubber UbuntuJosh

Re: [Mod] Vote Block [vote]

by JoshMars » Post

wuzzy I meant I was looking for a mod that was a block that you could vote from, and I couldn't find one. Obviously rubenwardys [vote] is not what I was looking for.

Isja Krass
Member
Posts: 46
Joined: Sat Aug 18, 2018 19:30
In-game: init.lua
Location: {X=25.25, y=-400, z=478,8} Bavaria, Germany

Re: [Mod] Vote Block [vote]

by Isja Krass » Post

like this mod so mutch! :-)

Image
Attachments
vote.png
(13.36 KiB) Not downloaded yet
my topics | profile | contact me | nothing else to say...

Post Reply

Who is online

Users browsing this forum: Bastrabun and 2 guests