[REQUEST] Select all maps button

Started by Kit Fisto, February 10, 2014, 01:08:15 PM

Previous topic - Next topic
Is there a way someone could create a "Select all maps and eras" button for the SWBFI instant action list? But keep the "play in random order" button?

February 10, 2014, 01:35:39 PM #1 Last Edit: February 10, 2014, 01:40:04 PM by Vîathan
so that all maps and all "modes" are added to the session-list?
could be done with lua editing a sp.lua file (s.t. like ifs_sp_sessionlist.lua)
I'll try that the next days

Edit: could be the missionlist.lua (Shell script)

Quote from: Kit Fisto on February 10, 2014, 01:08:15 PM
Is there a way someone could create a "Select all maps and eras" button for the SWBFI instant action list? But keep the "play in random order" button?
Yes and No. The button itself would be simple, but there is a cap on how many missions you can add to the list I think. Not sure what it is though.

This what SK answered and modmaps would be the problem.
You have to find out what happens if you add a map to the list. To add these function to a new button would be makeable :)
But dont know what the limit is (maps in list) and how to add the modmaps into list

You could probably just hard code all the stock maps to the button press.  No need to make it too complicated  ;)
Quote from: Abraham Lincoln. on November 04, 1971, 12:34:40 PM
Don't believe everything you read on the internet

Yes, that was my idea. So modmaps are not supported by this way.
And the sessionlimit is rly nice, ~74 maps you can add!  :)

Well, after few minutes Lua coding, I've added a new Button to sessionlist:


It has no function yet. (looks bit weird, it's in german  8)  )

For modders:
Add these lines to your ifs_missionselect.lua (Shell script)
atm I have no time to add a function, so feel free to use my button, maybe s.o. can finish it :cheers:

(Change the button name, text or whatever you want)
[spoiler=LuaCode->ifs_missionselect.lua]

this.AddAllButton = NewClickableIFButton {
ScreenRelativeX = 0.699, -- position X
ScreenRelativeY = 0.825, -- position Y
rotY = this.listboxL.rotY, -- rotation (3D-effect)
x = this.listboxL.x + 23,
--y = this.listboxL.height / 2 + 11, --> forgot x)
y = this.listboxL.y + 5,
btnw = this.listboxL.width, -- > listboxL => left  and  listboxR = right
btnh = ScriptCB_GetFontHeight("gamefont_small"),
font = "gamefont_small",
tag = "addall", -- internal btn name f.e. functions
string = "add all maps", -- text
}

Without comments:

this.AddAllButton = NewClickableIFButton {
ScreenRelativeX = 0.699,
ScreenRelativeY = 0.825,
rotY = this.listboxL.rotY,
x = this.listboxL.x + 23,
--y = this.listboxL.height / 2 + 11,
y = this.listboxL.y + 5,
btnw = this.listboxL.width,
btnh = ScriptCB_GetFontHeight("gamefont_small"),
font = "gamefont_small",
tag = "addall",
string = "add all maps",
}

[/spoiler]

Yay! Your close to getting it! Thanks for working on it, it means a lot to me. :)

Quote from: Kit Fisto on February 12, 2014, 07:30:05 PM
Yay! Your close to getting it! Thanks for working on it, it means a lot to me. :)

:happy:
I have some ideas about that, I will test them from time to time

I like ur button.
me gusta n' all that stuf'

Quote from: Ltin on February 14, 2014, 07:42:29 AM
I like ur button.
me gusta n' all that stuf'
8)
I think next week or next weekend I get first results  :)

How's the progress on this mini mod going?

Ok, sry for the long waiting time.

The function to add one map to the list:
Code (lua) Select

-- Adds the currently selected map to the maplist.
function ifs_missionselect_fnAddMap(this)
local Selection = missionselect_listbox_contents[missionselect_name_listboxL_layout.SelectedIdx]


So I think we have to write a completely new function to add all maps.
So it could be also possible to add all maps and modmaps if we can access the index of maps.

Im not as good as phobos or sleepkiller at lua, I'll post the scripts on pastebin so that we can develop together if you want.

ifs_missionselect.lua @ pastebin

This may help in your travels too.  I edit this one a lot in Mando Wars.
Code (lua) Select

498.function ifs_missionselect_fnSetMapAndTeam(this,Selection,Team1Str,Team2Str)
499.        local SelectedMap = Selection.mapluafile .. this.AttackerChar
500.        local Side = 1 -- 1 or 2
501.        local SideChar = this.CurButton -- 'a' 'c' 'i' or 'r'
502.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

Quote from: Dark_Phantom on March 03, 2014, 05:21:19 AM
This may help in your travels too.  I edit this one a lot in Mando Wars.
Code (lua) Select

498.function ifs_missionselect_fnSetMapAndTeam(this,Selection,Team1Str,Team2Str)
499.        local SelectedMap = Selection.mapluafile .. this.AttackerChar
500.        local Side = 1 -- 1 or 2
501.        local SideChar = this.CurButton -- 'a' 'c' 'i' or 'r'
502.


Seems helpful, thx for posting  :cheers: