Anmelden

Archiv verlassen und diese Seite im Standarddesign anzeigen : Schriftfarbenscript für Choicebefehl gesucht



Ken der Kot
28.02.2018, 12:12
Hallo Community,

ich suche nach einem Script, was mir die Möglichkeit einräumt, innerhalb der Choice-Befehle des Vx-Ace folgendes zu tun. Es soll für jeden Choice eine einzelne Bearbeitungsmöglichkeit geben.

- Schriftfarbe ändern
- Schriftart ändern
- Schrift fettgedruckt
- Schrift kursiv

Was ich machen möchte:

http://cloud-3.steamusercontent.com/ugc/486687329883807485/B4CFA22F76C9161C6500338B3244950530E88B61/

Kann mir jemand helfen? Alleine kriege ich das nicht zusammen im Script Editor. So ein Script könnte bestimmt auch vielen anderen Entwicklern helfen, ihre Choice Befehle extremst aufzumotzen.

Viele Grüße,

Euer Ken der Kot

Mordechaj
28.02.2018, 15:28
Vielleicht als eine erste Teillösung: Himes Choice Options (http://himeworks.com/2013/03/choice-options/) hat eine Method für die Auswahlfarbe. Ich könnte mir vorstellen, dass es gar nicht soooo kompliziert wäre, das Script um andere Methods zu ergänzen, die auf die Fontattribute zugreifen.

Leider besitze ich den Ace nicht und arbeite auch nicht damit, deshalb kann ich nur spekulieren und umsetzen könnte ich es wohl selber auch nicht. Aus demselben Grund das auch als Frage an die Ace-Nutzer, weil ich es nicht ohne weiteres überprüfen kann (allein, ich finde nicht mal auf Anhieb einen aktiven Download-Link): Lässt sich sowas nicht vielleicht auch irgendwie mit Yanfly's Ace Message System umsetzen? Es würde mich fast wundern, wenn Yanfly dafür nicht bereits irgendwo ne Lösung anbieten würde.

Ken der Kot
28.02.2018, 17:40
Man kann sagen, das ist schon mal mehr als ich dem Internet abringen konnte. Hime Choice Options hab ich zwar auch aufgestöbert, aber dass dafür eine Schriftfarbmethode existiert wusste ich nicht. Vielleicht findet sich hier ja ein begnadeter Scripter, der sowas im Nu aus dem Ärmel schütteln kann? Ich krieg das leider nicht auf die Kette und ich glaub, fremde Scripte editieren ist so ziemlich der heilige Grahl des Scriptens mit dem Ace. :(

Linkey
01.03.2018, 00:13
Auf die Schnelle hinzugefügt und marginal getestet, bei Problemen einfach melden:


=begin
#==============================================================================
Title: Choice Options
Author: Hime
Date: Sep 13, 2015
------------------------------------------------------------------------------
** Change log
Mar 1, 2018
- Author: David "Linkey" T.
- Change: enabled font settings (bold, italic, name, size)
Sep 13, 2015
- fixed cancel choice
Jun 14, 2015
- multiple conditional texts can be applied. The ones added later have
higher priority
May 2, 2015
- added support for conditional text
Jan 2, 2015
- fixed bug where choice window doesn't reflect choice size
Nov 29, 2014
- removed choice scrolling and visible choice limits
Jul 6, 2014
- fixed bug where disabling choices will produce incorrect cancel branching
Jul 5, 2014
- fixed bug where cancel branch was not included in the choices
Nov 17, 2013
- choice formulas are now evaluated in the interpreter (rather than
Game_Message)
Oct 18, 2013
- added "disable_color" option
Jun 9, 2013
- bug fix: last choice was not colored correctly
Apr 10, 2013
- new lines automatically removed for "text" option
Apr 9, 2013
- added "text" choice option
Mar 8, 2013
- fixed a copy-by-reference issue
Mar 6, 2013
- hidden choice fixed
- new script interface added
Dec 6, 2012
- removed multiple choice implementation to be more flexible
- implemented scrolling choices
Dec 4, 2012
- added support for built-in choice editor
- initial release
------------------------------------------------------------------------------
** Terms of Use
* Free to use in non-commercial projects
* Contact me for commercial use
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Preserve this header
------------------------------------------------------------------------------
** Description

This script provides extended control over choices.

You can add "choice options" to each choice for further control over how
they should appear, when they should appear, ...
--------------------------------------------------------------------------------
** Installation

Place this script below Materials and above Main

------------------------------------------------------------------------------
** Usage

To add choice option, use one of the methods defined in the reference section.
For example, if you want to hide a choice 1 if actor 1's level is less than 5,
you would write

hide_choice(1, "$game_actors[1].level < 5")

------------------------------------------------------------------------------
** Reference

The following options are available

Method: disable_choice
Effect: disables choice if condition is met
Usage: Takes a string representing a boolean statement. For example,
"$game_actors[1].level > 5" means that the condition will only be
selectable if actor 1's level is greater than 5.

Method: hide_choice
Effect: hides choice if condition is met
Usage: Takes a string representing a boolean statement. For example,
"$game_party.gold < 2000" means that the condition will not be shown
if the party's gold is less than 2000

Method: color_choice
Effect: Very simple text color changing based on system colors
Usage: Takes an integer as the text color, based on the system colors.
(eg: 2 is red by default). Check the "Window.png" file in your
RTP folder to see the default colors

Method: text_choice
Effect: Sets the text of the choice to the custom text.
Usage: Takes a string that will replace whatever you place in the choice
editor. This allows you to exceed the 50-char limit. Additionally,
you can specify a second string which is a condition. If the condition
is met, only then will this text be applied. When multiple text choice
calls are applied, priority is given to the last script call.
------------------------------------------------------------------------------
** Compatibility

This script must be placed below Large Choices
------------------------------------------------------------------------------
** Credits

Enelvon, for scrolling choices implementation
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_ChoiceOptions"] = true
#==============================================================================
# ** Configuration
#==============================================================================
module Tsuki
module Choice_Options

end
end
#==============================================================================
# ** Rest of the script
#==============================================================================
class Game_Message
attr_reader :choice_map
attr_accessor :orig_choices
attr_accessor :choice_options

alias :th_choice_options_clear :clear
def clear
th_choice_options_clear
clear_choice_options
@choice_map = []
@orig_choices = []
end

def clear_choice_map

end

# Hardcode...
def clear_choice_options
@choice_options = {}
@choice_options[:condition] = {}
@choice_options[:hidden] = {}
@choice_options[:color] = {}
@choice_options[:text] = {}
@choice_options[:cond_text] = {}
@choice_options[:disable_color] = {}
@choice_options[:font_bold] = {}
@choice_options[:font_italic] = {}
@choice_options[:font_size] = {}
@choice_options[:font_name] = {}
end

# Just hardcode. Refactor later.
def set_choice_option(type, num, arg)
case type
when :condition
@choice_options[type][num] = arg
when :hidden
@choice_options[type][num] = arg
when :color
@choice_options[type][num] = arg.to_i
when :text
arg[0].gsub!("\n", "")
@choice_options[type][num] ||= []
@choice_options[type][num] << arg
when :disable_color
@choice_options[type][num] = arg.to_i
when :font_bold
@choice_options[type][num] = arg
when :font_italic
@choice_options[type][num] = arg
when :font_size
@choice_options[type][num] = arg
when :font_name
@choice_options[type][num] = arg
else
return
end
end

def get_choice_option(type, num)
return @choice_options[type][num]
end

def choice_hidden?(num)
return @choice_options[:hidden][num]
end
end

class Game_Interpreter

alias :th_choice_options_setup_choices :setup_choices
def setup_choices(params)
# start with our original choices
th_choice_options_setup_choices(params)
replace_choice_texts
setup_choice_map
end

def replace_choice_texts
$game_message.choices.size.times do |i|
data = $game_message.get_choice_option(:text, i+1)
next unless data
data.reverse.each do |text, cond|
if eval_choice_condition(cond)
$game_message.choices[i] = text
break
end
end
end
end

#-----------------------------------------------------------------------------
# New. Go through hidden choices and map the indices appropriately.
# The list of choices should only contain the list of visible choices
# since other classes probably don't expect to have to check whether
# a choice is hidden or not
#-----------------------------------------------------------------------------
def setup_choice_map
$game_message.orig_choices = $game_message.choices.clone
$game_message.choices.clear
$game_message.orig_choices.each_with_index do |choice, i|
next if choice_hidden?(i+1)
$game_message.choices.push(choice)
$game_message.choice_map.push(i)
end

# Add "branch" choice to the list. Remember to subtract 1 since it's always
# the last one. The assumption here is that the branch choice is never
# hidden...
if $game_message.choice_cancel_type > 0
$game_message.choice_map.push($game_message.orig_choices.size )
end

# We need to update the cancel choice.
# Cancel choice of 0 means it is disallowed.
if $game_message.choice_cancel_type == 0
###

# By default, the last choice is the branch choice, so we just set it to the
# last one in our choice map
elsif $game_message.choice_cancel_type == $game_message.orig_choices.size + 1
$game_message.choice_cancel_type = $game_message.choice_map.size
# Canceling is allowed, but the cancel choice is hidden, so we disallow
# canceling by setting it to zero
elsif choice_hidden?($game_message.choice_cancel_type) || choice_disabled?($game_message.choice_cancel_type)
$game_message.choice_cancel_type = 0
end

# redefine the choice proc
$game_message.choice_proc = Proc.new {|n|
@branch[@indent] = $game_message.choice_map[n] || 4
}
end

# Return true if the choice is hidden
def choice_hidden?(n)
$game_message.get_choice_option(:hidden, n)
end

def choice_disabled?(n)
$game_message.get_choice_option(:condition, n)
end

# add a choice option
def choice_option(type, choice_num, arg)
$game_message.set_choice_option(type.to_sym, choice_num, arg)
end

def hide_choice(choice_num, condition)
$game_message.set_choice_option(:hidden, choice_num, eval_choice_condition(condition))
end

def disable_choice(choice_num, condition)
$game_message.set_choice_option(:condition, choice_num, eval_choice_condition(condition))
end

def color_choice(choice_num, value)
$game_message.set_choice_option(:color, choice_num, value)
end

def disable_color_choice(choice_num, value)
$game_message.set_choice_option(:disable_color, choice_num, value)
end

def text_choice(choice_num, text, condition="")
$game_message.set_choice_option(:text, choice_num, [text, condition])
end

def choice_font_bold(choice_num, args=true)
$game_message.set_choice_option(:font_bold, choice_num, args)
end

def choice_font_italic(choice_num, args=true)
$game_message.set_choice_option(:font_italic, choice_num, args)
end

def choice_font_size(choice_num, args)
$game_message.set_choice_option(:font_size, choice_num, args.to_i)
end

def choice_font_name(choice_num, args)
$game_message.set_choice_option(:font_name, choice_num, args)
end

def eval_choice_condition(condition, p=$game_party, t=$game_troop, s=$game_switches, v=$game_variables)
return true if condition.empty?
eval(condition)
end
end

class Window_ChoiceList < Window_Command

def update_placement
self.width = [max_choice_width + 12, 96].max + padding * 2
self.width = [width, Graphics.width].min
self.height = fitting_height($game_message.choices.size)
self.x = Graphics.width - width
if @message_window.y >= Graphics.height / 2
self.y = @message_window.y - height
else
self.y = @message_window.y + @message_window.height
end
end

# Overwrite. Apply choice options when making text
def make_command_list
$game_message.orig_choices.each_with_index do |choice, i|
next if $game_message.choice_hidden?(i+1)
condition = $game_message.get_choice_option(:condition, i+1)
condition_met = condition.nil? ? true : !condition
add_command(choice, :choice, condition_met)
end
end

# Apply font-related choice options when drawing choices
alias :th_multiple_choice_draw_item :draw_item
def draw_item(index)
set_choice_color(index)
th_multiple_choice_draw_item(index)
end

# I have my own font settings for each option so don't need the default
def reset_font_settings
end

# New. Apply font settings
def set_choice_color(index)
color = $game_message.get_choice_option(:color, $game_message.choice_map[index] + 1)
disable_color = $game_message.get_choice_option(:disable_color, $game_message.choice_map[index] + 1)
contents.font.bold = $game_message.get_choice_option(:font_bold, $game_message.choice_map[index] + 1)
contents.font.italic = $game_message.get_choice_option(:font_italic, $game_message.choice_map[index] + 1)
contents.font.size = $game_message.get_choice_option(:font_size, $game_message.choice_map[index] + 1) if($game_message.get_choice_option(:font_size, $game_message.choice_map[index] + 1))
if($game_message.get_choice_option(:font_name, $game_message.choice_map[index] + 1))
contents.font.name = $game_message.get_choice_option(:font_name, $game_message.choice_map[index] + 1)
else
contents.font.name = Font.default_name
end
if color && command_enabled?(index)
change_color(text_color(color), command_enabled?(index))
elsif disable_color && !command_enabled?(index)
change_color(text_color(disable_color), command_enabled?(index))
else
change_color(normal_color, command_enabled?(index))
end
end
end


Folgende Optionen hast du:
choice_font_bold(choice_id)
choice_font_italic(choice_id)
choice_font_size(choice_id, size)
choice_font_name(choice_id, font_name)

Möchtest du bspw. die 2. Option bold und in Schriftgröße 18 machen:
choice_font_bold(2)
choice_font_size(2,18)

Und Option 3 soll Comic Sans MS als Font verwenden:
choice_font_name(3,"Comic Sans MS")

Beste Grüße,

Ken der Kot
01.03.2018, 09:53
WOW! Danke, Linkey!!!

Ich habe nur zwei Probleme: Wenn ich einen Choice (zb 2, wie ich deinem Beispiel) verändere und für die anderen keinen Script Call einfüge, verändert es alle anderen Choices genau auf dieselbe Art, anstatt sie normal zu lassen. Mach ich also die erste Choice größer zum Beispiel

choice_font_bold(1)
choice_font_size(1,30)

so wird das für alle Choices danach übernommen. Das möchte ich nicht. Oder ist das ein Fehler von Hime?

BTW wollte ich noch ein KURSIV-Befehl, das wäre mir noch sehr wichtig. Möchtest du das noch ergänzen?

Achso, das ist font_italic. Also schon drin. Manchmal bin ich echt doof.

Eine Frage noch: Müssen dann alle Fonts in den Spieleordner, damit der Spieler dann auch alle Fonts sehen kann, sofern er sie nicht bereits unter Windows oder Mac installiert hat?

Linkey
01.03.2018, 10:19
Bin leider noch bis heute Abend auf der Arbeit - dann kann ich mal da reinschauen.
Hatte das heute Nacht im Test aber nicht gesehen - da konnte ich eines Bold machen, das andere Italic und die anderen unverändert lassen.

Normalerweise kann man beim Font.name ein Array übergeben ["Schriftart1","Schriftart2","Schriftart3",...] und der RPG Maker nimmt dann die erste Schrift, die im System vorhanden ist (ist Schriftart1 nicht da, nimmt er Schriftart2, ist die nicht da nimmt er Schriftart3).
Bin mir aus dem Kopf heraus nicht sicher, ob das nur im Font.default_name einstellbar ist. Das prüfe ich heute Abend dann direkt mit.

Ken der Kot
01.03.2018, 11:29
Ich versuche gerade, einzurichten, dass die Font meine Default-Schriftart hat, wenn ein bestimmter Switch nicht 1 ist. Ansonsten soll er die von mir eingestellte Font haben. Ich versuche:

choice_font_name(1, "Helvetica", "$game_variables[26] < 1")

Klappt nicht. Fehler: "wrong number of arguments (2 of 3)

Was mach ich da falsch?

Linkey
01.03.2018, 12:30
Ich habe keinerlei Switch-Abfragen in den Font-Methoden eingefügt. Kann ich heute Abend eventuell hinzuschreiben. In deinem Beispiel fragst du übrigens ab, ob eine Variable kleiner 1 ist.
Was aktuell schon funktionieren müsste:

choice_font_name(1, "Helvetica") if($game_switch[26])

oder falls du es wirklich mit variable ungleich 1 abfragen willst:

choice_font_name(1, "Helvetica") if($game_variables[26] != 1)

Schaue da aber heute Abend dann rein.

Ken der Kot
01.03.2018, 13:21
Danke. So würd es gehen, aber hat sich mittlerweile eh erledigt. Der Eventbefehl "Script" im Vx-Ace ist vom Platz her leider limitiert und ich bring es da nicht mehr unter. Hefte ich mehrere Scriptcalls hintereinander, spuckt es mir Fehlermeldungen aus. Also lasse ich alles wie es ist und Frage die Font in den Choices jetzt halt über Branch ab. Das tut es ja auch irgendwie.

Mal ein kleiner Zwischenstand, falls es irgendjemanden interessiert, was ich mit dem Kram hier überhaupt grad so verbrochen hab. Wenn die entsprechenden Variablen für Intimidation, Persuation und Seduction ungleich 1 sind, wird ein anderer Text angezeigt und zwar in der Default Font in der normalen Schriftgröße und Farbe, wie man sie auch in der Textbox gestaunen kann. Funktioniert alles und ich bin recht zufrieden so far.

Linkey
01.03.2018, 23:23
=begin
#==============================================================================
Title: Choice Options
Author: Hime
Date: Sep 13, 2015
------------------------------------------------------------------------------
** Change log
Mar 1, 2018
- Author: David "Linkey" T.
- Change: enabled font settings (bold, italic, name, size)
Sep 13, 2015
- fixed cancel choice
Jun 14, 2015
- multiple conditional texts can be applied. The ones added later have
higher priority
May 2, 2015
- added support for conditional text
Jan 2, 2015
- fixed bug where choice window doesn't reflect choice size
Nov 29, 2014
- removed choice scrolling and visible choice limits
Jul 6, 2014
- fixed bug where disabling choices will produce incorrect cancel branching
Jul 5, 2014
- fixed bug where cancel branch was not included in the choices
Nov 17, 2013
- choice formulas are now evaluated in the interpreter (rather than
Game_Message)
Oct 18, 2013
- added "disable_color" option
Jun 9, 2013
- bug fix: last choice was not colored correctly
Apr 10, 2013
- new lines automatically removed for "text" option
Apr 9, 2013
- added "text" choice option
Mar 8, 2013
- fixed a copy-by-reference issue
Mar 6, 2013
- hidden choice fixed
- new script interface added
Dec 6, 2012
- removed multiple choice implementation to be more flexible
- implemented scrolling choices
Dec 4, 2012
- added support for built-in choice editor
- initial release
------------------------------------------------------------------------------
** Terms of Use
* Free to use in non-commercial projects
* Contact me for commercial use
* No real support. The script is provided as-is
* Will do bug fixes, but no compatibility patches
* Features may be requested but no guarantees, especially if it is non-trivial
* Preserve this header
------------------------------------------------------------------------------
** Description

This script provides extended control over choices.

You can add "choice options" to each choice for further control over how
they should appear, when they should appear, ...
--------------------------------------------------------------------------------
** Installation

Place this script below Materials and above Main

------------------------------------------------------------------------------
** Usage

To add choice option, use one of the methods defined in the reference section.
For example, if you want to hide a choice 1 if actor 1's level is less than 5,
you would write

hide_choice(1, "$game_actors[1].level < 5")

------------------------------------------------------------------------------
** Reference

The following options are available

Method: disable_choice
Effect: disables choice if condition is met
Usage: Takes a string representing a boolean statement. For example,
"$game_actors[1].level > 5" means that the condition will only be
selectable if actor 1's level is greater than 5.

Method: hide_choice
Effect: hides choice if condition is met
Usage: Takes a string representing a boolean statement. For example,
"$game_party.gold < 2000" means that the condition will not be shown
if the party's gold is less than 2000

Method: color_choice
Effect: Very simple text color changing based on system colors
Usage: Takes an integer as the text color, based on the system colors.
(eg: 2 is red by default). Check the "Window.png" file in your
RTP folder to see the default colors

Method: text_choice
Effect: Sets the text of the choice to the custom text.
Usage: Takes a string that will replace whatever you place in the choice
editor. This allows you to exceed the 50-char limit. Additionally,
you can specify a second string which is a condition. If the condition
is met, only then will this text be applied. When multiple text choice
calls are applied, priority is given to the last script call.
------------------------------------------------------------------------------
** Compatibility

This script must be placed below Large Choices
------------------------------------------------------------------------------
** Credits

Enelvon, for scrolling choices implementation
#==============================================================================
=end
$imported = {} if $imported.nil?
$imported["TH_ChoiceOptions"] = true
#==============================================================================
# ** Configuration
#==============================================================================
module Tsuki
module Choice_Options

end
end
#==============================================================================
# ** Rest of the script
#==============================================================================
class Game_Message
attr_reader :choice_map
attr_accessor :orig_choices
attr_accessor :choice_options

alias :th_choice_options_clear :clear
def clear
th_choice_options_clear
clear_choice_options
@choice_map = []
@orig_choices = []
end

def clear_choice_map

end

# Hardcode...
def clear_choice_options
@choice_options = {}
@choice_options[:condition] = {}
@choice_options[:hidden] = {}
@choice_options[:color] = {}
@choice_options[:text] = {}
@choice_options[:cond_text] = {}
@choice_options[:disable_color] = {}
@choice_options[:font_bold] = {}
@choice_options[:font_italic] = {}
@choice_options[:font_size] = {}
@choice_options[:font_name] = {}
end

# Just hardcode. Refactor later.
def set_choice_option(type, num, arg)
case type
when :condition
@choice_options[type][num] = arg
when :hidden
@choice_options[type][num] = arg
when :color
@choice_options[type][num] = arg.to_i
when :text
arg[0].gsub!("\n", "")
@choice_options[type][num] ||= []
@choice_options[type][num] << arg
when :disable_color
@choice_options[type][num] = arg.to_i
when :font_bold
@choice_options[type][num] = arg
when :font_italic
@choice_options[type][num] = arg
when :font_size
@choice_options[type][num] = arg
when :font_name
@choice_options[type][num] = arg
else
return
end
end

def get_choice_option(type, num)
return @choice_options[type][num]
end

def choice_hidden?(num)
return @choice_options[:hidden][num]
end
end

class Game_Interpreter

alias :th_choice_options_setup_choices :setup_choices
def setup_choices(params)
# start with our original choices
th_choice_options_setup_choices(params)
replace_choice_texts
setup_choice_map
end

def replace_choice_texts
$game_message.choices.size.times do |i|
data = $game_message.get_choice_option(:text, i+1)
next unless data
data.reverse.each do |text, cond|
if eval_choice_condition(cond)
$game_message.choices[i] = text
break
end
end
end
end

#-----------------------------------------------------------------------------
# New. Go through hidden choices and map the indices appropriately.
# The list of choices should only contain the list of visible choices
# since other classes probably don't expect to have to check whether
# a choice is hidden or not
#-----------------------------------------------------------------------------
def setup_choice_map
$game_message.orig_choices = $game_message.choices.clone
$game_message.choices.clear
$game_message.orig_choices.each_with_index do |choice, i|
next if choice_hidden?(i+1)
$game_message.choices.push(choice)
$game_message.choice_map.push(i)
end

# Add "branch" choice to the list. Remember to subtract 1 since it's always
# the last one. The assumption here is that the branch choice is never
# hidden...
if $game_message.choice_cancel_type > 0
$game_message.choice_map.push($game_message.orig_choices.size )
end

# We need to update the cancel choice.
# Cancel choice of 0 means it is disallowed.
if $game_message.choice_cancel_type == 0
###

# By default, the last choice is the branch choice, so we just set it to the
# last one in our choice map
elsif $game_message.choice_cancel_type == $game_message.orig_choices.size + 1
$game_message.choice_cancel_type = $game_message.choice_map.size
# Canceling is allowed, but the cancel choice is hidden, so we disallow
# canceling by setting it to zero
elsif choice_hidden?($game_message.choice_cancel_type) || choice_disabled?($game_message.choice_cancel_type)
$game_message.choice_cancel_type = 0
end

# redefine the choice proc
$game_message.choice_proc = Proc.new {|n|
@branch[@indent] = $game_message.choice_map[n] || 4
}
end

# Return true if the choice is hidden
def choice_hidden?(n)
$game_message.get_choice_option(:hidden, n)
end

def choice_disabled?(n)
$game_message.get_choice_option(:condition, n)
end

# add a choice option
def choice_option(type, choice_num, arg)
$game_message.set_choice_option(type.to_sym, choice_num, arg)
end

def hide_choice(choice_num, condition)
$game_message.set_choice_option(:hidden, choice_num, eval_choice_condition(condition))
end

def disable_choice(choice_num, condition)
$game_message.set_choice_option(:condition, choice_num, eval_choice_condition(condition))
end

def color_choice(choice_num, value)
$game_message.set_choice_option(:color, choice_num, value)
end

def disable_color_choice(choice_num, value)
$game_message.set_choice_option(:disable_color, choice_num, value)
end

def text_choice(choice_num, text, condition="")
$game_message.set_choice_option(:text, choice_num, [text, condition])
end

def choice_font_bold(choice_num, args=true)
$game_message.set_choice_option(:font_bold, choice_num, args)
end

def choice_font_italic(choice_num, args=true)
$game_message.set_choice_option(:font_italic, choice_num, args)
end

def choice_font_size(choice_num, args)
$game_message.set_choice_option(:font_size, choice_num, args.to_i)
end

def choice_font_name(choice_num, args)
$game_message.set_choice_option(:font_name, choice_num, args)
end

def eval_choice_condition(condition, p=$game_party, t=$game_troop, s=$game_switches, v=$game_variables)
return true if condition.empty?
eval(condition)
end
end

class Window_ChoiceList < Window_Command

def update_placement
self.width = [max_choice_width + 12, 96].max + padding * 2
self.width = [width, Graphics.width].min
self.height = fitting_height($game_message.choices.size)
self.x = Graphics.width - width
if @message_window.y >= Graphics.height / 2
self.y = @message_window.y - height
else
self.y = @message_window.y + @message_window.height
end
end

# Overwrite. Apply choice options when making text
def make_command_list
$game_message.orig_choices.each_with_index do |choice, i|
next if $game_message.choice_hidden?(i+1)
condition = $game_message.get_choice_option(:condition, i+1)
condition_met = condition.nil? ? true : !condition
add_command(choice, :choice, condition_met)
end
end

# Apply font-related choice options when drawing choices
alias :th_multiple_choice_draw_item :draw_item
def draw_item(index)
set_choice_color(index)
th_multiple_choice_draw_item(index)
end

# I have my own font settings for each option so don't need the default
def reset_font_settings
end

# New. Apply font settings
def set_choice_color(index)
color = $game_message.get_choice_option(:color, $game_message.choice_map[index] + 1)
disable_color = $game_message.get_choice_option(:disable_color, $game_message.choice_map[index] + 1)
contents.font.bold = $game_message.get_choice_option(:font_bold, $game_message.choice_map[index] + 1)
contents.font.italic = $game_message.get_choice_option(:font_italic, $game_message.choice_map[index] + 1)
if($game_message.get_choice_option(:font_size, $game_message.choice_map[index] + 1))
contents.font.size = $game_message.get_choice_option(:font_size, $game_message.choice_map[index] + 1)
else
contents.font.size = Font.default_size
end
if($game_message.get_choice_option(:font_name, $game_message.choice_map[index] + 1))
contents.font.name = $game_message.get_choice_option(:font_name, $game_message.choice_map[index] + 1)
else
contents.font.name = Font.default_name
end
if color && command_enabled?(index)
change_color(text_color(color), command_enabled?(index))
elsif disable_color && !command_enabled?(index)
change_color(text_color(disable_color), command_enabled?(index))
else
change_color(normal_color, command_enabled?(index))
end
end
end


Das mit der Font-Size war mein Fehler. Hatte übersehen, dass die Fonts hier nicht mehr überschrieben werden und ich das manuell machen muss. Sollte mit dem Update oben gehen.
Muss ich dir jetzt noch Conditions mit reinbauen? Das geht wie gesagt auch über die Script-Call-Befehle. Natürlich kannst du mehere calls hintereinander benutzen, ohne dass es eine Fehlermeldung wirft. Wenn eine Zeile zu lang ist, kannst du es wie folgt "ausschreiben":


if($game_variables[26] != 1)
choice_font_size(1,55)
end

if($game_switches[5])
choice_font_bold(1)
else
choice_font_italic(1)
end

Ken der Kot
02.03.2018, 01:30
Muss ich dir jetzt noch Conditions mit reinbauen?

Nein, wie kommst du darauf? Mein System steht und du kannst es im Screenshot oben ausführlich bestaunen, was da zu Tage getreten ist. Hat sich wie gesagt erledigt, da alles so funzt wie es soll. Die Firma Ken der Kot dankt für die Unterstützung.

Ken der Kot
05.03.2018, 16:18
Hab mal noch ein bissle dran rumgewerkelt und die Schriftgrößen angepasst, damit das nicht alles so uneinheitlich aussieht. Bitte schildert eure Eindrücke! Sieht das gut aus oder ist das (in welcher Art und Weise auch immer) "too much"? Kann man das eurer Meinung nach gut lesen in den verschiedenen Schriftarten? Spricht es euch überhaupt an?

Welche der beiden Varianten findet ihr besser?

Kael
06.03.2018, 20:58
Die Zweite. Grund dafür ist, dass die Schrift im allgemeinen leserlicher aussieht wie in Variante 1.

Ken der Kot
07.03.2018, 13:21
@ Kael: Ja das seh ich genauso wie du daher hab ich mich auch für diese Variante entschieden. Ob ich das noch verfeinern kann weiß ich gerade noch nicht.