From f3d75469c9d1bfa1b788e658735d5afbbec40a8f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Oct 2020 19:08:14 +0200 Subject: [PATCH] - moved two native player menu functions out of the main menu class. These manipulate entries of that menu and have no business being called from anywhere else than this menu and its subclasses. --- src/menu/doommenu.cpp | 4 ++-- wadsrc/static/zscript/ui/menu/menu.zs | 2 -- wadsrc/static/zscript/ui/menu/newplayermenu.zs | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/menu/doommenu.cpp b/src/menu/doommenu.cpp index 1e5115827..e05da9d92 100644 --- a/src/menu/doommenu.cpp +++ b/src/menu/doommenu.cpp @@ -937,7 +937,7 @@ void M_CreateGameMenus() } } -DEFINE_ACTION_FUNCTION(DMenu, UpdateColorsets) +DEFINE_ACTION_FUNCTION(DNewPlayerMenu, UpdateColorsets) { PARAM_PROLOGUE; PARAM_POINTER(playerClass, FPlayerClass); @@ -963,7 +963,7 @@ DEFINE_ACTION_FUNCTION(DMenu, UpdateColorsets) return 0; } -DEFINE_ACTION_FUNCTION(DMenu, UpdateSkinOptions) +DEFINE_ACTION_FUNCTION(DNewPlayerMenu, UpdateSkinOptions) { PARAM_PROLOGUE; PARAM_POINTER(playerClass, FPlayerClass); diff --git a/wadsrc/static/zscript/ui/menu/menu.zs b/wadsrc/static/zscript/ui/menu/menu.zs index eb54eb274..d47af6fc2 100644 --- a/wadsrc/static/zscript/ui/menu/menu.zs +++ b/wadsrc/static/zscript/ui/menu/menu.zs @@ -99,8 +99,6 @@ class Menu : Object native ui version("2.4") native static void SetMouseCapture(bool on); native void Close(); native void ActivateMenu(); - native static void UpdateColorsets(PlayerClass cls); - native static void UpdateSkinOptions(PlayerClass cls); //============================================================================= // diff --git a/wadsrc/static/zscript/ui/menu/newplayermenu.zs b/wadsrc/static/zscript/ui/menu/newplayermenu.zs index 53ae647b4..82214036b 100644 --- a/wadsrc/static/zscript/ui/menu/newplayermenu.zs +++ b/wadsrc/static/zscript/ui/menu/newplayermenu.zs @@ -408,6 +408,9 @@ class OptionMenuItemPlayerSwitchOnPickupItem : OptionMenuItemOptionBase class NewPlayerMenu : OptionMenu { + protected native static void UpdateColorsets(PlayerClass cls); + protected native static void UpdateSkinOptions(PlayerClass cls); + PlayerClass mPlayerClass; int mRotation; PlayerMenuPlayerDisplay mPlayerDisplay;