From a9e533d65d6119944e19f28f388e8cab54c8c051 Mon Sep 17 00:00:00 2001
From: Jesusaves <cpntb1@ymail.com>
Date: Wed, 6 Nov 2019 21:47:40 -0300
Subject: Interlude: Density option on recipe book

---
 npc/commands/ucp.txt   | 16 ++++++++++++++++
 npc/craft/recipes.txt  | 16 ++++++++--------
 npc/functions/main.txt |  9 +++++++++
 3 files changed, 33 insertions(+), 8 deletions(-)

(limited to 'npc')

diff --git a/npc/commands/ucp.txt b/npc/commands/ucp.txt
index 2803663b6..7b4bce58a 100644
--- a/npc/commands/ucp.txt
+++ b/npc/commands/ucp.txt
@@ -158,6 +158,15 @@ function	script	UserCtrlPanel	{
                     mes l("Display daily reward screen: ") + col(l("Enabled"), 2);
 
 
+                // GSET_LONGMENU_DENSITY
+                // How many nexts should be queued in a density list
+                // (use higher values if you have few recipes or can scroll)
+                if (GSET_LONGMENU_DENSITY)
+                    mes l("Long Text Wall Density: ") + col(l("Normal"), 1);
+                else
+                    mes l("Long Text Wall Density: ") + col(l("Compact")+": "+GSET_LONGMENU_DENSITY, 2);
+
+
                 if (strcharinfo(2) == "Monster King") {
                     // GSET_AUTORECEIVE_COINS
                     // Enables/Disable autoreceive strange coins
@@ -177,6 +186,7 @@ function	script	UserCtrlPanel	{
                     l("Return to User Control Panel"),
                     l("Toggle Soul Menhir automatic saving"),
                     l("Toggle Daily Reward screen"),
+                    l("Text Wall Density"),
                     rif(strcharinfo(2) == "Monster King", ("Toggle Autoreceive Event Coins"));
                 mes "";
 
@@ -195,6 +205,12 @@ function	script	UserCtrlPanel	{
                     case 3:
                         GSET_DAILYREWARD_SILENT=!GSET_DAILYREWARD_SILENT; break;
                     case 4:
+                        if (GSET_LONGMENU_DENSITY > 5)
+							GSET_LONGMENU_DENSITY=0;
+						else
+							GSET_LONGMENU_DENSITY+=1;
+						break;
+                    case 5:
                         GSET_AUTORECEIVE_COINS=!GSET_AUTORECEIVE_COINS; break;
                 }
                 clear;
diff --git a/npc/craft/recipes.txt b/npc/craft/recipes.txt
index fbe47628d..5458f49eb 100644
--- a/npc/craft/recipes.txt
+++ b/npc/craft/recipes.txt
@@ -88,7 +88,7 @@ function readAlchemy {
     mesc "----------"+l("Healing Recipes")+"----------", 2;
     showRecipe(CraftPiberriesInfusion, PiberriesInfusion,
                     5, Piberries, 1, Curshroom);
-    next;
+    dnext;
 
     // General Boosts
     mesc "----------"+l("General Recipes")+"----------", 2;
@@ -104,7 +104,7 @@ function readAlchemy {
                     3, Piberries, 1, MountainSnakeEgg);
     showRecipe(CraftDodgePotion, DodgePotion,
                     3, Piberries, 1, SnakeEgg);
-    next;
+    dnext;
 
     // Stats Boosts
     mesc "----------"+l("Stat Boost Recipes")+"----------", 2;
@@ -210,7 +210,7 @@ function readCrafting {
                  3, PlatinumIngot,
                  5, IridiumIngot,
                 60, Coal);
-    next;
+    dnext;
     // Two Hands Melee Weapons: Never use Titanium nor Lead. Silver-based.
     mesc "----------"+l("Two Hands Weapon Recipes")+"----------", 2;
     showRecipe(CraftMiereCleaver, MiereCleaver,
@@ -236,7 +236,7 @@ function readCrafting {
                  3, IridiumIngot,
                  1, BlueManaPearl);
 
-    next;
+    dnext;
     // Archery Weapons: Always use Wood, Root and Carp.
     mesc "----------"+l("Archery Weapon Recipes")+"----------", 2;
     showRecipe(CraftShortBow, ShortBow,
@@ -264,7 +264,7 @@ function readCrafting {
                 45, Root,
                  5, DarkCrystal,
                  5, CommonCarp);
-    next;
+    dnext;
     // Magical Weapons: Wood + powders
     mesc "----------"+l("Magical Weapon Recipes")+"----------", 2;
     showRecipe(CraftTrainingWand, TrainingWand,
@@ -292,7 +292,7 @@ function readCrafting {
                  3, GoldenApple,
                 20, FluoPowder,
                  1, GemPowder);
-    next;
+    dnext;
     // Firestaff Weapons: Lead + Titanium
     mesc "----------"+l("Fire Staffs Recipes")+"----------", 2;
     showRecipe(CraftPynRevolver, PynRevolver,
@@ -315,7 +315,7 @@ function readCrafting {
                 10, TitaniumIngot,
                 16, Coal,
                  1, EverburnPowder);
-    next;
+    dnext;
     // Shields: May use Leather. Titanium or Lead, but never both
     mesc "----------"+l("Shield Recipes")+"----------", 2;
     showRecipe(CraftWoodenShield, WoodenShield,
@@ -363,7 +363,7 @@ function readCrafting {
                 15, TitaniumIngot,
                 40, Coal,
                  1, EverburnPowder);
-    next;
+    dnext;
     // Misc: Misc items
     mesc "----------"+l("Miscellaneous Recipes")+"----------", 2;
     showRecipe(CraftGoldenRing, GoldenRing,
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 2bfb6e29a..95587aa70 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -12,6 +12,15 @@ function	script	menuimage	{
     return getarg(0) + "|" + getarg(1);
 }
 
+function	script	dnext	{
+    if (@dnext >= GSET_LONGMENU_DENSITY) {
+		@dnext=0;
+		next;
+	} else {
+		@dnext+=1;
+	}
+}
+
 function	script	menuaction	{
     return "[" + getarg(0) + "]";
 }
-- 
cgit v1.2.3-70-g09d2