Giter VIP home page Giter VIP logo

Comments (3)

Razish avatar Razish commented on May 23, 2024 1

Found and fixed the issue, thanks for the report!

The reason the original menu files work is because they fire some uiScript commands that interpret the aforementioned cvars and translate them to the correct bit-values.
At some point (before OpenJK was OpenJK) I had disabled that block of code for unknown reasons. Bringing it back fixes those buttons when creating a server.

from openjk.

Razish avatar Razish commented on May 23, 2024

I have taken a look at this. I don't see how it ever functioned in retail JKA, but I also don't have a retail install+engine+mod to test with.

If you look at the .menu file (ui/jamp/quickgame2.menu) you can see the buttons are of type ITEM_TYPE_YESNO and linked up to the cvars directly. This means the only possible values of g_weaponDisable and g_forcePowerDisable are 0 and 1, when they are actually meant to be bitfields of which weapons/forcepowers to disable.

In order for this to work right now, you would need to modify the .menu file as such:

diff --git a/base/ui/jamp/quickgame2.menu b/OpenJK/ui/jamp/quickgame2.menu
index 5cb39a5..8c7c5ee 100644
--- a/base/ui/jamp/quickgame2.menu
+++ b/OpenJK/ui/jamp/quickgame2.menu
@@ -156,10 +156,15 @@
 		{
 			name				options
 			group				grpOptions
-			type				ITEM_TYPE_YESNO
+			type				ITEM_TYPE_MULTI
 			text				@MENUS_LIGHTSABER_ONLY
 			descText			@MENUS_SABER_ONLY_INFO
 			cvar				"g_weaponDisable"	
+			cvarFloatList 
+			{ 
+				"No" 0 
+				"Only Saber" 524278
+			}
 			rect				5 130 240 20 
 			textalign			ITEM_ALIGN_RIGHT
 			textalignx			165
@@ -233,10 +238,15 @@
 		{
 			name				options
 			group				grpOptions
-			type				ITEM_TYPE_YESNO
+			type				ITEM_TYPE_MULTI
 			text				@MENUS_DISABLE_FORCE
 			descText			@MENUS_DISABLE_FORCE_INFO
 			cvar				"g_forcePowerDisable"
+			cvarFloatList 
+			{ 
+				"No" 0 
+				"Only Jump + Saber" 163837
+			}
 			cvarTest			"ui_netGameType"
 			hideCvar
 			{ 

If it really did work on the retail game, perhaps we did change the behaviour of those cvars 🤔

from openjk.

ensiform avatar ensiform commented on May 23, 2024

I still cannot find where in the original code that the server side actually checks for 1/0

from openjk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.