UI problems.

UI problems.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

UI problems.

Post by oksnoop2 »

Image
Image

Is there a way to make "gui_transparent" and some other widgets load on default. I don't really grasp UIs so sorry i can't be more descriptive. During a playtest someone's UI looked like the top right image. When it should look like the bottom. I just want people to see the UI correctly on the first go with out having to flip on and off an bunch of stuff.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: UI problems.

Post by Beherith »

Seems to be that lolui/redui is still on for the screenie on the right.
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: UI problems.

Post by Regret »

Beherith wrote:Seems to be that lolui/redui is still on for the screenie on the right.
Left is RedUI, right is LolUI. :regret:

As far as the topic: you would have to disable all user widgets or make a widget to unload all user widgets on first run. Either of which are very annoying for the player.
User avatar
JohannesH
Posts: 1793
Joined: 07 Apr 2009, 12:43

Re: UI problems.

Post by JohannesH »

I suggest you customise your own UI for the game, and dont allow other setups.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: UI problems.

Post by oksnoop2 »

So my two options are: Leave it alone and leave it up the user to fix it as they see fit. OR Lock it down so people are stuck with what I give them?
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: UI problems.

Post by Niobium »

You could have your UI widget unload other UI widgets (Hardcoded list). Users would still be able to open widget list and reenable theirs/disable yours if they wanted.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: UI problems.

Post by oksnoop2 »

Is there some widget, example, or tutorial on how to do this?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: UI problems.

Post by zwzsg »

Code: Select all

function widget:GetInfo()
	return {
		name = "Reset widgets and settings",
		desc = "Reset settings and widgets to fit the mod",
		author = "zwzsg",
		date = "March 5th, 2009",
		license = "Public Domain",
		layer = 0,
		enabled = true,
		handler = true,
	}
end

local function WidgetWhiteList()
	Spring.Echo("Enable some widgets")
	for n,w in pairs(widgetHandler.knownWidgets) do
		if n=="AdvPlayersList"
		or n=="Autoquit"
		or n=="CustomFormations2"
		or n=="HealthBars"
		or n=="HighlightSelectedUnits" 
		or n=="Select n Center!"
		or n=="Start Point Remover"
		or n=="MiniMap Start Boxes"
		or n=="Action Finder" 
		or n=="Music"
		or n=="Write GameState"
		or n=="Heroes Right Click"
		or n=="Hide commands"
		or n=="Keep Morpheds Selected"
		or n=="Automatic Tip Dispenser"
		or n=="Build Bar"
		or n=="Console Commands"
		or n=="Default Commands"
		or n=="Hotkeys"
		or n=="Spring Direct Launch 2"
		or n=="noResBar NoMoveWarnings" then
			widgetHandler:EnableWidget(n)
		else
			widgetHandler:DisableWidget(n)
		end
	end
end

function widget:Initialize()
	WidgetWhiteList()
	-- Don't do that! People are gonna hate you if you change their settings!
	Spring.SendCommands({"movewarnings 0","buildwarnings 0"})
	Spring.SendCommands({"volume 100"})
	Spring.SetConfigInt("AdvUnitShading",0)
	Spring.SetConfigInt("MoveWarnings",0)
	Spring.SetConfigInt("BuildWarnings",0)
	Spring.SetConfigInt("LuaAutoModWidgets",1)
	Spring.SetConfigInt("LuaModUICtrl",1)
	Spring.SetConfigInt("LuaUI",1)
	Spring.SetConfigInt("GroundDecals",1)
	Spring.SetConfigInt("CamMode",1)
	Spring.SetConfigInt("CrossSize",6)
	Spring.SetConfigInt("DynamicSky",0)
	Spring.SetConfigInt("AdvSky",0)
	Spring.SetConfigInt("UnitIconDist",500)
	Spring.SetConfigInt("UnitLodDist",500)
	Spring.SetConfigInt("SoundVolume",100)
	widgetHandler:DisableWidget(self:GetInfo().name)
end
Regret
Posts: 2086
Joined: 18 Aug 2007, 19:04

Re: UI problems.

Post by Regret »

zwzsg wrote:-- Don't do that! People are gonna hate you if you change their settings!
This. Do not forget.
User avatar
oksnoop2
Posts: 1207
Joined: 29 Aug 2009, 20:12

Re: UI problems.

Post by oksnoop2 »

So are people saying i should just do...nothing?
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: UI problems.

Post by Niobium »

I would just add in disabling other known UI widgets into your UI widget.

If people want their UI's back, then they just need to disable your widget and reenable theirs, simple. Just make sure you give your UI widget a clear name so that people can find it.
Post Reply

Return to “Lua Scripts”